Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

⚡️ Pass specific fee ids to the sign request#149

Closed
garry-sharp wants to merge 1 commit into
resend-stuck-tx-fees-1from
send-ids-in-sign-req-fees
Closed

⚡️ Pass specific fee ids to the sign request#149
garry-sharp wants to merge 1 commit into
resend-stuck-tx-fees-1from
send-ids-in-sign-req-fees

Conversation

@garry-sharp

@garry-sharp garry-sharp commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

This passes specific fee ids to the verifier rather than the verifier simply wanting to reclear all fees

Summary by CodeRabbit

  • Refactor

    • Simplified fee rule processing by enforcing a single rule and adding explicit error handling for rule validation.
  • New Features

    • Keysign requests now include a new field displaying associated fee IDs for improved tracking.
  • Bug Fixes

    • Improved validation of recipient and token addresses to prevent incorrect transaction creation.

@coderabbitai

coderabbitai Bot commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The proposeTransactions method in plugin/fees/transaction.go was refactored to enforce that exactly one fee policy rule is present. The code now directly processes this single rule, validates recipient and token constraints, resolves addresses, and constructs an ERC20 transfer transaction. Additionally, the keysign request now includes a "fee_ids" field.

Changes

Cohort / File(s) Change Summary
Fee Policy Rule Processing Refactor
plugin/fees/transaction.go
Refactored proposeTransactions to require exactly one rule, added explicit error handling, validated constraints, resolved addresses, created ERC20 transfer, and included "fee_ids" in keysign request.

Sequence Diagram(s)

sequenceDiagram
    participant Policy as Fee Policy
    participant Rule as Rule
    participant Resolver as Address Resolver
    participant Tx as Transaction Builder
    participant Keysign as Keysign Request

    Policy->>Rule: Retrieve rules
    Rule->>Policy: Return rule list
    Policy->>Policy: Check exactly one rule
    Policy->>Rule: Extract recipient and token constraints
    Policy->>Policy: Validate recipient is treasury constant
    Policy->>Resolver: Resolve treasury address ("ethereum", "usdc")
    Resolver-->>Policy: Return treasury address
    Policy->>Policy: Validate token matches config USDC address
    Policy->>Tx: Create unsigned ERC20 transfer
    Tx-->>Policy: Return transaction data
    Policy->>Keysign: Construct keysign request (include "fee_ids")
    Keysign-->>Policy: Return keysign request
    Policy-->>Caller: Return keysign request
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A single rule, so clear and neat,
Now guides the fees with nimble feet.
Treasury checked, USDC in hand,
Transactions built just as planned.
"Fee_ids" hop along in tow—
This bunny’s code is good to go! 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch send-ids-in-sign-req-fees

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@garry-sharp

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 1, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@garry-sharp
garry-sharp force-pushed the resend-stuck-tx-fees-1 branch from 2b807cc to 4bb281b Compare August 13, 2025 21:23
@garry-sharp
garry-sharp force-pushed the send-ids-in-sign-req-fees branch from c7da289 to 8111fcc Compare August 13, 2025 22:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant