Re-send funding ETH tx if not executed in long time - #10
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds resilience to the TokenPay sponsorship flow by monitoring the funding ETH transaction and re-sending it with a higher gas price if it isn’t executed for an extended period, plus factoring common tx utilities into TxSender.
Changes:
- Introduce
TxSender.SendRawTransactionWithRetryandTxSender.WaitForReceiptto centralize raw-tx send retry and receipt polling logic. - Update
TokenPaymonitoring to wait for funding tx completion viawaitForFundingTx, including periodic re-send with increased gas price. - Improve TokenPay logging consistency by reusing a module-scoped logger entry across the async monitor flow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| service/tx_sender.go | Adds reusable raw-tx retry send and receipt polling helpers used by services. |
| service/token_pay.go | Adds funding-tx monitoring with gas-price bump re-send strategy and updates monitor flow to use shared TxSender helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
service/token_pay.go:273
- After the nonce advances, the code does a single pass over
TransactionReceiptfor each hash and immediately fails if receipts aren’t available yet. On some nodes there can be a short lag between the nonce updating (tx mined) and the receipt being retrievable, which can cause false failures even though the funding tx succeeded.
for _, v := range txs {
if receipt, err = tp.client.Eth.TransactionReceipt(v); err != nil {
logger.WithError(err).WithField("txHash", v).Info("Failed to get receipt of funding ETH tx")
} else if receipt != nil {
break
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is