Conversation
Collaborator
🟡 Heimdall Review Status
|
verifySim for use in VGL estimation bundler bytecode overrides
verifySim for use in VGL estimation bundler bytecode overridesverifySim for use in VGL estimation bundler bytecode overrides
amiecorso
commented
Nov 4, 2025
|
|
||
| // Final signature verification uses the internal fixed vector, not the caller inputs. | ||
| // This will succeed on both precompile-enabled and software paths, aligning simulation with onchain success. | ||
| return _verifySigP256(_SIM_MSG, _SIM_R, _SIM_S, _SIM_X, _SIM_Y); |
Author
There was a problem hiding this comment.
The most important change on this branch, hard-coding the highest-gas, known-valid experimental test vector.
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.
Problem
verifydoesn’t fix VGL estimation:Approach
verifySim(simulation‑only): ignores caller inputs and uses a known‑valid P‑256 vector. If RIP‑7212 is present, it succeeds there via the precompile, otherwise falls back to FCL using the conservatively high-gas vector.What changed
WebAuthn.sol: addverifySim, a simulation-only version ofverifythat uses a hardcoded successful P‑256ri max‑gas vector.test/fixtures/fcl_gas_profile.csvandtest/fixtures/fcl_gas_hist.html; commit artifacts to show work.Why this works
Validate
verifySimin your bundler sim; VGL should be stable and conservative.verifySimreturnstrueeven when fed an invalid signature.Gas usage for test vectors
The difference between the highest- and lowest-gas-consuming vectors is about 17,000 gas. Given that the full gas cost for a call to

verifyis roughly 250,000 gas (see benchmarks here, without RIP7212), a potential overestimation by 17,000 gas is only about a 7% overestimation for the call toWebAuthn.verify, and an even smaller percentage of the total gas required for the full ERC-4337 verification path. Therefore it is safe to use the maximum-gas vector for the FCL simulation without being likely to trigger the bundler's gas efficiency requirements (which typically tolerates closer to 50% overestimation for VGL above the actual VG used).