Skip to content

[DO NOT MERGE] v1.1.0 Simulation-only wallet runtime bytecode for accurate VGL estimation (bundler overrides)#135

Open
amiecorso wants to merge 6 commits into
coinbase:mainfrom
amiecorso:amie/simulation-bytecode-for-accurate-vgl
Open

[DO NOT MERGE] v1.1.0 Simulation-only wallet runtime bytecode for accurate VGL estimation (bundler overrides)#135
amiecorso wants to merge 6 commits into
coinbase:mainfrom
amiecorso:amie/simulation-bytecode-for-accurate-vgl

Conversation

@amiecorso

@amiecorso amiecorso commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds simulation-only runtime bytecode and docs for use in producing accurate Verification Gas Limit (VGL) estimates for passkey (WebAuthn) flows via bundler overrides of CoinbaseSmartWallet implementations.

see #138 for v1.0.0 simulation bytecode

Motivation

Simulations necessarily use invalid passkey signatures. Invalid signatures take different verification paths than real valid signatures onchain, causing large gas deviations. (e.g., RIP-7212 precompile falls back to heavy FCL path during simulation but does not with a valid signature during execution.). This PR provides fake, simulation-friendly bytecode that forces the “valid signature” path so bundlers can estimate VGL accurately without manual buffers, instead passing this simulation bytecode as a state override to the bundler.

What’s in this PR

  • verifySim wired in CoinbaseSmartWallet to ignore provided WebAuthn signature data at the final check and instead use a known-valid P‑256 vector so simulation follows the same path as real execution.
  • Deployed/runtime bytecode exported for bundler overrides:
    • snapshots/SimulationOverrides/CoinbaseSmartWallet.runtime.hex
  • README section explaining purpose, build settings, and usage.

Usage (bundler overrides)

  • During eth_estimateUserOperationGas for passkey flows:
    • Override CoinbaseSmartWallet implementation address(es) with the bytecode in snapshots/SimulationOverrides/CoinbaseSmartWallet.runtime.hex.
    • Affected CoinbaseSmartWallet versions:
      • v1.0.0 (0x000100abaad02f1cfC8Bbe32bD5a564817339E72)
      • v1.1.0 (0x00000110dCdEdC9581cb5eCB8467282f2926534d)
    • Continue providing a dummy signature for calldata parity; verifySim ensures the verification path succeeds to mirror onchain valid-signature behavior.

Simulation-only! Do not deploy

@cb-heimdall

cb-heimdall commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@amiecorso amiecorso changed the title Simulation-only wallet runtime bytecode for accurate VGL estimation (bundler overrides) [DO NOT MERGE] Simulation-only wallet runtime bytecode for accurate VGL estimation (bundler overrides) Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the output we need to pass as bundler override to eth_estimateUserOperationGas

@amiecorso amiecorso changed the title [DO NOT MERGE] Simulation-only wallet runtime bytecode for accurate VGL estimation (bundler overrides) [DO NOT MERGE] v1.1.0 Simulation-only wallet runtime bytecode for accurate VGL estimation (bundler overrides) Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants