-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add feature to TXM to detect and purge stuck transactions #12881
Changes from 1 commit
246b04d
d47d88f
8c713dc
05c5a11
360d9fa
0a04fff
d26473c
1541c5a
1d4113d
c71ac14
2e46dde
8185dc8
20bfb9d
82e3a5d
db5264e
0d5b318
25105a1
491f9e3
338ab26
dc17b98
468b73b
736eb89
b2902c6
6eb5dc5
a5663ee
0cea37b
a3cd9b7
02306fe
a13605b
c2deae5
a5ea4aa
1cfb5cc
335033a
a5ba3a0
7513d36
4b41b4b
cc5764d
b1faa07
d67d79b
c4062f5
54b9c7c
d244012
0915400
c95d261
db5e5d9
31d69ba
90ec4a3
d81da52
a33460b
c08504b
88826a7
e400a36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,18 +456,17 @@ func (a *AutoPurgeConfig) ValidateConfig() (err error) { | |
return commonconfig.ErrInvalid{Name: "AutoPurgeDetectionApiUrl", Value: a.AutoPurgeDetectionApiUrl.Scheme, Msg: "must be http or https"} | ||
} | ||
} | ||
var errorList []error | ||
if a.AutoPurgeThreshold == nil { | ||
errorList = append(errorList, commonconfig.ErrMissing{Name: "AutoPurgeThreshold", Msg: "needs to be set if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
err = errors.Join(err, commonconfig.ErrMissing{Name: "AutoPurgeThreshold", Msg: "needs to be set if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
} else if *a.AutoPurgeThreshold == 0 { | ||
errorList = append(errorList, commonconfig.ErrInvalid{Name: "AutoPurgeThreshold", Value: *a.AutoPurgeThreshold, Msg: "cannot be 0 if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
err = errors.Join(err, commonconfig.ErrInvalid{Name: "AutoPurgeThreshold", Value: *a.AutoPurgeThreshold, Msg: "cannot be 0 if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
} | ||
if a.AutoPurgeMinAttempts == nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also validate here that gas bumping is enabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should for robustness but it could get messy with how we scope these configs. This one being under There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved the config validations under |
||
errorList = append(errorList, commonconfig.ErrMissing{Name: "AutoPurgeMinAttempts", Msg: "needs to be set if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
err = errors.Join(err, commonconfig.ErrMissing{Name: "AutoPurgeMinAttempts", Msg: "needs to be set if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
} else if *a.AutoPurgeMinAttempts == 0 { | ||
errorList = append(errorList, commonconfig.ErrInvalid{Name: "AutoPurgeMinAttempts", Value: *a.AutoPurgeMinAttempts, Msg: "cannot be 0 if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
err = errors.Join(err, commonconfig.ErrInvalid{Name: "AutoPurgeMinAttempts", Value: *a.AutoPurgeMinAttempts, Msg: "cannot be 0 if AutoPurgeStuckTxs is enabled and AutoPurgeDetectionApiUrl not set"}) | ||
} | ||
return errors.Join(errorList...) | ||
return | ||
} | ||
|
||
func (a *AutoPurgeConfig) setFrom(f *AutoPurgeConfig) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6947,6 +6947,40 @@ ResendAfterThreshold = '1m' # Default | |
``` | ||
ResendAfterThreshold controls how long to wait before re-broadcasting a transaction that has not yet been confirmed. | ||
|
||
## EVM.Transactions.AutoPurge | ||
```toml | ||
[EVM.Transactions.AutoPurge] | ||
AutoPurgeStuckTxs = false # Default | ||
AutoPurgeDetectionApiUrl = 'https://venus.scroll.io' # Example | ||
AutoPurgeThreshold = 5 # Example | ||
AutoPurgeMinAttempts = 3 # Example | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since these are scoped under
or what is the convention we prefer for the configs? I am looking at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I just looked at the other configs too and agree I shouldn't prepend the feature name. I've updated these in the latest commit. |
||
``` | ||
|
||
|
||
### AutoPurgeStuckTxs | ||
```toml | ||
AutoPurgeStuckTxs = false # Default | ||
``` | ||
AutoPurgeStuckTxs enables or disables automatically purging transactions that have been idenitified as terminally stuck (will never be included on-chain). This feature is only expected to be used by ZK chains. | ||
|
||
### AutoPurgeDetectionApiUrl | ||
```toml | ||
AutoPurgeDetectionApiUrl = 'https://venus.scroll.io' # Example | ||
``` | ||
AutoPurgeDetectionApiUrl configures the base url of a custom endpoint used to identify terminally stuck transactions. | ||
|
||
### AutoPurgeThreshold | ||
```toml | ||
AutoPurgeThreshold = 5 # Example | ||
``` | ||
AutoPurgeThreshold configures the number of blocks a transaction has to remain unconfirmed before it is evaluated for being terminally stuck. This threshold is only applied if there is no custom API to identify stuck transactions provided by the chain. | ||
|
||
### AutoPurgeMinAttempts | ||
```toml | ||
AutoPurgeMinAttempts = 3 # Example | ||
``` | ||
AutoPurgeMinAttempts cnofigures the minimum number of broadcasted attempts a transaction has to have before it is evaluated further for being terminally stuck. This threshold is only applied if there is no custom API to identify stuck transactions provided by the chain. | ||
|
||
## EVM.BalanceMonitor | ||
```toml | ||
[EVM.BalanceMonitor] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: optional, but if you collapse the null and 0 checks in same line, then code is less, and more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept them separate so I could differentiate between
ErrMissing
andErrInvalid
but I can maybe combine these into justErrInvalid