Skip to content

add HistoryKeyTxNumRange and MultisetKV#19081

Merged
AskAlexSharov merged 10 commits intomainfrom
history_key_txnum_range
Feb 14, 2026
Merged

add HistoryKeyTxNumRange and MultisetKV#19081
AskAlexSharov merged 10 commits intomainfrom
history_key_txnum_range

Conversation

@sudeepdino008
Copy link
Member

@sudeepdino008 sudeepdino008 commented Feb 10, 2026

some tools I need for commitment history regen: #19016

commitment history regen needs: "find all acct/storage touches that happened in block x", then do ComputeCommitment. HistoryRange is what we need, but using it is slow:

  • it queries .v and .vi files (for values), which is not needed
  • even if we solve the above, we need to get HistoryRange for each block..which leads to full scan of the ef file. Turns out to be really slow to do.
  • HistoryRange/Union does de-duplication of value..so if we query for 2 blocks and both have a common key, only one gets reported. So block ranges can't be queried (also you cannot identify "which" block the key is touched in).

HistoryKeyTxNumRange: solves both problems, it returns stream of <key, txNum>, and so can be queried across multiple blocks (batch fetch). Then we can bucket the touched keys into blocks (since we know txNum). It also doesn't do any de-duplication.

MultiSetKV -- is similarly needed for because we need to combine the files data and db data in a non-duplicated manner.

@sudeepdino008 sudeepdino008 changed the title [wip] db/state, db/kv/stream: add HistoryKeyTxNumRange and MultisetKV add HistoryKeyTxNumRange and MultisetKV Feb 10, 2026
@sudeepdino008 sudeepdino008 changed the title add HistoryKeyTxNumRange and MultisetKV [wip] add HistoryKeyTxNumRange and MultisetKV Feb 10, 2026
@sudeepdino008 sudeepdino008 force-pushed the history_key_txnum_range branch from f2cca4e to 352c3b9 Compare February 11, 2026 18:07
@sudeepdino008 sudeepdino008 marked this pull request as ready for review February 12, 2026 06:15
@AskAlexSharov
Copy link
Collaborator

I like the idea to not touch .v files

@AskAlexSharov AskAlexSharov merged commit f181445 into main Feb 14, 2026
25 checks passed
@AskAlexSharov AskAlexSharov deleted the history_key_txnum_range branch February 14, 2026 00:05
@AskAlexSharov AskAlexSharov changed the title [wip] add HistoryKeyTxNumRange and MultisetKV add HistoryKeyTxNumRange and MultisetKV Feb 14, 2026
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.

2 participants