hiero-ledger / hiero-ledger/hiero-sdk-python
Update `Transaction.to_bytes() / from_bytes()` to support multiple node IDs and chunked transactions
- Dominant language
- Python
- Stars
- 63
- Forks
- 298
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 38
Description
**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
Contributor guide
Assessment
This issue has not been assessed yet.