Repository navigation
Conversation
… path `build_payload` swept `execution_cache` into the `..` alongside the state root handle, so `--engine.share-execution-cache-with-payload-builder` never reached a build: every payload read accounts, storage and bytecode straight from the provider. Wire it through the same way reth's Ethereum builder does, by wrapping the state provider in a `CachedStateProvider` before the database is built. Reads served this way are only accounts, storage and bytecode; trie and proof reads still go to the inner provider. Expect a closed plumbing gap rather than a latency win.
Contributor
|
This pr has been automatically marked as stale and will be closed in 5 days if no updates |
Contributor
|
We still care about this, since we require performance improvements compared to vanilla op-reth to run our sequencer. Is there no interest in merging this or did you just not get to reviewing the PR? |
Contributor
|
This pr has been automatically marked as stale and will be closed in 5 days if no updates |
Contributor
|
I'm repeating myself, but this PR is still relevant. Happy to rebase to the lastest version if there is any feedback. |
Contributor
|
This pr has been automatically marked as stale and will be closed in 5 days if no updates |
Contributor
Author
|
still a worthwhile change |
Contributor
|
This pr has been automatically marked as stale and will be closed in 5 days if no updates |
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.
op-reth's payload builder threw away the execution cache the engine hands it, so
--engine.share-execution-cache-with-payload-builderdid nothing on the build path: every payloadread accounts, storage and bytecode straight from the provider, even when the engine had a warm
cache ready for that exact parent. This wires it through, same as reth's Ethereum builder.
What was wrong
OpPayloadBuilder::build_payloadsweptexecution_cacheinto the..of itsBuildArgumentsdestructure (
rust/op-reth/crates/payload/src/builder.rs:258). Everything leading up to that linealready worked: the engine checks out a
SavedCacheon FCU-with-attributes,BasicPayloadJobclones it into every build attempt, and op-reth's own
convert_build_argsforwards it faithfully(
builder.rs:404-430). Then the builder dropped it.What this does
Wraps the state provider in a
CachedStateProviderbefore the database is built, matchingcrates/ethereum/payload/src/lib.rs:173-181at the pinned rev line for line, per-buildCachedStateMetrics::zeroed(Builder)handle included.The cache serves
basic_account,storageandbytecode_by_hash. Trie, proof and storage-rootreads delegate to the inner provider, so the state root walk in
BlockBuilder::finishisunaffected.
CachedStateProvider::newselectsCacheFillMode::LookupOnly, so the builder readswithout ever writing into the engine's cache.
Relationship to other PRs
Independent of #22566, which pulls
state_root_handleout of the same destructure. The two conflicttextually and nowhere else, so whichever lands second is a one-line resolution. #22495 leaves
BuildArgumentsflat, so this survives the v2.5.0 bump with only the manifest line changing.Verified
cargo test -p reth-optimism-payload-builder: 25 passed.cargo test -p reth-optimism-node --all-features --test e2e_testsuite: 2 passed, 1 pre-existingignore.
cargo +nightly fmt --checkandcargo clippy --all-targetsclean.