Skip to content

fix(executor): concurrent state reads, conditional bytecode copy, cache recovered signers#10

Open
wpank wants to merge 2 commits into
Nunchi-trade:mainfrom
wpank:fix/executor-perf-concurrent-reads-bytecode-signer
Open

fix(executor): concurrent state reads, conditional bytecode copy, cache recovered signers#10
wpank wants to merge 2 commits into
Nunchi-trade:mainfrom
wpank:fix/executor-perf-concurrent-reads-bytecode-signer

Conversation

@wpank
Copy link
Copy Markdown

@wpank wpank commented May 30, 2026

Summary

Three executor performance fixes targeting hot paths in block execution:

  • Issue #086 - Concurrent async reads in basic_ref(): Replaced sequential nonce().await / balance().await / code_hash().await calls with tokio::join!() to issue all three state reads concurrently. When the underlying StateDb can 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(): Changed extract_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 bytecode Vec clone 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(): Hoisted recover_signer() from per-variant match arms (Legacy/EIP2930/EIP1559/EIP4844/EIP7702) to a single call at the TxEnvelope level. 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-executor passes
  • cargo test -p kora-executor -- all 90 tests pass (45 unit + 45 integration)
  • cargo clippy -p kora-executor --no-deps -- -D warnings passes clean

🤖 Generated with Claude Code

will pankiewicz and others added 2 commits May 29, 2026 22:49
…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>
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.

1 participant