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:
Reference: MIMD-0019 SuperBlock validation
Parent epic: #935
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 consistencyAcceptance criteria:
Reference: MIMD-0019 SuperBlock validation
Parent epic: #935