Skip to content

Release v3.1.6 #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged

Release v3.1.6 #200

merged 1 commit into from
Apr 2, 2025

Conversation

vignesha22
Copy link
Contributor

@vignesha22 vignesha22 commented Apr 2, 2025

Description

  • Fixed bug in paymaster estimation for multiTokenPaymaster getERC20Quotes API where if the wallet is undeployed or has only token balance then it fails to estimate so generated paymasterAndData for the userOp and added before estimation to get the estimated values

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Further comments (optional)

Summary by CodeRabbit

  • Chores
    • Updated the release version to 3.1.6 and refreshed the release documentation.
  • Bug Fixes
    • Resolved an issue affecting transaction quote estimation for improved accuracy.
  • New Features
    • Integrated enhanced transaction signing capabilities to support secure and reliable processing.

Copy link

coderabbitai bot commented Apr 2, 2025

Walkthrough

This update bumps the backend version from 3.1.5 to 3.1.6. The changelog now documents a fix for the paymaster estimation bug in the multiTokenPaymaster for the getERC20Quotes API. In addition, the Paymaster class and route have been modified to include a new signer parameter. The getQuotesMultiToken method now generates formatted timestamps and calls a dedicated helper to create the paymaster data. A new provider and Wallet are created in the route before calling the updated method.

Changes

File(s) Change Summary
backend/CHANGELOG.md, backend/package.json Updated package version from 3.1.5 to 3.1.6; added a new changelog entry documenting a bug fix in the paymaster estimation within the multiTokenPaymaster for the getERC20Quotes API.
backend/.../paymaster/index.ts, backend/.../paymaster-routes.ts Modified the Paymaster class and paymaster routes by adding a new signer parameter to the constructor and to the getQuotesMultiToken method; introduced formatted timestamp calculations and updated the route to create a Wallet signer.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client Request
    participant Route as paymasterRoutes
    participant Provider as JsonRpcProvider
    participant Wallet as Wallet (Signer)
    participant Paymaster as Paymaster

    Client->>Route: Request multi-token quote
    Route->>Provider: Create provider (using bundlerUrl)
    Route->>Wallet: Create signer (using privateKey & provider)
    Route->>Paymaster: Call getQuotesMultiToken(..., signer, ...)
    Paymaster-->>Route: Return paymaster data
    Route-->>Client: Deliver response
Loading

Suggested reviewers

  • kanthgithub
  • cryptonoyaiba
  • nikhilkumar1612
  • ch4r10t33r

Poem

I'm a rabbit with a joyful hop,
In a world of code, I never stop.
With a signer here and a provider there,
Our updates scurry with utmost care.
Hop along the path to a bug-free blip—
Celebrate the fixes as we skip and skip!
🥕🐰 Happy coding, let the changes rip!

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 generate unit testing code.
    • @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.

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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

Copy link
Member

@ch4r10t33r ch4r10t33r left a comment

Choose a reason for hiding this comment

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

Looks good. Pls push to prod once @nikhilkumar1612 approves as well,

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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 265596f and 1a40b4e.

📒 Files selected for processing (4)
  • backend/CHANGELOG.md (1 hunks)
  • backend/package.json (1 hunks)
  • backend/src/paymaster/index.ts (2 hunks)
  • backend/src/routes/paymaster-routes.ts (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
backend/CHANGELOG.md

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (5)
backend/package.json (1)

3-3: Version update looks appropriate for the bugfix.

The version bump from 3.1.5 to 3.1.6 follows semantic versioning principles for a bugfix release.

backend/src/routes/paymaster-routes.ts (1)

192-194: The signer integration is critical for the paymaster estimation fix.

The addition of provider and signer creation before calling getQuotesMultiToken is a key part of the fix. The method now correctly receives a signer parameter, enabling it to generate the necessary paymaster data before estimation.

backend/src/paymaster/index.ts (3)

553-554: Method signature updated to include the signer parameter.

The getQuotesMultiToken method has been updated to accept a signer parameter of type Wallet, which is essential for generating the paymaster data.


578-592: Added timestamp generation for validation windows.

These lines create the necessary timestamps and format them as hexadecimal strings, following the same pattern used in other methods in this class. This is required for signing the paymaster data.


593-594:

✅ Verification successful

Core fix: Generate paymasterAndData before estimation.

This is the critical part of the fix that addresses the bug described in the PR. By generating the paymasterAndData for the user operation before estimation, the system can now accurately estimate gas costs even when a user's wallet is undeployed or only contains token balances.

Let's verify that the payload to the bundler now includes the correctly formatted paymasterAndData:


🏁 Script executed:

#!/bin/bash
# Check if there are any instances where userOp.paymasterAndData is used without being initialized first
rg -A 5 "send\('eth_estimateUserOperationGas'" --type ts

Length of output: 3645


Verified: Multi-token paymaster now correctly pre-computes paymasterAndData for estimation

The updated code in backend/src/paymaster/index.ts (lines 593–594) now sets up the paymaster payload (using getPaymasterAndDataForMultiTokenPaymaster) before the gas estimation process. Our verification via the search script confirms that no instance sends a payload with an uninitialized or misordered paymasterAndData. This change ensures that gas estimation properly accounts for scenarios such as undeployed wallets or wallets holding only token balances.

  • Verified that in the multi-token paymaster branch the paymasterAndData is generated early as intended.
  • Confirmed that no branch is using an uninitialized paymasterAndData in calls to eth_estimateUserOperationGas.

Comment on lines +2 to +5
## [3.1.6] - 2025-04-02
### Fixes
- Fixed bug in paymaster estimation for multiTokenPaymaster getERC20Quotes API

Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

The changelog entry clearly documents the bug fix.

The changelog appropriately includes the version, date, and a concise description of the fixed issue. However, there are some markdown formatting issues in the document.

According to markdown best practices, headings should be surrounded by blank lines for better readability:

1
# Changelog
+
## [3.1.6] - 2025-04-02
+
### Fixes
+
- Fixed bug in paymaster estimation for multiTokenPaymaster getERC20Quotes API
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## [3.1.6] - 2025-04-02
### Fixes
- Fixed bug in paymaster estimation for multiTokenPaymaster getERC20Quotes API
# Changelog
## [3.1.6] - 2025-04-02
### Fixes
- Fixed bug in paymaster estimation for multiTokenPaymaster getERC20Quotes API
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

@vignesha22 vignesha22 merged commit 75e69ad into master Apr 2, 2025
6 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Apr 16, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants