Skip to content

feat(dursto): ERC-20 benchmark for loading from snapshot#969

Open
jobjo wants to merge 3 commits intomainfrom
joel/storage-checkout-bench
Open

feat(dursto): ERC-20 benchmark for loading from snapshot#969
jobjo wants to merge 3 commits intomainfrom
joel/storage-checkout-bench

Conversation

@jobjo
Copy link
Copy Markdown
Collaborator

@jobjo jobjo commented Mar 30, 2026

Closes RV-952.

What

Extends the existing benchmark cargo bench -p octez-riscv-durable-storage --bench database to make
BLOCK_FREQUENCY, ERC_20_TRANSACTION_COUNT and PREPOPULATED_NODE_KEYS_COUNT configurable through environment variables.

Also introduces a new benchmark database_checkout that builds a database, commits it to disk and then loads it from scratch before running the ERC-20 transactions emulation scenario.

Why

To understand how the benchmark behaves when the merkle layer is loaded lazily.

How

The new benchmark database_checkout:

  • Creates and populates a database with 10M keys by default.
  • Commits the database to disk and records the commit id.
  • Loads a new database using the commit id.
  • Runs the ERC-20 transactions scenario

Manually Testing

Overriding configuration:

BLOCK_FREQUENCY=100 ERC_20_TRANSACTION_COUNT=10000 PREPOPULATED_NODE_KEYS_COUNT=100 cargo bench  -p octez-riscv-durable-storage --bench database/database_checkout

Running the new benchmark with default configuration:

cargo bench  -p octez-riscv-durable-storage --bench database_checkout

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@jobjo jobjo changed the title Joel/storage checkout bench feat(dursto): ERC-20 benchmark for loading from snapshot Mar 30, 2026
@jobjo jobjo force-pushed the joel/storage-checkout-bench branch from 36c32f9 to e9180e3 Compare March 30, 2026 13:47
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.55%. Comparing base (bbf9876) to head (eb0bb50).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #969      +/-   ##
==========================================
- Coverage   89.59%   89.55%   -0.04%     
==========================================
  Files         125      125              
  Lines       26863    26863              
  Branches    26863    26863              
==========================================
- Hits        24067    24058       -9     
- Misses       2166     2175       +9     
  Partials      630      630              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jobjo jobjo force-pushed the joel/storage-checkout-bench branch 4 times, most recently from 9386dd1 to 0d47e6a Compare March 30, 2026 16:11
@jobjo jobjo marked this pull request as ready for review April 1, 2026 14:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Benchmark results for revision a64c992:

Metric Duration TPS
Mean 1.522836086s 26.267
Worst 1.539897359s 25.976
Best 1.51462561s 26.409
Standard Deviation ±5.504182ms ±0.094
Full results
Run Transfers Duration TPS
1 40 1.526063515s 26.211
2 40 1.5324416s 26.102
3 40 1.523155916s 26.261
4 40 1.519925824s 26.317
5 40 1.519799983s 26.319
6 40 1.517549468s 26.358
7 40 1.524967944s 26.230
8 40 1.526778783s 26.199
9 40 1.539897359s 25.976
10 40 1.52179671s 26.285
11 40 1.524186057s 26.244
12 40 1.518745092s 26.338
13 40 1.518471852s 26.342
14 40 1.518205589s 26.347
15 40 1.51462561s 26.409
16 40 1.525452328s 26.222
17 40 1.521138427s 26.296
18 40 1.520817528s 26.302
19 40 1.521886106s 26.283
20 40 1.520816023s 26.302

Compare the results above with those for the default branch.

@jobjo jobjo force-pushed the joel/storage-checkout-bench branch from 0d47e6a to 3832936 Compare April 2, 2026 12:51
@jobjo
Copy link
Copy Markdown
Collaborator Author

jobjo commented Apr 2, 2026

Rebasing on main surfaced an issue for cargo bench -p octez-riscv-durable-storage --bench database_checkout. See RV-955.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The path will need to be updated in kernels/etherlink/xtask/src/main.rs for when this file is regenerated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in: c9b4dbf

operations.extend_from_slice(&erc_20_setup);
for i in 0..transaction_count {
operations.extend_from_slice(&erc_20_transaction);
if i % block_frequency == 0 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In theory block_frequency can be configured to 0, so it should be validated beforehand.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, guarded here: d8fd8e3

@jobjo jobjo force-pushed the joel/storage-checkout-bench branch from 3832936 to eb0bb50 Compare April 10, 2026 09:49
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.

3 participants