-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem:
Need a way to verify that standby nodes have replicated the exact same state as the primary. Currently AccountsDb has no mechanism to compute a hash of its entire state.
Solution:
checksum() method on AccountsDb that iterates all accounts in key-sorted order (via LMDB) and hashes both pubkey and serialized account data using xxHash3. Returns a 64-bit hash suitable for verifying state consistency across nodes.
Implementation details:
AccountsDb::checksum()acquires write lock for consistency- Uses xxHash3 (fast, non-cryptographic hash with good distribution)
- Hashes: pubkey (32 bytes) + serialized account data
- Iteration order is deterministic (LMDB key-sorted)
Acceptance criteria:
- New method on AccountsDb to compute state checksum
- Scans all active accounts and hashes them cumulatively
- Returns single hash value (u64)
- Integrates with existing snapshot flow (deferred)
- Unit tests for correctness and determinism
Reference: MIMD-0019 SuperBlock validation
Parent epic: #935
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request