Repository navigation
Conversation
Include the last block on disk when combining account or storage changesets with the in-memory chain. Append only the requested in-memory blocks in ascending order and preserve inclusive bounds through the largest block number.
👁️ Cyclops Security Review✅ Reviewed c655207 (latest) · Coverage: partial · no open findings · report
|
Iterate the inclusive block range so both static-file walkers return the final block and finish without computing its successor. Exercise the storage-v2 read path with indexed account and storage changesets in the last two blocks.
mattsse
left a comment
There was a problem hiding this comment.
Nice fixes. Capping the database read at the first in-memory block instead of anchor().number no longer drops the last persisted block. In-memory blocks are now filtered to the requested range, and changeset_block_range handles ..0, ..=u64::MAX and Excluded(u64::MAX) without overflowing. Dropping the stable sort is safe because database-then-reversed-memory output is already ordered. mablr's open notes are worth folding in but not blocking: changesets_range repeats the bound normalisation, and the in-memory test would benefit from a second block to cover a range ending inside memory and an excluded start. LGTM.
Avoid overflowing composite storage keys at the last block in MDBX. Use the shared inclusive range conversion for account and disk/memory reads, and cover direct storage reads and ordering across two in-memory blocks.
Account loses Copy when account-ext is enabled. Clone each owned snapshot in the two-block changeset test so it builds with all workspace features.
Account and storage changeset ranges can omit the last block on disk and include in-memory blocks outside the requested range. Read through the disk anchor, then append only the matching in-memory blocks in ascending order. Preserve inclusive and unbounded endpoints through
u64::MAX. This is the range-query portion of #28599.