Skip to content

Conversation

@0xVolosnikov
Copy link
Contributor

@0xVolosnikov 0xVolosnikov commented Oct 15, 2025

What ❔

Simplified and refined change of caches appearance mechanics from "V2".

From what I see in the rr/ethproofs branch, we do not use the "updated" or "deleted" options in any meaningful way. Since these values can be encapsulated, I decided to remove them. Additionally, the global "updated" / "deleted" options may create sneaky issues related to rollbacks. For example, if an element was marked as "updated" and the actual change is later rolled back, the label becomes misleading. This means we would always have to keep these nuances in mind. In practice, we already need to check diffs of storage slots or accounts to determine whether any changes occurred, so these labels do not add much useful information anyway.

The "deleted" option may become useful in the future if we decide to implement some optimized storage model, but its use would again require careful handling.

I use enums instead of bool values to keep it extendable if we decide to add new options (like "deleted"). Also it's somewhat more explicit.

Is this a breaking change?

  • Yes
  • No

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted.

Base automatically changed from dev to main October 21, 2025 18:20
@0xVolosnikov 0xVolosnikov changed the base branch from main to dev October 28, 2025 22:11
@0xVolosnikov 0xVolosnikov force-pushed the vv-caches-refactoring-from-v2 branch 3 times, most recently from 087d7c4 to bc7e45d Compare October 30, 2025 20:36
Base automatically changed from dev to main November 3, 2025 04:07
@0xVolosnikov 0xVolosnikov changed the base branch from main to dev December 9, 2025 16:13
@0xVolosnikov 0xVolosnikov force-pushed the vv-caches-refactoring-from-v2 branch from 6b2b564 to 62598e5 Compare December 9, 2025 16:13
@0xVolosnikov 0xVolosnikov changed the title feat: Caches refactoring from V2 prototype feat: Caches appearance refactoring Dec 9, 2025
@0xVolosnikov 0xVolosnikov marked this pull request as ready for review December 9, 2025 19:18
@0xVolosnikov
Copy link
Contributor Author

It would be nice to keep history_map simple (huh) and avoid adding any new functionality to it. However, in this case, this seems like the simplest and most effective solution, so we can live with itfor now (until we decide to refactor history_map and the caches in general again).

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Benchmark report

Benchmark Symbol Base Eff Head Eff (%) Base Raw Head Raw (%) Base Blake Head Blake (%) Base Bigint Head Bigint (%)
block_19299001 run_prepared 310,904,508 310,943,376 (+0.01%) 268,238,732 268,277,600 (+0.01%) 410,610 410,610 (+0.00%) 9,024,004 9,024,004 (+0.00%)
block_22244135 run_prepared 191,059,654 191,039,995 (-0.01%) 164,143,594 164,123,935 (-0.01%) 172,020 172,020 (+0.00%) 6,040,935 6,040,935 (+0.00%)
precompiles bn254_ecadd 53,194 53,194 (+0.00%) 47,742 47,742 (+0.00%) 0 0 (+0.00%) 1,363 1,363 (+0.00%)
precompiles bn254_ecmul 731,007 731,007 (+0.00%) 566,819 566,819 (+0.00%) 0 0 (+0.00%) 41,047 41,047 (+0.00%)
precompiles bn254_pairing 72,679,720 72,679,720 (+0.00%) 58,151,576 58,151,576 (+0.00%) 0 0 (+0.00%) 3,632,036 3,632,036 (+0.00%)
precompiles ecrecover 478,039 478,640 (+0.13%) 310,047 310,900 (+0.28%) 0 0 (+0.00%) 41,998 41,935 (-0.15%)
precompiles id 925 925 (+0.00%) 925 925 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles keccak 137,578 137,578 (+0.00%) 137,578 137,578 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles modexp 32,084,944 32,084,985 (+0.00%) 21,427,124 21,427,165 (+0.00%) 0 0 (+0.00%) 2,664,455 2,664,455 (+0.00%)
precompiles p256_verify 750,759 750,759 (+0.00%) 472,067 472,067 (+0.00%) 0 0 (+0.00%) 69,673 69,673 (+0.00%)
precompiles point_evaluation 51,158,395 51,158,395 (+0.00%) 39,535,767 39,535,767 (+0.00%) 0 0 (+0.00%) 2,905,657 2,905,657 (+0.00%)
precompiles process_transaction 73,821,801 73,822,543 (+0.00%) 59,126,445 59,120,263 (-0.01%) 160 160 (+0.00%) 3,673,199 3,674,930 (+0.05%)
precompiles ripemd 8,028 8,028 (+0.00%) 8,028 8,028 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles run_prepared 148,130,056 148,127,305 (-0.00%) 118,662,644 118,647,809 (-0.01%) 5,070 5,070 (+0.00%) 7,346,573 7,349,594 (+0.04%)
precompiles sha256 13,167 13,167 (+0.00%) 13,167 13,167 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles verify_and_apply_batch 131,835 132,197 (+0.27%) 97,115 97,477 (+0.37%) 2,170 2,170 (+0.00%) 0 0 (+0.00%)

Copy link
Contributor

@antoniolocascio antoniolocascio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@0xVolosnikov 0xVolosnikov merged commit bc986e7 into dev Dec 10, 2025
18 checks passed
@0xVolosnikov 0xVolosnikov deleted the vv-caches-refactoring-from-v2 branch December 10, 2025 13:48
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