Repository navigation
perf(evm): skip gas-limit estimation in execute - #57
Merged
Merged
Conversation
Execute ran pass 1, pass 2, a gas-limit binary search (~15 runs), and a final pass: about 18 EVM runs per accepted mutation. Only simulate needs a gas limit, because it builds the onchain transaction. Execute now runs pass 1 and pass 2 only, and its result has no gas_limit. Simulate returns the new SimulateResult type, which keeps gas_limit. Counter benchmark: evm execute 1.13ms -> 0.20ms per mutation. Harness benchmark: 2,236 -> 3,026 mutations/s.
3 tasks done
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
Each accepted mutation ran the EVM about 18 times: pass 1, pass 2, about 15 gas-limit binary-search runs, and a final pass. Only
simulateneeds a gas limit, because it builds the onchain transaction.executeonly accepts the mutation into local state.executeskips the gas-limit search, and its result has nogas_limit.simulatereturns the newSimulateResulttype, which keepsgas_limit. The runtime readsgas_limitonly fromsimulate, at submit.executeomitsgas_limit.Results
Test plan
bun run lint,bun run typecheck,bun run testsimulateand still pass.🤖 Generated with Claude Code

Confidence Score: 5/5
This PR appears safe to merge; no actionable issues were found.Summary
This PR skips gas-limit estimation when
executeaccepts a local mutation.simulatekeeps the search for transactions sent to the chain.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Contract call] --> B{Method} B -->|execute| C[Discover access list and run second pass] C --> D{Succeeded?} D -->|Yes| E[Commit local state and create journal] D -->|No| F[Discard writes] B -->|simulate| G[Temporarily rewind selected journals] G --> H[Run with access list] H --> I[Estimate gas limit on success] I --> J[Discard simulated writes and restore journals] J --> K[Return result with gas limit]Reviews (1) · Last reviewed commit: "perf(evm): skip gas-limit estimation in ..." · Reviewed by Greptile