refactor: bootloader zk tx flow#673
Open
AntonD3 wants to merge 6 commits into
Open
Conversation
Contributor
Block-level effective cycles
Block-level sub-phases
Precompiles test-crate bench (synthetic workload, all labels)
Per-opcodePer-opcode cycle diff
Per-precompilePer-precompile per-execution ratios (head) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What ❔
Refactor of the bootloader's resource / gas accounting in the ZK transaction flow.
computational native, gas) and returns (ResourcesForTx, Option). Charges are saturating and non-short-circuiting: every subtraction is applied even when an earlier one underflowed,
so the resource state is well-formed for the L1 saturate-and-continue path, and the first observed validation error is recorded for the L2 fail-fast path.
validation as native_per_gas == 0 ⇒ free_native). The MAX_NATIVE_COMPUTATIONAL per-tx cap and block-level limits now apply uniformly, with no test-only exemption code paths. EVM tester, eth_runner,
divergence validator, and the rig test profiles are migrated to set native_price = 0 in their block contexts. The TESTER_NATIVE_PER_GAS constant is removed (test rigs encode the equivalent ratio
directly).
corresponding InvalidTransaction::BlockGasLimitTooHigh variant is dropped along with its forward_system conversion arm.
ResourcesForTx only hold actual resources.
Why ❔
dispatch surface (a trait with five methods, two impls, an arithmetic-error enum) outweighed what it actually expressed. With the single function and Option return, both call sites
become 4 lines and the divergence is "L2 returns the error, L1 logs it."
Migrating to native_price = 0 means a single runtime metadata field controls the same behavior; production binaries no longer need a parallel "tester" code path that diverges from real semantics.
Is this a breaking change?
It's breaking in terms of features, but corresponding features usage within the repo was updated; no uses outside the repo were found.
Checklist