Skip to content

fix: ChunkTransaction create all transaction_bytes when freeze - #2506

Draft
manishdait wants to merge 16 commits into
hiero-ledger:mainfrom
manishdait:fix/chunk-generate-txbytes-on-freeze
Draft

fix: ChunkTransaction create all transaction_bytes when freeze#2506
manishdait wants to merge 16 commits into
hiero-ledger:mainfrom
manishdait:fix/chunk-generate-txbytes-on-freeze

Conversation

@manishdait

@manishdait manishdait commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description:
This PR fix the ChunkTransaction to make the transaction_bytes for every chunk once freeze instead of during execution

Changes Made

  • Added _transaction_ids to Transaction class
  • Update Transaction._transaction_body_bytes to sict[TransactionId, dict[AccountId, bytes]]
  • Updated freeze() method for the ChunkTransaction

Related issue(s):

Fixes #2480

Notes for reviewer:

  • Update Transaction._transaction_body_bytes to sict[TransactionId, dict[AccountId, bytes]], should not affect backward compatibility it is internal use only
  • TransactionId and NodeId are set in the freeze() method instead of the build_base_transaction
  • Some test are not added for from_bytes/to_bytes cause it need to refactor in follow up PR.
  • Run the validation test against TCK using solo
image

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@manishdait manishdait added the notes: extra care requires extra attention to detail or requirements label Aug 3, 2026
@github-actions github-actions Bot added the approved Issue has been approved by team member label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Hi, this is WorkflowBot.
Your pull request cannot be merged as it is not passing all our workflow checks.
Please click on each check to review the logs and resolve issues so all checks pass.
To help you:

@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from 98da211 to 0132392 Compare August 3, 2026 19:54
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.56757% with 11 lines in your changes missing coverage. Please review.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2506      +/-   ##
==========================================
- Coverage   95.47%   95.41%   -0.06%     
==========================================
  Files         165      165              
  Lines       10604    10607       +3     
==========================================
- Hits        10124    10121       -3     
- Misses        480      486       +6     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@manishdait manishdait added this to the v0.3.0 milestone Aug 5, 2026
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch 5 times, most recently from 103075c to dc31189 Compare August 8, 2026 14:07
airdrop_tx.add_approved_token_transfer_with_decimals(token_id, account_id, amount, 1)


def test_add_unbalanced_transfer_amount(mock_account_ids):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests was suppose to removed during the TCK changes, but the removal wasn’t caught because the previous build_transaction_body() implementation required a transaction id/node id, causing it to raise a ValueError which make the test pass.

@manishdait
manishdait marked this pull request as ready for review August 8, 2026 16:15
@manishdait
manishdait requested review from a team as code owners August 8, 2026 16:15
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Transactions now prepare serialized bodies for every chunk and node during freezing. Transaction IDs and body bytes use nested collections. Chunk execution and fee estimation advance through prepared IDs. Topic and file payloads emit chunk metadata only for active multi-chunk submissions.

Changes

Chunked transaction flow

Layer / File(s) Summary
Transaction state and chunk execution
src/hiero_sdk_python/transaction/transaction.py, src/hiero_sdk_python/transaction/chunked_transaction.py
Transactions store lockable transaction ID collections and per-transaction, per-node body bytes. Freezing prepares all chunk bodies. Execution selects prepared transaction IDs without rebuilding or re-signing bodies.
Chunk payloads and fee estimation
src/hiero_sdk_python/consensus/topic_message_submit_transaction.py, src/hiero_sdk_python/file/file_append_transaction.py, src/hiero_sdk_python/query/fee_estimate_query.py
Payload builders distinguish complete content from active chunks. Fee estimation serializes each prepared chunk and restores the transaction ID index.
Compatibility and freeze validation
tests/integration/*, tests/unit/*
Tests cover nested body storage, chunk serialization, collection locking, index resets, freeze immutability, signing lookups, and updated protobuf fields.

Estimated code review effort: 4 (Complex) | ~60 minutes

Mergeability Score: 🟠 High · up to e24af

The change moves transaction-body creation to freeze time, but the current implementation can leave transactions partially frozen after preparation fails, calculate sizes from bytes different from those signed and submitted, and lose batch keys during deserialization, potentially causing submission failures or bypassing required execution checks. The PR is not merge-ready until these issues are corrected.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ChunkedTransaction
  participant Transaction
  participant Node
  Client->>ChunkedTransaction: freeze_with(client)
  ChunkedTransaction->>Transaction: prepare chunk transaction IDs
  Transaction->>Transaction: build body for each chunk and node
  Client->>ChunkedTransaction: execute_all()
  ChunkedTransaction->>Transaction: select current chunk body
  Transaction->>Node: submit serialized transaction
  Node-->>Transaction: return response
  ChunkedTransaction->>Transaction: advance to next chunk
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Most changes support #2480, but removed token airdrop validation tests are unrelated to chunk prebuilding. Restore the removed token airdrop validation tests, or move that unrelated change to a separate pull request with its own issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes prebuild transaction body bytes for all chunks during freeze and reuse them during execution, satisfying issue #2480.
Docstring Coverage ✅ Passed Docstring coverage is 95.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly identifies the fix that creates transaction bytes for all chunks during freezing.
Description check ✅ Passed The description directly explains the chunk-freezing change, transaction ID updates, tests, and linked issue.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/integration/file_append_transaction_e2e_test.py (1)

309-319: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the chunk count explicitly.

The test relies on the reader computing ceil(13 / 4) == 4 from the inline comment. Nothing fails if the transaction silently collapses to a single chunk, because the final contents assertion passes either way. This PR changes how chunk bodies are generated, so the test should pin the chunk count. Add an assertion after freeze(). The comment text is also imprecise: 13 bytes at 4 bytes per chunk is exactly 4 chunks, not approximately 4.

💚 Proposed assertions
     content = "Hello, Hiero!"  # length 13
 
     tx = (
         FileAppendTransaction()
         .set_file_id(file_id)
-        .set_chunk_size(4)  # content with (13/4) bytes ie approx 4 chunks
+        .set_chunk_size(4)  # 13 bytes at 4 bytes per chunk == 4 chunks
         .set_contents(content)
         .set_transaction_id(TransactionId.generate(env.client.operator_account_id))
         .set_node_account_ids([AccountId(0, 0, 3)])
         .freeze()
     )
 
+    assert tx.get_required_chunks() == 4, "Content must split into exactly four chunks"
+    assert len(tx._transaction_ids) == 4, "One transaction ID must exist per chunk"
+
     tx.sign(env.client.operator_private_key)

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 43c7b17d-a7b7-44a2-8851-9bd24890449e

📥 Commits

Reviewing files that changed from the base of the PR and between bf51e0b and b823235.

📒 Files selected for processing (47)
  • src/hiero_sdk_python/consensus/topic_message_submit_transaction.py
  • src/hiero_sdk_python/file/file_append_transaction.py
  • src/hiero_sdk_python/lockable_list.py
  • src/hiero_sdk_python/query/fee_estimate_query.py
  • src/hiero_sdk_python/transaction/chunked_transaction.py
  • src/hiero_sdk_python/transaction/transaction.py
  • tests/integration/file_append_transaction_e2e_test.py
  • tests/integration/transaction_freeze_e2e_test.py
  • tests/unit/account_create_transaction_test.py
  • tests/unit/account_delete_transaction_test.py
  • tests/unit/account_update_transaction_test.py
  • tests/unit/batch_transaction_test.py
  • tests/unit/chunked_transaction_test.py
  • tests/unit/contract_delete_transaction_test.py
  • tests/unit/contract_execute_transaction_test.py
  • tests/unit/ethereum_transaction_test.py
  • tests/unit/executable_test.py
  • tests/unit/fee_estimate_query_test.py
  • tests/unit/file_append_transaction_test.py
  • tests/unit/file_delete_transaction_test.py
  • tests/unit/file_update_transaction_test.py
  • tests/unit/freeze_transaction_test.py
  • tests/unit/lockable_list_test.py
  • tests/unit/node_create_transaction_test.py
  • tests/unit/node_delete_transaction_test.py
  • tests/unit/node_update_transaction_test.py
  • tests/unit/prng_transaction_test.py
  • tests/unit/schedule_create_transaction_test.py
  • tests/unit/schedule_delete_transaction_test.py
  • tests/unit/schedule_sign_transaction_test.py
  • tests/unit/token_airdrop_transaction_cancel_test.py
  • tests/unit/token_airdrop_transaction_test.py
  • tests/unit/token_associate_transaction_test.py
  • tests/unit/token_create_transaction_test.py
  • tests/unit/token_delete_transaction_test.py
  • tests/unit/token_dissociate_transaction_test.py
  • tests/unit/token_freeze_transaction_test.py
  • tests/unit/token_mint_transaction_test.py
  • tests/unit/token_pause_transaction_test.py
  • tests/unit/token_unfreeze_transaction_test.py
  • tests/unit/token_unpause_transaction_test.py
  • tests/unit/topic_create_transaction_test.py
  • tests/unit/topic_delete_transaction_test.py
  • tests/unit/topic_message_submit_transaction_test.py
  • tests/unit/topic_update_transaction_test.py
  • tests/unit/transaction_freeze_and_bytes_test.py
  • tests/unit/transaction_test.py

Comment thread src/hiero_sdk_python/consensus/topic_message_submit_transaction.py Outdated
Comment thread src/hiero_sdk_python/lockable_list.py Outdated
Comment thread src/hiero_sdk_python/transaction/chunked_transaction.py Outdated
Comment thread src/hiero_sdk_python/transaction/chunked_transaction.py Outdated
Comment on lines +263 to 271
# Multi-chunk transaction - execute all chunks
responses = []
self._transaction_ids.set_index(0)
for _ in range(len(self._transaction_ids)):
response = super().execute(client, timeout, wait_for_receipt, validate_status)
responses.append(response)
self._transaction_ids.advance()

return responses

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Reset the transaction ID index after the chunk loop.

The loop advances self._transaction_ids for every chunk and never resets the index. After execute_all returns, the collection points past the first chunk, or wherever advance() left it. Any later call that reads self._transaction_ids.currenttransaction_id, _to_proto, body_size, or a second execute_all — then selects the wrong chunk. An exception from one chunk leaves the index in the same inconsistent state. freeze_with and body_size_all_chunks in this file, and FeeEstimateQuery._execute_chunked, all restore the index; this path must do the same.

🐛 Proposed fix
         # Multi-chunk transaction - execute all chunks
         responses = []
         self._transaction_ids.set_index(0)
-        for _ in range(len(self._transaction_ids)):
-            response = super().execute(client, timeout, wait_for_receipt, validate_status)
-            responses.append(response)
-            self._transaction_ids.advance()
+        try:
+            for _ in range(len(self._transaction_ids)):
+                response = super().execute(client, timeout, wait_for_receipt, validate_status)
+                responses.append(response)
+                self._transaction_ids.advance()
+        finally:
+            self._transaction_ids.set_index(0)
 
         return responses
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Multi-chunk transaction - execute all chunks
responses = []
self._transaction_ids.set_index(0)
for _ in range(len(self._transaction_ids)):
response = super().execute(client, timeout, wait_for_receipt, validate_status)
responses.append(response)
self._transaction_ids.advance()
return responses
# Multi-chunk transaction - execute all chunks
responses = []
self._transaction_ids.set_index(0)
try:
for _ in range(len(self._transaction_ids)):
response = super().execute(client, timeout, wait_for_receipt, validate_status)
responses.append(response)
self._transaction_ids.advance()
finally:
self._transaction_ids.set_index(0)
return responses

Comment thread tests/unit/chunked_transaction_test.py Outdated
Comment on lines +110 to +119
# TODO: Check using the signature map
# def test_sign_tracks_signing_keys_once(mock_client, private_key):
# tx = DummyChunkedTransaction(required_chunks=1)
# tx.freeze_with(mock_client)

tx.sign(private_key)
tx.sign(private_key)
# tx.sign(private_key)
# tx.sign(private_key)

assert tx._signing_keys == [private_key]
assert tx.is_signed_by(private_key.public_key()) is True
# assert tx._signing_keys == [private_key]
# assert tx.is_signed_by(private_key.public_key()) is True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Replace the commented-out signing test.

This PR changes signing for all prebuilt chunk bodies. Do not remove coverage for repeated signing and signature deduplication. Add assertions that every body in _transaction_body_bytes has one signature after signing the same key twice.

As per path instructions, “No unjustified TODOs or skipped tests without tracking issues.”

Source: Path instructions

Comment on lines +433 to +437
assert tx._transaction_ids._locked is True
assert tx._transaction_ids.index == 0

assert tx._node_account_ids._locked is True
assert tx._node_account_ids.index == 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assert the lock state through a public accessor.

Both tests read tx._transaction_ids._locked, a private attribute of LockableList, while reading index as a public property. If LockableList exposes a public lock accessor, use it. If it does not, add one, because the lock state is part of the freeze contract that these tests verify. Add failure messages to these assertions as well; the unit-test guidance requires that a failing assertion states what broke.

Also applies to: 465-469

Source: Path instructions

Comment on lines 231 to +237
tx = TopicCreateTransaction(memo="Signing test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
tx.set_transaction_id(transaction_id)

body_bytes = tx.build_transaction_body().SerializeToString()
tx._transaction_body_bytes.setdefault(node_account_id, body_bytes)
tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Freeze the transaction before testing signing.

Both tests bypass freeze-time body construction. dict(node_account_id=body_bytes) creates the string key "node_account_id", not the AccountId key used by _to_proto(). sign() iterates only values, so these tests pass without validating the transaction-ID and node-ID lookup contract.

  • tests/unit/topic_create_transaction_test.py#L231-L237: replace the manual map setup with tx.freeze() and read tx._transaction_body_bytes[transaction_id][node_account_id].
  • tests/unit/topic_delete_transaction_test.py#L80-L86: replace the manual map setup with tx.freeze() and read tx._transaction_body_bytes[transaction_id][node_account_id].
Proposed fix
-    body_bytes = tx.build_transaction_body().SerializeToString()
-    tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))
+    tx.freeze()
+    body_bytes = tx._transaction_body_bytes[transaction_id][node_account_id]

As per path instructions, unit tests must protect against breaking changes and test real functionality.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tx = TopicCreateTransaction(memo="Signing test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
tx.set_transaction_id(transaction_id)
body_bytes = tx.build_transaction_body().SerializeToString()
tx._transaction_body_bytes.setdefault(node_account_id, body_bytes)
tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))
tx = TopicCreateTransaction(memo="Signing test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
tx.set_transaction_id(transaction_id)
tx.freeze()
body_bytes = tx._transaction_body_bytes[transaction_id][node_account_id]
Suggested change
tx = TopicCreateTransaction(memo="Signing test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
tx.set_transaction_id(transaction_id)
body_bytes = tx.build_transaction_body().SerializeToString()
tx._transaction_body_bytes.setdefault(node_account_id, body_bytes)
tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))
tx = TopicDeleteTransaction(topic_id=topic_id)
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
tx.set_transaction_id(transaction_id)
tx.freeze()
body_bytes = tx._transaction_body_bytes[transaction_id][node_account_id]
📍 Affects 2 files
  • tests/unit/topic_create_transaction_test.py#L231-L237 (this comment)
  • tests/unit/topic_delete_transaction_test.py#L80-L86

Source: Path instructions

Comment thread tests/unit/topic_message_submit_transaction_test.py
Comment on lines +279 to +287
operator_id, _, node_account_id, _, _ = mock_account_ids
transaction_id = TransactionId.generate(operator_id)

tx = TopicUpdateTransaction(topic_id=topic_id, memo="Signature test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])

body_bytes = tx.build_transaction_body().SerializeToString()
tx._transaction_body_bytes.setdefault(node_account_id, body_bytes)
tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use the actual node account ID as the nested key.

dict(node_account_id=body_bytes) creates the literal string key "node_account_id". The cache must use the AccountId value from node_account_id. Otherwise, this test does not validate the node-specific body lookup.

As per path instructions, unit tests must protect transaction behavior and use the actual SDK data contract.

Proposed fix
-    tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))
+    tx._transaction_body_bytes.setdefault(transaction_id, {node_account_id: body_bytes})
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
operator_id, _, node_account_id, _, _ = mock_account_ids
transaction_id = TransactionId.generate(operator_id)
tx = TopicUpdateTransaction(topic_id=topic_id, memo="Signature test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
body_bytes = tx.build_transaction_body().SerializeToString()
tx._transaction_body_bytes.setdefault(node_account_id, body_bytes)
tx._transaction_body_bytes.setdefault(transaction_id, dict(node_account_id=body_bytes))
operator_id, _, node_account_id, _, _ = mock_account_ids
transaction_id = TransactionId.generate(operator_id)
tx = TopicUpdateTransaction(topic_id=topic_id, memo="Signature test")
tx.operator_account_id = AccountId(0, 0, 2)
tx.set_node_account_ids([node_account_id])
body_bytes = tx.build_transaction_body().SerializeToString()
tx._transaction_body_bytes.setdefault(transaction_id, {node_account_id: body_bytes})

Source: Path instructions

@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Aug 8, 2026

@danielmarv danielmarv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @manishdait for the implementation but i have some blocking issues that we need to address:

  1. query_payment.py wasn't migrated for either half of this change (body-bytes shape, and build_transaction_body() no longer stamping IDs), which breaks every paid query at runtime. Comments on transaction.py:58 and transaction.py:486.
  2. Single-chunk topic messages now emit chunkInfo. Comment on topic_message_submit_transaction.py:163.

Comment thread src/hiero_sdk_python/consensus/topic_message_submit_transaction.py Outdated
Comment thread src/hiero_sdk_python/transaction/transaction.py
Comment thread src/hiero_sdk_python/transaction/transaction.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/hiero_sdk_python/consensus/topic_message_submit_transaction.py (1)

163-168: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

BLOCKER: Add an explicit _initial_transaction_id guard.

Line 165 calls _to_proto() without checking _initial_transaction_id. The _current_chunk_index check does not establish that invariant. Raise a descriptive ValueError before constructing chunk_info.

Proposed fix
         if self._total_chunks > 1 and self._current_chunk_index is not None:
+            if self._initial_transaction_id is None:
+                raise ValueError(
+                    "Multi-chunk message requires an initial transaction ID."
+                )
             chunk_info = consensus_submit_message_pb2.ConsensusMessageChunkInfo(

As per path instructions, multi-chunk serialization must guard a missing _initial_transaction_id before calling _to_proto().

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 999ac881-12aa-429a-a4a4-8b35f433021b

📥 Commits

Reviewing files that changed from the base of the PR and between 5d26155 and 70e91af.

📒 Files selected for processing (2)
  • src/hiero_sdk_python/consensus/topic_message_submit_transaction.py
  • tests/unit/topic_message_submit_transaction_test.py

@aceppaluni aceppaluni removed the approved Issue has been approved by team member label Aug 10, 2026

@aceppaluni aceppaluni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up to the earlier conversation regarding query.py:

Would it be useful to grep the repository for all direct callers of build_transaction_body() outside the normal freeze path and make sure none relied on IDs being injected there?

Comment thread src/hiero_sdk_python/transaction/chunked_transaction.py
Comment thread src/hiero_sdk_python/consensus/topic_message_submit_transaction.py
@aceppaluni aceppaluni added the status: update branch developer needs to click update branch label Aug 10, 2026
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from 70e91af to 8359352 Compare August 12, 2026 20:35
@github-actions github-actions Bot added the approved Issue has been approved by team member label Aug 12, 2026
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from 35d0642 to c916936 Compare August 18, 2026 18:37
@manishdait
manishdait marked this pull request as ready for review August 18, 2026 20:12
@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Aug 18, 2026
@aceppaluni aceppaluni removed the approved Issue has been approved by team member label Aug 18, 2026

@exploreriii exploreriii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @manishdait i think the main thing that is diffficult about this PR in my eyes is some of the methods are not that clear, due to existing causes, but makes new changes hard to reivew, maybe creating more sub functions would help, but then again perhaps that changes too much

Comment thread tests/unit/lockable_list_test.py Outdated
)
return consensus_submit_message_pb2.ConsensusSubmitMessageTransactionBody(
topicID=self.topic_id._to_proto() if self.topic_id else None,
message=chunk_content,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can make a _current_chunk_slice in chunked_transaction.py and use it here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


def _execute_single(self, url: str, mode: FeeEstimateMode) -> FeeEstimateResponse:
data = self._post(url, self._transaction.to_bytes())
data = self._post(url, self._transaction._to_proto().SerializeToString())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe can be a to_bytes()

@manishdait manishdait Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use that but it will change when, the to_bytes method get change for the serialization pr

Comment thread src/hiero_sdk_python/file/file_append_transaction.py
@exploreriii exploreriii removed queue:junior-committer PR awaiting initial quality review open to community review PR is open for community review and feedback labels Aug 19, 2026
@exploreriii
exploreriii marked this pull request as draft August 19, 2026 07:43
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from e2b29d7 to 15ccb44 Compare August 19, 2026 11:43
@github-actions github-actions Bot added the approved Issue has been approved by team member label Aug 19, 2026
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from 15ccb44 to d1319dc Compare August 19, 2026 11:46
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from 392840c to 83cb915 Compare August 26, 2026 19:58
…action is freeze

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait
manishdait force-pushed the fix/chunk-generate-txbytes-on-freeze branch from 83cb915 to 7056064 Compare August 28, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Issue has been approved by team member notes: extra care requires extra attention to detail or requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix ChunkedTransaction to create transaction_body_bytes for all chunks

5 participants