Skip to content
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

txmgr: Add custom publish error message handling #13856

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sebastianst
Copy link
Member

Description

This PR adds the ability to configure a "List of custom RPC error messages that indicate that a transaction has already been published."
Some (proprietary) RPC providers respond with custom errors when a transaction got already published or even mined, see #13739. This would let the txmgr enter a publishing loop repeatedly hitting the same error that should be interpreted as a signal that a transaction actually already got published.

Tests

Added a test that a custom rpc error returned from a transaction publication is interpreted as a successful send.

Metadata

Fixes #13739

@sebastianst sebastianst requested a review from a team as a code owner January 20, 2025 15:12
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.21%. Comparing base (bd7c16b) to head (0f339b4).
Report is 17 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13856       +/-   ##
============================================
+ Coverage    46.99%   79.21%   +32.21%     
============================================
  Files          967      167      -800     
  Lines        80759     9440    -71319     
  Branches       774      774               
============================================
- Hits         37956     7478    -30478     
+ Misses       39911     1700    -38211     
+ Partials      2892      262     -2630     
Flag Coverage Δ
cannon-go-tests-32 62.26% <ø> (-1.98%) ⬇️
cannon-go-tests-64 57.35% <ø> (-1.62%) ⬇️
contracts-bedrock-tests 91.74% <ø> (+2.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 825 files with indirect coverage changes

Copy link
Contributor

@protolambda protolambda left a comment

Choose a reason for hiding this comment

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

LGTM, just one nit to keep the env var naming consistent

&cli.StringSliceFlag{
Name: AlreadyPublishedCustomErrsFlagName,
Usage: "List of custom RPC error messages that indicate that a transaction has already been published.",
EnvVars: prefixEnvVars("ALREADY_PUBLISHED_CUSTOM_ERRS"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
EnvVars: prefixEnvVars("ALREADY_PUBLISHED_CUSTOM_ERRS"),
EnvVars: prefixEnvVars("TXMGR_ALREADY_PUBLISHED_CUSTOM_ERRS"),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

txmgr: Handle "already mined" cased when publishing a tx
2 participants