casper-network / casper-network/casper-node
[TECH-DEBT] Refactor Meta Transactions for Consistency and Efficiency
- Dominant language
- Rust
- Stars
- 399
- Forks
- 224
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 2
Description
Optimise Meta Transaction handling to reduce redundant deserialization and improve code consistency.
**Background & Problem Statement**
- Currently, the v1 transaction instances are only partially deserialised. However, many operations require access to fields in the unserialized portion if available. The current approach constructs a Meta Transaction by fully deserializing a reference to a transaction, which results in:
- Duplication of the original transaction data.
- Calling code inconsistently using both the original transaction and the Meta Transaction interchangeably.
- Suboptimal logic leading to inefficiencies and tech debt.
**Proposed Solution**
- Modify the Meta Transaction to hold the instance of V1 transaction as an inner field instead of duplicating it.
- Access fields from the inner transaction via getters instead of maintaining separate copies.
- Implement lazy deserialisation for fields that are needed dynamically rather than deserialising everything upfront.
- Enforce that all business logic interacts solely with the Meta Transaction, avoiding direct manipulation of the partially deserialized v1 transaction instance.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.