fix(executor): concurrent state reads, conditional bytecode copy, cache recovered signers#10
Open
wpank wants to merge 2 commits into
Open
Conversation
…he recovered signers Three executor performance fixes: - Issue #086: Use tokio::join! in basic_ref() to issue nonce, balance, and code_hash reads concurrently instead of sequentially, reducing async-to-sync bridge overhead when the underlying StateDb can serve reads in parallel. - Issue #087: Only copy bytecode in extract_changes() for newly created accounts (contract deployments). Previously every touched account paid a full bytecode Vec clone even for plain ETH transfers to existing contracts where the code hasn't changed. - Issue #117: Recover the transaction signer once at the TxEnvelope level in decode_tx_env() instead of per-variant, eliminating redundant ECDSA recovery (~250us each) across Legacy/EIP2930/EIP1559/EIP4844/ EIP7702 match arms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Three executor performance fixes targeting hot paths in block execution:
Issue #086 - Concurrent async reads in
basic_ref(): Replaced sequentialnonce().await/balance().await/code_hash().awaitcalls withtokio::join!()to issue all three state reads concurrently. When the underlyingStateDbcan serve reads in parallel (e.g., from different shards or cache lines), this eliminates unnecessary serial waiting.Issue #087 - Conditional bytecode copy in
extract_changes(): Changedextract_changes()to only copy bytecode for newly created accounts (contract deployments). Previously, every touched account -- including plain ETH transfers to existing contracts -- paid a full bytecodeVecclone even though the code hadn't changed. This is wasteful on workloads with many contract interactions.Issue #117 - Single signer recovery in
decode_tx_env(): Hoistedrecover_signer()from per-variant match arms (Legacy/EIP2930/EIP1559/EIP4844/EIP7702) to a single call at theTxEnvelopelevel. ECDSA recovery is ~250us per call, so eliminating 4 redundant recovery code paths per transaction type reduces decode overhead. The signer was already validated at mempool admission, making re-recovery during execution redundant work.Test plan
cargo check -p kora-executorpassescargo test -p kora-executor-- all 90 tests pass (45 unit + 45 integration)cargo clippy -p kora-executor --no-deps -- -D warningspasses clean🤖 Generated with Claude Code