Skip to content

Update Transaction.to_bytes() / from_bytes() to support multi-node transactions using TransactionList #2302

Description

@manishdait

Description
The current implementation of Transaction.to_bytes() and Transaction.from_bytes() only properly serializes and restores a single node transaction, even when the transaction itself contains multiple node IDs internally.

As a result:

  • Transactions frozen with multiple node IDs lose information after to_bytes()
  • from_bytes() cannot correctly restore all node contexts

Proposed Solution

  • Update Transaction.to_bytes() to serialize each transactions for node_ids using the protobuf TransactionList type instead of serializing only a single Transaction.
  • Similarly, update Transaction.from_bytes() to parse the TransactionList and reconstruct all node-specific transaction bodies.

Additional Notes

Potential considerations for the implementation:

  • Preserve backward compatibility with previously serialized single-transaction bytes if possible
  • Ensure signatures remain associated with the correct node-specific body bytes
  • Ensure chunked transactions continue working correctly

Metadata

Metadata

Assignees

Labels

skill: advancedrequires knowledge of multiple areas in the codebase without defined steps to implement or examples

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions