Skip to content

Conversation

Snezhkko
Copy link

@Snezhkko Snezhkko commented Sep 8, 2025

This change updates isValidSignature documentation to reflect the actual behavior: validation is delegated exclusively to installed ERC-7579 validator modules and returns 0xffffffff when none validate; native/raw signature validation is disabled by default in this extension. The _validateUserOp comment is also clarified to note that while it falls back to {Account-_validateUserOp}, raw validation is disabled here, so the fallback will not succeed unless overridden or composed with other extensions (e.g., ERC-7739). These updates remove confusing guidance that suggested a native fallback existed, aligning docs with the implemented and intended behavior.

Summary by Sourcery

Clarify in AccountERC7579 that ERC-1271 signature validation is exclusively delegated to installed validator modules with no native/raw fallback by default, and update _validateUserOp comments accordingly

Documentation:

  • Clarify ERC-1271 implementation in isValidSignature to delegate solely to IERC7579Validator modules and return 0xffffffff when none validate, disabling native/raw signature validation by default
  • Update _validateUserOp comment to note that raw signature validation is disabled and its fallback to Account-_validateUserOp will not succeed unless overridden or composed with other extensions

Summary by CodeRabbit

  • Documentation
    • Clarified how signature validation delegates to installed validator modules and the expected fallback behavior when none approve.
    • Noted that native/raw signature checks are disabled by default and must be explicitly enabled or composed via compatible extensions.
    • Added guidance on multiple-inheritance scenarios, including resolution order considerations when combining extensions.
    • Updated user operation validation notes to reflect the default behavior and when overrides/composition are required for raw signature handling.
    • No public APIs changed.

@Snezhkko Snezhkko requested a review from a team as a code owner September 8, 2025 18:08
Copy link

changeset-bot bot commented Sep 8, 2025

⚠️ No Changeset found

Latest commit: 518a78f

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

Copy link
Contributor

sourcery-ai bot commented Sep 8, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates documentation in the AccountERC7579 extension to accurately describe ERC-1271 behavior: signature checks are delegated exclusively to IERC7579Validator modules (returning 0xffffffff if none validate), native/raw signature validation is disabled by default, and the _validateUserOp fallback path will only work when explicitly overridden or composed with other extensions.

Class diagram for updated AccountERC7579 extension documentation

classDiagram
    class AccountERC7579 {
        <<abstract>>
        +isValidSignature(data, signature) : bytes4
        +_validateUserOp(userOp, userOpHash, missingAccountFunds) : uint256
        Note: isValidSignature delegates to installed IERC7579Validator modules
        Note: Returns 0xffffffff if no module validates
        Note: Native/raw signature validation is disabled by default
    }
    class IERC1271 {
        <<interface>>
        +isValidSignature(data, signature) : bytes4
    }
    class IERC7579Validator {
        <<interface>>
        +isValidSignatureWithSender(sender, data, signature) : bytes4
    }
    class Account {
        <<abstract>>
        +_validateUserOp(userOp, userOpHash, missingAccountFunds) : uint256
    }
    AccountERC7579 --|> Account
    AccountERC7579 --|> IERC1271
    AccountERC7579 --|> IERC7579Validator
    AccountERC7579 : - native/raw signature validation is disabled
    AccountERC7579 : - fallback to Account-_validateUserOp only works if overridden or composed
    AccountERC7579 : - developers can override or compose with ERC7739 for native validation
    class ERC7739 {
        <<extension>>
    }
Loading

Flow diagram for isValidSignature delegation in AccountERC7579

flowchart TD
    A["isValidSignature(data, signature)"] --> B["Delegate to installed IERC7579Validator modules"]
    B -->|"Module validates"| C["Return module's result"]
    B -->|"No module validates"| D["Return 0xffffffff"]
    D --> E["No native/raw validation performed"]
Loading

File-Level Changes

Change Details Files
Docstring for isValidSignature updated to reflect module-based validation and disabled native fallback
  • Rewrote header to describe delegation to IERC7579Validator modules and return value when no validation succeeds
  • Removed misleading guidance about native signature fallback
  • Added notes on how to enable native/raw validation via override or composing with other extensions
contracts/account/extensions/draft-AccountERC7579.sol
Comment on _validateUserOp clarified to note disabled raw validation and fallback behavior
  • Inserted note that raw signature validation is disabled here
  • Clarified that fallback to Account-_validateUserOp will not succeed without explicit override or composition
  • Referenced related extension examples for composition
contracts/account/extensions/draft-AccountERC7579.sol

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

coderabbitai bot commented Sep 8, 2025

Walkthrough

Documentation in contracts/account/extensions/draft-AccountERC7579.sol was updated to clarify ERC-1271 signature validation delegation to IERC7579Validator modules, default disabling of raw/native signature validation, guidance on combining with ERC7739 and multiple inheritance, and notes that _validateUserOp depends on overrides. No code or API signatures changed.

Changes

Cohort / File(s) Summary of changes
Docs-only updates
contracts/account/extensions/draft-AccountERC7579.sol
Updated comments to describe ERC-1271 delegation to IERC7579Validator, default behavior returning 0xffffffff when unvalidated, explicit note that raw signature validation is disabled unless overridden/combined (e.g., with ERC7739), and implications for _validateUserOp and multiple inheritance. No functional changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I nibble notes in fields of code,
Footprints light where modules load.
No raw seeds by default today—
Validators lead the rabbit’s way.
If ERC7739 hops in the mix,
We juggle paths with careful tricks.
Thump-thump: docs polished, burrow fixed.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
contracts/account/extensions/draft-AccountERC7579.sol (1)

175-182: Nit: clarify short signatures and module return value

Suggest mentioning that invalid also covers signatures shorter than 20 bytes, and that modules MUST return the ERC‑1271 magic (0x1626ba7e); this function forwards the module’s return unchanged.

- * function returns `0xffffffff`.
+ * function returns `0xffffffff` (including when the signature is shorter than 20 bytes).
+ *
+ * Modules MUST return the ERC-1271 magic value (`0x1626ba7e`) on success; this function forwards
+ * the module's return value unchanged.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8dbd6bc and f2ee7d1.

📒 Files selected for processing (1)
  • contracts/account/extensions/draft-AccountERC7579.sol (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: tests-foundry
  • GitHub Check: tests-upgradeable
  • GitHub Check: tests
  • GitHub Check: coverage
  • GitHub Check: slither
  • GitHub Check: halmos
🔇 Additional comments (2)
contracts/account/extensions/draft-AccountERC7579.sol (2)

175-182: Docs correctly state ERC-1271 delegation and no native fallback

Accurately reflects the implementation and the _rawSignatureValidation override.


208-211: Docs about _validateUserOp fallback and disabled raw validation are accurate

Matches behavior: fallback to {Account-_validateUserOp} won’t pass here unless another ancestor enables raw validation (e.g., via ERC-7739).

Comment on lines 208 to 211
* Note: this contract disables raw signature validation (see {_rawSignatureValidation}), so unless
* overridden or complemented via multiple inheritance, the fallback path to {Account-_validateUserOp}
* will not succeed by itself.
*
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part is incorrect. If no installed validation module is extracted from the user operation, we fallback to super._validateUserOp. In the absence of other overrides, this fallback goes to Account._validateUserOp which does a _rawSignatureValidation check.

Copy link
Author

Choose a reason for hiding this comment

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

This part is incorrect. If no installed validation module is extracted from the user operation, we fallback to super._validateUserOp. In the absence of other overrides, this fallback goes to Account._validateUserOp which does a _rawSignatureValidation check.

corrected

@Amxx Amxx changed the base branch from master to typo-fixes September 9, 2025 13:53
@Amxx Amxx added documentation Inline comments, guides, and examples. ignore-changeset typo labels Sep 9, 2025
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 typo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants