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

Resend a monitorTx with etherman when the first sendTx returns error #3687

Open
bylingo opened this issue Jun 5, 2024 · 1 comment
Open
Assignees

Comments

@bylingo
Copy link

bylingo commented Jun 5, 2024

Rationale

We have met a situation when the gasprice on L1 is too high (4000+ GWei on Sepolia), the first sendTx returns error because it costs too much ETH. However, neither the transaction will be sent again nor its status in DB is changed. Thus, this transaction get stucked. Because it is an verifiedBatches transaction, the following proof cannot be sent to L1.

Implementation

Maybe the failed transaction can be send again automatically if the first send returns error. It may need some modifications on ethtxmanager's sending routine.

@tclemos
Copy link
Contributor

tclemos commented Jun 5, 2024

This is the main reason the EthTxManager exists, and this is the default behavior; the TX should be sent again.

The EthTxManager monitors the transaction, and if a TX is not sent due to the price, it increases the price of the transaction and sends it again. It can also recover if the account runs out of gas and the TX gets reverted for this reason.

There are some configurations that are important in this process:

ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0

The resend cycle only ends when a transaction reaches the status Complete or Failed, while the transaction has the state Created or Sent, the EthTxManager will keep monitoring it and adjusting the gas and gasPrice accordingly to the network and configured parameters.

To help us understand what's happening, do you have more logs or information that you can share with us?

@tclemos tclemos self-assigned this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants