Skip to content

Re-send funding ETH tx if not executed in long time - #10

Merged
boqiu merged 2 commits into
mainfrom
resend-funding-tx
Jul 28, 2026
Merged

Re-send funding ETH tx if not executed in long time#10
boqiu merged 2 commits into
mainfrom
resend-funding-tx

Conversation

@boqiu

@boqiu boqiu commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This change is Reviewable

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.SendRawTransactionWithRetry and TxSender.WaitForReceipt to centralize raw-tx send retry and receipt polling logic.
  • Update TokenPay monitoring to wait for funding tx completion via waitForFundingTx, 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.

Comment thread service/token_pay.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 TransactionReceipt for 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

@boqiu
boqiu merged commit 375d651 into main Jul 28, 2026
2 checks passed
@boqiu
boqiu deleted the resend-funding-tx branch July 28, 2026 11:14
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.

2 participants