casper-network / casper-network/casper-node
Optimize PointerBlock serialization format
- Dominant language
- Rust
- Stars
- 399
- Forks
- 224
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 2
Description
Follow up for #2346. We serialize PointerBlocks as 256 Option's regardless if the value is Some or None and due to Option overhead PointerBlock size is at least 256 bytes. As an optimization we can serialize only Some variants and we can reuse option's tag to write u8 index. After running create_domains entrypoint that writes exactly 49500 dictionary writes I could save 40MB of storage (848 -> 808). The biggest obstacle implementing this is requirement of either a complete global state migration, or a clever mechanism to determine which deserialization format to use based on a protocol version.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing PointerBlock serialization and deserialization, then inspect the create_domains entrypoint and the global state migration or protocol-version handling. The issue is done when Some variants can be serialized compactly while existing state remains readable through a complete migration or a reliable format-selection mechanism.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100