-
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
Fix Nil pointer error in TXM stuck tx detector #14685
Fix Nil pointer error in TXM stuck tx detector #14685
Conversation
WF: CI Core#b43bf21No errors found in this run. 🎉 |
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.
Left one comment about something that confused me in the logic. In addition, I was wondering - can we add a test case somewhere that triggers this logic? I think we are adding logic to cover an unusual corner case it'd be good to have a test covering it so someone doesn't accidentally come along and break the desired behavior.
// 3. Check if the transaction has at least MinAttempts amount of broadcasted attempts | ||
if broadcastedAttemptsCount < *d.cfg.MinAttempts() { | ||
continue | ||
} | ||
// 4. Check if the newest broadcasted attempt's gas price is higher than what our gas estimator's GetFee method returns | ||
if compareGasFees(newestBroadcastAttempt.TxFee, marketGasPrice) <= 0 { | ||
if newestBroadcastAttempt != nil && compareGasFees(newestBroadcastAttempt.TxFee, marketGasPrice) <= 0 { |
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.
if this is nil, shouldn't we log an error, similar to if oldestBroadcastAttempt
is nil?
Would it make sense to move both checks up to line 220 before we do anything else? Although interestingly it looks like if oldest is nil we continue and if newest is nil we will add it to the stuck txns.
7e9c1bd
Quality Gate passedIssues Measures |
An NPE bug was identified in the Stuck Tx Detector component. The fix was addressed in this smartcontractkit/chainlink#14685 in core but needs to be applied to CCIP as well. Changes could not be cherry-picked because of other changes made to the component in between so changes were back ported manually.
Description
The stuck transaction detector handler in Zircuit checks for both
quarantine
transaction using rpc call, and utilize existingdetectStuckTransactionsHeuristic
for potential overflow. ThefindBroadcastedAttempts
indetectStuckTransactionsHeuristic
can returns attempts with nil pointers that potentially cause panic.Changed the return type of
findBroadcastedAttempts
to be pointers and added nil pointer check.Reference:
https://chainlink-core.slack.com/archives/C06P81YRSN8/p1728379773038689