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

Node not rejecting txs with gas price less than 25 Gwei #291

Open
kamikazechaser opened this issue Dec 5, 2024 · 2 comments · May be fixed by #292
Open

Node not rejecting txs with gas price less than 25 Gwei #291

kamikazechaser opened this issue Dec 5, 2024 · 2 comments · May be fixed by #292
Assignees

Comments

@kamikazechaser
Copy link

Details

  • Chain: Alfajores
  • Version: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/op-geth:celo8
  • No additional flags aside from what is documented on the docs my config is here

Description

It is possible to submit type 2 transactions with a gasFeeCap of < 25 Gwei. This transaction will never be mined. I would expect it to be rejected at the RPC level or dropped in the tx pool. Neither of which happens. Inspecting the local txpool shows it is empty, but resubmitting the raw tx on the local or any other node results in "already known".

Steps to reproduce

I used cast:

$ export ETH_RPC_URL=
$ cast nonce $ADDRESS
# 137
$  cast mktx --nonce 137 --gas-limit 21000 --gas-price 10gwei --priority-gas-price 10wei --private-key $PRIVATE_KEY 0x5523058cdFfe5F3c1EaDADD5015E55C6E00fb439 --value 1wei
# returns raw transaction hash
$ cast p $RAW_TRANSACTION
# Submission is successful, no error returned here, it will just wait forever forever to be mined. --async can be used to return immidiately.
$ cast decode-transactions $RAW_TRANSACTION
# Tx details
$ cast tx $TX_HASH
# Not found (never mined)
$ cast p $RAW_TX_HASH
# "already known"

On op-geth local node:

# Attach to IPC
> txpool.inspect
{
  pending: {},
  queued: {}
}

I'd expect it to show up here because of the "already known". This could be another issue.

Bumping the gasFeeCap fixes this, and resubmitting results in it being mined:

# 35 Gwei
$  cast mktx --nonce 137 --gas-limit 21000 --gas-price 35gwei --priority-gas-price 10wei --private-key $PRIVATE_KEY 0x5523058cdFfe5F3c1EaDADD5015E55C6E00fb439 --value 1wei

Expected behaviour

The issue I have is that there is no way to know the status of the tx submitted with the low gas price. Ideally such a transaction is rejected immediately during submission because Celo is aware of the fee floor. On the current Celo mainnet, attempting to send a tx with a low gas price results in an immidiate error: gasprice is less than gas price minimum floor

@carterqw2 carterqw2 added this to the 5 - Celo MVP Mainnet milestone Dec 5, 2024
@kamikazechaser
Copy link
Author

kamikazechaser commented Dec 5, 2024

I checked the Validation code

return fmt.Errorf("%w: gas tip cap %v, minimum needed %v", ErrUnderpriced, tx.GasTipCap(), opts.MinTip)
and it just checks the gas tip (Which isn't very useful in Celo). I think a check against the header baseFee which I presume is set by eip1559.CalcBaseFee (which sets the floor to 25 Gwei) should suffice?

@ezdac ezdac self-assigned this Dec 5, 2024
ezdac added a commit that referenced this issue Dec 5, 2024
Fixes #291

Before, the transaction pool accepted transactions that have a
gas-price below the configured base-fee-floor, which would never be
executed.

Now, the transaction pool rejects those transactions immediately -
giving the submitting user an immediate response and better UX.
@ezdac
Copy link

ezdac commented Dec 5, 2024

Hey @kamikazechaser - thank you for your contribution, this is much appreciated.

You are right, since the transaction would never be able to be executed, rejecting it from txpool insertion is the right thing to do and increases the UX.
Checking it against the header base-fee would be overly permissive though, since the base-fee can be above the base-fee-floor and the transaction would have a chance to be executed once the base-fee drops.

The empty txpool is another good point - I would also expect it to be reflected in the local txpool list, but let me investigate this.

ezdac added a commit that referenced this issue Dec 6, 2024
Fixes #291

Before, the transaction pool accepted transactions that have a
gas-price below the configured base-fee-floor, which would never be
executed.

Now, the transaction pool rejects those transactions immediately -
giving the submitting user an immediate response and better UX.
ezdac added a commit that referenced this issue Dec 20, 2024
Fixes #291

Before, the transaction pool accepted transactions that have a
gas-price below the configured base-fee-floor, which would never be
executed.

Now, the transaction pool rejects those transactions immediately -
giving the submitting user an immediate response and better UX.
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 a pull request may close this issue.

3 participants