Skip to content

AccountERC7579: document that isValidSignature has no native validation fallback - #6708

Open
BhariGowda wants to merge 1 commit into
OpenZeppelin:masterfrom
BhariGowda:docs/account-erc7579-isvalidsignature-natspec
Open

BhariGowda wants to merge 1 commit into
OpenZeppelin:masterfrom
BhariGowda:docs/account-erc7579-isvalidsignature-natspec

Conversation

@BhariGowda

@BhariGowda BhariGowda commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

AccountERC7579.isValidSignature is documented as falling back to "native" validation by the abstract signer. It does not, and it never has.

draft-AccountERC7579.sol#L185-L191:

/**
 * @dev Implement ERC-1271 through IERC7579Validator modules. If module based validation fails, fallback to
 * "native" validation by the abstract signer.
 * ...

The body (L192-L207) returns bytes4(0xffffffff) on every path that does not reach an installed validator. It calls neither super nor _rawSignatureValidation, and this same contract overrides _rawSignatureValidation at L423-L429 to return false, under the comment "By default, only use the modules for validation of userOp and signature. Disable raw signatures."

So the file states both that native validation is a fallback and that it is disabled. The code agrees with the second.

_validateUserOp (L209-L226) is the function that does have the fallback:

return
    isModuleInstalled(MODULE_TYPE_VALIDATOR, module, Calldata.emptyBytes())
        ? IERC7579Validator(module).validateUserOp(userOp, _signableUserOpHash(userOp, userOpHash))
        : super._validateUserOp(userOp, userOpHash, signature);

super._validateUserOp resolves to Account._validateUserOp, which is exactly _rawSignatureValidation(...) ? SIG_VALIDATION_SUCCESS : SIG_VALIDATION_FAILED. That makes the fallback meaningful for a derived contract that re-overrides _rawSignatureValidation (as AccountMock does), and its NatSpec ("Falls back to {Account-_validateUserOp} otherwise") is accurate.

The asymmetry between the two functions looks deliberate: the _rawSignatureValidation override states the same decision a second way. Only the description of isValidSignature is wrong, and it has been since #5657 introduced the function: that @dev block and the body have both been unchanged since, so this is a stale description rather than a behavior change that the docs missed. This PR rewrites that one @dev block to say how the validator is selected, that the module's return value is forwarded as-is, and which three paths produce 0xffffffff. _validateUserOp and the _rawSignatureValidation override are untouched.

Verification

Comment-only, and checked rather than assumed: compiled master and this branch, stripped the trailing CBOR metadata from deployedBytecode, and the runtime code of $AccountERC7579Mock, $AccountERC7579HookedMock and $AccountMock is byte-identical across the two.

npm run lint:sol clean, npm test green (8417 passing: 361 solidity, 8056 mocha, 0 failing).

Changeset

None. NatSpec only, no user-visible behavior change. Recent documentation-only PRs (#6681, #6648, #6636, #6633, #6623, #6607, #6422) all merged with no changeset and the ignore-changeset label. Happy to add one instead if you prefer.

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

…on fallback

The `@dev` block said that ERC-1271 validation falls back to "native"
validation by the abstract signer when module based validation fails. It
does not. `isValidSignature` returns `0xffffffff` and never calls `super`
or `_rawSignatureValidation`, which this contract overrides to return
`false` by default.

`_validateUserOp` is the function that does have that fallback, and its
own NatSpec is accurate, so only the `isValidSignature` block changes. The
replacement describes how the validator is selected, that the module's
return value is forwarded as-is, and which paths yield `0xffffffff`.

Comment only. Runtime bytecode of `$AccountERC7579Mock`,
`$AccountERC7579HookedMock` and `$AccountMock` is byte-identical before and
after once the trailing metadata hash is stripped.
@BhariGowda
BhariGowda requested a review from a team as a code owner August 21, 2026 05:09
@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d66f7a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f98b4731-0d29-41b5-b287-c877aa322733

📥 Commits

Reviewing files that changed from the base of the PR and between 7e4d006 and d66f7a8.

📒 Files selected for processing (1)
  • contracts/account/extensions/draft-AccountERC7579.sol

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The ERC-1271 documentation now states that signature validation uses only installed validator modules. It states that successful validator results are forwarded. It also documents 0xffffffff for short signatures, uninstalled validators, and reverted validator calls. The previous native abstract-signer validation fallback description was removed.

Merge Risk: ⚪ Minimal · up to d66f7

This PR clarifies existing signature-validation behavior without changing runtime code or user-facing functionality. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the documentation change to remove the incorrect native validation fallback.
Description check ✅ Passed The description directly explains the documentation correction, affected functions, verification results, and lack of behavior changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch is waiting to be deployed

1 waiting deployment
certora — d66f7a8a Waiting Sep 24, 2026 by james-toussaint via verify (fv/specs/Account.conf) #313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Inline comments, guides, and examples. ignore-changeset

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants