Skip to content

chore(l1,l2): bump version to 10.0.0#6512

Merged
ilitteri merged 9 commits intomainfrom
release/v10.0.0
Apr 28, 2026
Merged

chore(l1,l2): bump version to 10.0.0#6512
ilitteri merged 9 commits intomainfrom
release/v10.0.0

Conversation

@ilitteri
Copy link
Copy Markdown
Collaborator

Motivation

Prepare the v10.0.0 release by bumping the workspace version and merging the release branch back to main. The branch also carries a hotfix found during pre-release testing on the mainnet snapsync test servers.

Description

  • Bump workspace version from 9.0.0 to 10.0.0 in the root Cargo.toml, the guest-program Cargo.toml files (sp1, risc0, openvm, zisk) and crates/l2/tee/quote-gen/Cargo.toml; refresh lockfiles.
  • Update the --builder.extra-data default in docs/CLI.md to ethrex 10.0.0 in both ethrex and ethrex L2 sections.
  • Fix silent datadir migration failure when upgrading from pre-v10 databases: read_chain_id_from_db now extracts only chain_id from the stored ChainConfig (unaffected by the new hex_str_opt attribute on terminal_total_difficulty) and each failure mode logs a warn instead of being swallowed by .ok()?. Verified on a real v9 mainnet database (449 GB): migrated into the new ~/.local/share/ethrex/mainnet/ layout and resumed at the same block without re-sync.

Checklist

  • Updated STORE_SCHEMA_VERSION — N/A, no storage schema change (hotfix only affects the migration read path).

…bases.

`read_chain_id_from_db` deserialized the full `ChainConfig` from the existing
DB, which fails on pre-v10 data because `terminal_total_difficulty` (a u128
exceeding u64::MAX on mainnet) was stored via serde_json's default encoding
that goes through f64 and loses integer precision, while v10's new
`hex_str_opt` deserializer strictly requires a parseable u128 number or hex
string. The migration check then silently swallowed the error via `.ok()?`
and `migrate_datadir_if_needed` fell through to starting an empty DB under
the new network-specific subdirectory, orphaning the user's synced state
without any log message.

Extract only `chain_id` from the stored JSON (the only field the migration
check actually needs) so unrelated `ChainConfig` schema evolution doesn't
block otherwise-valid migrations. Replace every silent `.ok()?` in
`read_chain_id_from_db` with a matched error that logs the specific failure,
and add a user-facing warning in `migrate_datadir_if_needed` when a valid
metadata.json is present but the chain ID can't be read, instructing the
operator how to move the data manually.
Copilot AI review requested due to automatic review settings April 21, 2026 16:55
@ilitteri ilitteri requested review from a team, ManuelBilbao and avilagaston9 as code owners April 21, 2026 16:55
@github-actions github-actions Bot added L1 Ethereum client L2 Rollup client labels Apr 21, 2026
@github-actions
Copy link
Copy Markdown

🤖 Kimi Code Review

This PR bumps the version from 9.0.0 to 10.0.0 across the workspace and improves database migration robustness between versions. The changes are clean and the error handling improvements are well-designed.

Summary of Changes

  1. Version bump: Consistent update to 10.0.0 across all crates and lock files
  2. Migration safety: Improved read_chain_id_from_db() in crates/storage/store.rs to handle schema changes gracefully
  3. Observability: Added warning logs for database migration failures in cmd/ethrex/initializers.rs

Code Review

crates/storage/store.rs (Lines 3264-3316)

The refactoring of read_chain_id_from_db is well-executed:

  • Partial deserialization: Using ChainIdOnly to extract just the chain_id field avoids failures from unrelated schema changes (e.g., terminal_total_difficulty format changes). This is a robust pattern for database backward compatibility.
  • Granular error logging: Replacing .ok()? with explicit match statements and warn! logs significantly improves operator experience when debugging migration issues.
  • CamelCase handling: Correctly uses #[serde(rename_all = "camelCase")] for Ethereum JSON compatibility.

cmd/ethrex/initializers.rs (Lines 641-650)

The added warning message is helpful for operators:

  • Clearly indicates when a database exists but is incompatible
  • Provides actionable guidance (manual migration path)
  • References upstream logs for specific error details

Version Consistency

All version bumps are consistent:

  • Workspace Cargo.toml updated
  • All crate Cargo.toml files updated
  • All Cargo.lock files regenerated (including guest programs for OpenVM, RISC0, SP1, Zisk, and TEE quote-gen)

Verdict

Approved. The PR correctly implements a version bump with thoughtful handling of database schema evolution. The partial deserialization pattern used for ChainIdOnly is particularly good defensive programming for an Ethereum client that needs to handle chain config migrations gracefully.


Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR bumps the workspace version from 9.0.0 to 10.0.0 across all Cargo manifests and updates the --builder.extra-data default in docs/CLI.md. It also includes a targeted hotfix for a silent datadir migration failure when upgrading from pre-v10 databases: read_chain_id_from_db now uses a minimal ChainIdOnly struct to avoid deserialization breakage caused by the terminal_total_difficulty field changing from a plain number to a hex string, and each error path now emits a warn! instead of silently returning None.

Confidence Score: 5/5

Safe to merge — version bump is mechanical and the hotfix is well-targeted with no regressions.

All changes are either version number updates or a narrowly scoped, well-commented fix to a silent failure in the migration read path. The partial-deserialization approach is sound (camelCase mapping matches ChainConfig serialization), warnings are correctly ordered in the log stream, and the PR was verified against a real 449 GB v9 mainnet database.

No files require special attention.

Important Files Changed

Filename Overview
crates/storage/store.rs Hotfix: replaced silent .ok()? chain in read_chain_id_from_db with explicit match arms emitting warn! logs, and swapped full ChainConfig deserialization for a minimal ChainIdOnly struct to tolerate v9 terminal_total_difficulty format differences.
cmd/ethrex/initializers.rs Added actionable warn! message when read_chain_id_from_db returns None, guiding operators on how to recover a pre-v10 database that cannot be migrated automatically.
Cargo.toml Workspace version bumped from 9.0.0 to 10.0.0.
docs/CLI.md Updated --builder.extra-data default from "ethrex 9.0.0" to "ethrex 10.0.0" in both the ethrex and ethrex L2 sections.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[migrate_datadir_if_needed] --> B{base_datadir == network_datadir?}
    B -- Yes --> Z[return: no-op]
    B -- No --> C{has_valid_db network_datadir?}
    C -- Yes --> Z
    C -- No --> D{has_valid_db base_datadir?}
    D -- No --> Z
    D -- Yes --> E{network subdirs exist?}
    E -- Yes --> Z
    E -- No --> F[read_chain_id_from_db]
    F --> G{RocksDB open?}
    G -- Err --> H[warn: failed to open]
    H --> Z
    G -- Ok --> I{begin_read?}
    I -- Err --> J[warn: failed to begin read]
    J --> Z
    I -- Ok --> K{get chain config bytes?}
    K -- None --> L[warn: entry not found]
    L --> Z
    K -- Err --> M[warn: read failed]
    M --> Z
    K -- Some --> N{deserialize ChainIdOnly - chain_id only}
    N -- Err --> O[warn: deserialize failed]
    O --> Z
    N -- Ok --> P[return Some chain_id]
    P --> Q{chain_id matches expected?}
    Q -- No --> R[warn: chain ID mismatch]
    R --> Z
    Q -- Yes --> S{no_migrate flag?}
    S -- Yes --> T[info: skipping]
    T --> Z
    S -- No --> U[Migrate: move files to network_datadir]
Loading

Reviews (1): Last reviewed commit: "Fix silent datadir migration failure whe..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

🤖 Claude Code Review

I now have all the context needed. Here is the full review.


PR Review: chore(l1,l2): bump version to 10.0.0 (PR #6512)

Overview

Two independent changes are bundled here:

  • Mechanical version bump — workspace version 9.0.0 → 10.0.0 propagated across all Cargo.toml and Cargo.lock files (main workspace, four ZK guest-program sub-workspaces, l2/tee/quote-gen, tooling), plus the docs/CLI.md default for --builder.extra-data.
  • Hotfix in read_chain_id_from_db — fixes a silent failure path that caused the v9 → v10 datadir migration to be silently skipped on pre-existing mainnet databases.

Version Bump

The bump is complete and consistent. All sub-workspace lock files and the standalone Cargo.toml files that cannot inherit the workspace version (sp1, risc0, openvm, zisk, quote-gen) are updated. No concerns here.


Hotfix — crates/storage/store.rs

Root cause understanding is correct. ChainConfig is decorated with #[serde(rename_all = "camelCase")] and terminal_total_difficulty gained #[serde(default, with = "crate::serde_utils::u128::hex_str_opt")] in v10. A v9 database stores that field as a plain decimal JSON number; the new deserializer rejects it, causing serde_json::from_slice::<ChainConfig> to return Err, which was silently discarded by .ok()?. The migration logic then fell through to "chain ID not readable → skip migration", leaving the 449 GB database unreachable.

ChainIdOnly struct is the right approach. Extracting only chainId (camelCase matches #[serde(rename_all = "camelCase")]) sidesteps every field whose serialization may have drifted between releases. The struct is correctly placed inside the #[cfg(feature = "rocksdb")] block and is local to the function, keeping blast radius minimal.

Error visibility improvement is strictly better. Replacing four .ok()? calls with explicit match + warn! arms means every previously-invisible failure now surfaces in the operator's log stream. Each message includes the path, which is essential for diagnosing multi-network setups.

One minor observation on initializers.rs:649.

"See the logs above for the specific error from the storage layer."

"Above" is correct chronologically (the warn! from read_chain_id_from_db fires before this one), but structured log viewers may present lines out of order, and the two messages come from different modules (ethrex_storage::store vs ethrex::initializers). Consider something like:

"Check preceding log lines from ethrex_storage::store for the specific error."

This is cosmetic — no functional concern.

One pre-existing gap worth noting (not introduced by this PR). At initializers.rs:655:

let expected_chain_id = match network.get_genesis() {
    Ok(genesis) => genesis.config.chain_id,
    Err(_) => return,
};

The Err(_) => return silently skips migration if the genesis config can't be loaded. The PR adds a warn! for the read_chain_id_from_db path but leaves this adjacent path quiet. Not a blocker, but it would be consistent to add a warn! here too in a follow-up.


Tests

No test changes are included. Given this is a data-migration read path guarded by #[cfg(feature = "rocksdb")], a unit test is non-trivial to write (it would require constructing a real RocksDB with v9-format data), and the PR description documents verification on a real 449 GB mainnet database. This is acceptable for a hotfix. A regression test with a fixture v9 JSON blob for the ChainIdOnly deserialization path would still be a welcome follow-up.


Summary

The hotfix is targeted, correct, and the reasoning is clearly explained in both the PR description and inline comments. The ChainIdOnly partial-deserialization pattern is idiomatic and safe. The version bump is complete. The one actionable suggestion is improving the cross-module log reference wording in initializers.rs:649; everything else is either pre-existing or cosmetic.

Verdict: Approve with the minor log-message wording suggestion above.


Automated review by Claude (Anthropic) · sonnet · custom prompt

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Lines of code report

Total lines added: 41
Total lines removed: 0
Total lines changed: 41

Detailed view
+-----------------------------------+-------+------+
| File                              | Lines | Diff |
+-----------------------------------+-------+------+
| ethrex/cmd/ethrex/initializers.rs | 643   | +7   |
+-----------------------------------+-------+------+
| ethrex/crates/storage/store.rs    | 2626  | +34  |
+-----------------------------------+-------+------+

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Prepares the v10.0.0 release by bumping workspace/package versions and updating documentation, while also including a hotfix to improve diagnosability of datadir migration by logging specific chain-config read failures.

Changes:

  • Bump versions from 9.0.0 to 10.0.0 across the workspace, guest programs, and quote-gen; refresh lockfiles.
  • Update CLI docs default --builder.extra-data to ethrex 10.0.0.
  • Improve read_chain_id_from_db failure handling by logging warnings per failure mode and deserializing only chain_id from stored ChainConfig.

Reviewed changes

Copilot reviewed 5 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Workspace version bump to 10.0.0.
Cargo.lock Refresh root lockfile to reflect 10.0.0 workspace crates.
tooling/Cargo.lock Refresh tooling lockfile for 10.0.0 workspace crate versions.
docs/CLI.md Update documented default for --builder.extra-data to ethrex 10.0.0.
crates/storage/store.rs Hotfix: log warn-level diagnostics on chain-id read failures; deserialize only chain_id.
cmd/ethrex/initializers.rs Emit operator-facing warning when chain ID cannot be read during migration gating.
crates/l2/tee/quote-gen/Cargo.toml Bump quote-gen crate version to 10.0.0.
crates/l2/tee/quote-gen/Cargo.lock Refresh lockfile for quote-gen dependencies to 10.0.0 workspace versions.
crates/vm/levm/bench/revm_comparison/Cargo.lock Refresh bench lockfile for 10.0.0 workspace versions.
crates/guest-program/bin/sp1/Cargo.toml Bump guest SP1 package version to 10.0.0.
crates/guest-program/bin/sp1/Cargo.lock Refresh guest SP1 lockfile to 10.0.0 workspace versions.
crates/guest-program/bin/risc0/Cargo.toml Bump guest RISC0 package version to 10.0.0.
crates/guest-program/bin/risc0/Cargo.lock Refresh guest RISC0 lockfile to 10.0.0 workspace versions.
crates/guest-program/bin/openvm/Cargo.toml Bump guest OpenVM package version to 10.0.0.
crates/guest-program/bin/openvm/Cargo.lock Refresh guest OpenVM lockfile to 10.0.0 workspace versions.
crates/guest-program/bin/zisk/Cargo.toml Bump guest ZisK package version to 10.0.0.
crates/guest-program/bin/zisk/Cargo.lock Refresh guest ZisK lockfile to 10.0.0 workspace versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/storage/store.rs Outdated
thread::JoinHandle,
};
use tracing::{debug, error, info};
use tracing::{debug, error, info, warn};
@github-actions
Copy link
Copy Markdown

🤖 Codex Code Review

  1. Minor: the version bump looks incomplete in crates/guest-program/README.md:226, which still documents version = "9.0.0". That will leave the guest-program setup docs out of sync with the new 10.0.0 release.

No blocking findings in the runtime code changes. The narrowed chainId-only deserialization in crates/storage/store.rs:3271 is a sensible compatibility fix for older stored ChainConfig JSON, and the added warning in cmd/ethrex/initializers.rs:643 makes skipped migrations diagnosable.

I couldn’t run the targeted Rust tests in this environment because rustup failed to create temp files on the read-only filesystem.


Automated review by OpenAI Codex · gpt-5.4 · custom prompt

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Benchmark Results Comparison

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 3.004 ± 0.022 2.980 3.045 1.12 ± 0.01
main_levm_BubbleSort 2.695 ± 0.020 2.670 2.733 1.01 ± 0.01
pr_revm_BubbleSort 3.017 ± 0.034 2.982 3.092 1.13 ± 0.02
pr_levm_BubbleSort 2.680 ± 0.025 2.658 2.738 1.00

Benchmark Results: ERC20Approval

Command Mean [s] Min [s] Max [s] Relative
main_revm_ERC20Approval 1.013 ± 0.007 1.004 1.025 1.01 ± 0.01
main_levm_ERC20Approval 1.012 ± 0.008 1.002 1.024 1.01 ± 0.01
pr_revm_ERC20Approval 1.003 ± 0.011 0.992 1.029 1.00
pr_levm_ERC20Approval 1.011 ± 0.011 0.998 1.033 1.01 ± 0.02

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 135.7 ± 1.3 133.3 137.8 1.00 ± 0.01
main_levm_ERC20Mint 147.4 ± 0.9 146.6 149.3 1.09 ± 0.01
pr_revm_ERC20Mint 135.0 ± 1.4 133.6 138.3 1.00
pr_levm_ERC20Mint 147.2 ± 1.7 146.2 151.9 1.09 ± 0.02

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 239.1 ± 2.7 237.0 246.0 1.02 ± 0.02
main_levm_ERC20Transfer 249.0 ± 1.5 246.7 250.9 1.06 ± 0.01
pr_revm_ERC20Transfer 235.0 ± 2.7 232.2 240.8 1.00
pr_levm_ERC20Transfer 254.7 ± 12.4 248.0 288.7 1.08 ± 0.05

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 230.2 ± 13.2 224.9 267.7 1.02 ± 0.06
main_levm_Factorial 253.2 ± 1.2 252.1 255.7 1.13 ± 0.01
pr_revm_Factorial 224.8 ± 1.3 223.2 227.2 1.00
pr_levm_Factorial 251.4 ± 1.5 249.6 254.6 1.12 ± 0.01

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.692 ± 0.030 1.663 1.737 1.07 ± 0.02
main_levm_FactorialRecursive 1.599 ± 0.020 1.569 1.629 1.01 ± 0.02
pr_revm_FactorialRecursive 1.686 ± 0.018 1.659 1.711 1.07 ± 0.01
pr_levm_FactorialRecursive 1.582 ± 0.014 1.564 1.604 1.00

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 199.3 ± 0.9 198.6 201.5 1.00
main_levm_Fibonacci 233.9 ± 2.1 229.0 236.3 1.17 ± 0.01
pr_revm_Fibonacci 201.0 ± 0.9 200.0 202.7 1.01 ± 0.01
pr_levm_Fibonacci 230.5 ± 3.5 226.7 237.4 1.16 ± 0.02

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 891.4 ± 8.1 881.4 905.3 1.29 ± 0.02
main_levm_FibonacciRecursive 695.6 ± 9.6 685.1 713.5 1.01 ± 0.02
pr_revm_FibonacciRecursive 886.9 ± 10.5 873.2 908.0 1.28 ± 0.02
pr_levm_FibonacciRecursive 691.5 ± 8.1 681.0 708.9 1.00

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.6 ± 0.1 8.5 8.7 1.01 ± 0.01
main_levm_ManyHashes 9.9 ± 0.1 9.8 10.1 1.17 ± 0.01
pr_revm_ManyHashes 8.5 ± 0.1 8.4 8.6 1.00
pr_levm_ManyHashes 10.0 ± 0.1 9.9 10.1 1.17 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 258.5 ± 7.8 252.2 274.5 1.10 ± 0.03
main_levm_MstoreBench 236.6 ± 4.3 233.9 248.5 1.01 ± 0.02
pr_revm_MstoreBench 258.5 ± 7.6 252.4 272.9 1.10 ± 0.03
pr_levm_MstoreBench 235.3 ± 1.2 233.4 237.9 1.00

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 319.2 ± 73.3 293.4 527.8 1.11 ± 0.26
main_levm_Push 286.7 ± 2.2 284.5 292.0 1.00 ± 0.01
pr_revm_Push 294.5 ± 0.5 293.8 295.2 1.03 ± 0.01
pr_levm_Push 286.3 ± 2.4 283.9 291.0 1.00

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 174.0 ± 1.4 172.3 176.7 1.73 ± 0.02
main_levm_SstoreBench_no_opt 102.0 ± 1.8 100.1 105.4 1.01 ± 0.02
pr_revm_SstoreBench_no_opt 173.8 ± 1.9 170.1 176.3 1.73 ± 0.03
pr_levm_SstoreBench_no_opt 100.7 ± 1.1 100.0 102.7 1.00

The DB_SCHEMA array runs as a single transaction during init_db(). On an
existing v9 database the latest_sent table has two columns (_id, batch),
but the INSERT statement tried to supply three values (including the new
verified_at column added in v10). This caused a SQLite error that rolled
back the entire schema transaction, preventing the subsequent ALTER TABLE
migration from ever executing.

By specifying column names in the INSERT, the statement works on both the
old 2-column table and the new 3-column table (verified_at gets its
DEFAULT 0). The ALTER TABLE migration then adds the column to existing
databases as intended.
@github-project-automation github-project-automation Bot moved this to In Review in ethrex_l1 Apr 22, 2026
@ilitteri ilitteri enabled auto-merge April 22, 2026 20:02
ilitteri and others added 4 commits April 22, 2026 17:55
…/store.rs.

The `warn!` calls in `read_chain_id_from_db` live inside `#[cfg(feature = "rocksdb")]`,
so when `Lint L2` runs `cargo clippy --workspace --features l2,l2-sql` (without the
rocksdb feature) the top-level `use tracing::warn` was unused and failed with
`-D warnings`.
tracing imports so the cfg-gated `use tracing::warn;` precedes the
unconditional `use tracing::{debug, error, info};`, as rustfmt expects.
@ilitteri ilitteri added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 59b0b42 Apr 28, 2026
74 of 75 checks passed
@ilitteri ilitteri deleted the release/v10.0.0 branch April 28, 2026 09:41
@github-project-automation github-project-automation Bot moved this from In Review to Done in ethrex_l1 Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client L2 Rollup client

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants