Integrate Ecosystem Signing Policies
Closes TOOL-4019
Pending tests
PR-Codex overview
This PR focuses on enhancing the PersonalSign methods across various wallet classes to include optional parameters for originalMessage and chainId. It also introduces new classes for user operations and improves JSON serialization settings.
Detailed summary
- Added
UserOperationHexifiedV6andUserOperationHexifiedV7classes with JSON serialization. - Updated
PersonalSignmethods inPrivateKeyWallet,EngineWallet, andIThirdwebWalletto includeoriginalMessageandchainIdparameters. - Enhanced JSON serialization in
ThirdwebRPCandEcosystemWalletto ignore null values. - Modified payloads in
EcosystemWalletfor signing messages to include new parameters. - Adjusted
HashAndSignUserOpmethods inSmartWalletto pass new parameters during signing.
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}
Summary by CodeRabbit
-
New Features
- Expanded signature methods across various wallet types to accept additional optional parameters for enhanced signing flexibility.
-
Improvements
- Improved JSON serialization to ignore null values in wallet operations and batch requests, resulting in cleaner and more efficient request payloads.
-
Documentation
- Updated method documentation to reflect new optional parameters in wallet signing interfaces.
Walkthrough
The changes introduce optional originalMessage and chainId parameters to PersonalSign methods across wallet classes and interfaces. These parameters are included in payloads sent to enclave signing endpoints and used in user operation signing. JSON serialization is updated to ignore null values for these new fields and related user operation classes.
Changes
| File(s) | Change Summary |
|---|---|
| Thirdweb/Thirdweb.Wallets/IThirdwebWallet.cs Thirdweb/Thirdweb.Wallets/EngineWallet/EngineWallet.cs Thirdweb/Thirdweb.Wallets/InAppWallet/EcosystemWallet/EcosystemWallet.cs Thirdweb/Thirdweb.Wallets/PrivateKeyWallet/PrivateKeyWallet.cs Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs |
Added optional originalMessage and chainId parameters to PersonalSign methods and updated implementations to include these in signing payloads or calls. |
| Thirdweb/Thirdweb.Wallets/SmartWallet/Thirdweb.AccountAbstraction/AATypes.cs | Added [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] attribute to user operation classes to ignore null values during serialization. |
| Thirdweb/Thirdweb.RPC/ThirdwebRPC.cs | Updated JSON serialization settings to ignore null values in batch RPC requests by introducing _jsonSerializerSettings. |
Sequence Diagram(s)
sequenceDiagram
participant Caller
participant SmartWallet
participant PersonalAccount
participant EnclaveAPI
Caller->>SmartWallet: HashAndSignUserOp(userOp, chainId)
SmartWallet->>SmartWallet: EncodeUserOperation(userOp)
SmartWallet->>PersonalAccount: PersonalSign(userOpHash, originalMessage=userOp, chainId)
PersonalAccount->>EnclaveAPI: POST /sign-message { message, isRaw, originalMessage, chainId }
EnclaveAPI-->>PersonalAccount: signature
PersonalAccount-->>SmartWallet: signature
SmartWallet-->>Caller: signature
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Pass originalMessage and chainId to enclave sign-message API when signing user operations (TOOL-4019) |
✅ |
📜 Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 69df32e27b6588c07002e64ec59c70c7c80c5f6e and edbe643488b78b30dbe2da6e6d7ff3afb9348974.
📒 Files selected for processing (1)
Thirdweb/Thirdweb.Wallets/IThirdwebWallet.cs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Thirdweb/Thirdweb.Wallets/IThirdwebWallet.cs
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-test-cov
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 60.96%. Comparing base (
b6541d6) to head (edbe643).
Additional details and impacted files
@@ Coverage Diff @@
## main #149 +/- ##
==========================================
+ Coverage 60.94% 60.96% +0.01%
==========================================
Files 41 41
Lines 6563 6566 +3
Branches 832 832
==========================================
+ Hits 4000 4003 +3
Misses 2376 2376
Partials 187 187
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.