Repository navigation
fix: detect state overrides that set the same account with different address casing - #5604
Merged
Merged
Conversation
|
@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 43625d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
jxom
approved these changes
Nov 19, 2026
jxom
left a comment
Member
There was a problem hiding this comment.
Verified: mixed-casing duplicates now throw AccountStateConflictError; distinct addresses and caller casing unchanged. The getProof CI failure is unrelated (fork PRs don't receive VITE_ANVIL_FORK_URL, so the public RPC rejects proofs for the pinned fork block).
Merged
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.
serializeStateOverridedetects an account that is set more than once by looking up the exact address string, but it accepts addresses in any casing (isAddress(address, { strict: false })). A checksummed address and its lowercase form were treated as two accounts and both sent as separate keys in the RPC state override.Nodes decode the override into a map keyed by address, so the later entry silently replaces the earlier one. For example,
callwithstateOverride: [{ address: '0xd8dA…6045', balance: 1n }, { address: '0xd8da…6045', balance: 2n }]resolves using balance2and drops the first override without an error, which is the caseAccountStateConflictErrorexists to catch. On a local Anvil, swapping the order of the two entries swaps the balance the call observes.This compares addresses case-insensitively when checking for conflicts, consistent with
hasStateOverrideForAddressincall, which usesisAddressEqual. Override keys are still sent with the casing the caller provided, so output for valid input is unchanged. This applies to every action that usesserializeStateOverride(call,estimateGas,simulateBlocks, and others).serializeStateOverridetest with the same account in checksummed and lowercase form. It fails without this change (snapshot function didn't throw).Checks run:
pnpm test --run src/utils/stateOverride.test.ts,tsc -b src/tsconfig.json, Biome.