Skip to content

Conversation

@BrianBland
Copy link
Collaborator

@BrianBland BrianBland commented Jan 10, 2026

Split src/storage/engine.rs (3,817 lines) into 8 smaller, focused modules:

  • mod.rs (142 lines): Core StorageEngine struct and public API
  • error.rs (43 lines): Error enum and From implementations
  • read.rs (192 lines): get_account, get_storage, get_value_from_page
  • write.rs (282 lines): set_values, set_values_in_page, set_values_in_cloned_page
  • handlers.rs (709 lines): Trie modification handlers (branch/leaf operations)
  • page_ops.rs (281 lines): allocate, orphan, clone, split pages
  • helpers.rs (161 lines): Utility functions (prefix matching, subtrie ops)
  • tests.rs (2,286 lines): Extracted test module

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 10, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Split src/storage/engine.rs (3,817 lines) into 8 smaller, focused modules:

- mod.rs (142 lines): Core StorageEngine struct and public API
- error.rs (43 lines): Error enum and From implementations
- read.rs (192 lines): get_account, get_storage, get_value_from_page
- write.rs (282 lines): set_values, set_values_in_page, set_values_in_cloned_page
- handlers.rs (709 lines): Trie modification handlers (branch/leaf operations)
- page_ops.rs (281 lines): allocate, orphan, clone, split pages
- helpers.rs (161 lines): Utility functions (prefix matching, subtrie ops)
- tests.rs (2,286 lines): Extracted test module
Split src/node.rs (1,230 lines) into 5 smaller, focused modules:

- mod.rs (348 lines): Node struct, NodeKind enum, TrieValue, core methods
- encoding.rs (247 lines): Value trait impl for page storage serialization
- rlp.rs (157 lines): Encodable trait impl for state root computation
- arbitrary.rs (59 lines): Proptest strategies for fuzzing
- tests.rs (488 lines): Extracted test module

All non-test modules are now under 350 lines with clear responsibilities:
- encoding.rs: Binary serialization for slotted page format
- rlp.rs: RLP encoding for Merkle Patricia Trie computation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants