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

faucet: bump and resend faucet transaction if it has been pending for a while #2665

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

zzzckck
Copy link
Collaborator

@zzzckck zzzckck commented Aug 26, 2024

Description

The faucet service is not stable, sometimes it got stuck for quite a long time and can only be recovered by restarting the process.
After some investigation, found it could be caused by transaction lost, there are various cases that a transaction can be dropped, such as network issue or discarded when TxPool is full. One lost transaction could cause the stuck of faucet service, due to the nonce gap issue.
This PR will check for each new imported block, if the faucet transaction got stuck for a certain time, trigger a resend operation, so it will not block the faucet service.

Rationale

NA

Example

NA

Changes

NA

@zzzckck zzzckck force-pushed the faucet_debug branch 2 times, most recently from 59ca828 to 47b77bc Compare August 26, 2024 04:24
one lost faucet transaction could bring down the faucet service, due
to the nonce gap issue, it has to be recovered by restart the service

introduce the resend logic to fix it, i.e. once the pending faucet transaction has
been pending for a certain time(15seconds), resend it with a higher(bump 20%) gasPrice.
@zzzckck zzzckck changed the title faucet: resend faucet transaction if it is not include for a while faucet: resend faucet transaction if it is not included for a while Aug 26, 2024
@zzzckck zzzckck changed the title faucet: resend faucet transaction if it is not included for a while faucet: bump and resend faucet transaction if it has been pending for a while Aug 26, 2024
zlacfzy
zlacfzy previously approved these changes Aug 26, 2024
cmd/faucet/faucet.go Outdated Show resolved Hide resolved
MatusKysel
MatusKysel previously approved these changes Aug 26, 2024
@zzzckck zzzckck dismissed stale reviews from MatusKysel and zlacfzy via aacdc53 August 26, 2024 07:32
@zzzckck zzzckck merged commit af0204b into bnb-chain:develop Aug 26, 2024
7 checks passed
@zzzckck zzzckck deleted the faucet_debug branch August 28, 2024 08:05
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.

5 participants