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

fix(anvil): tx.gas_price() return val #7876

Merged
merged 2 commits into from
May 7, 2024

Conversation

yash-atreya
Copy link
Collaborator

@yash-atreya yash-atreya commented May 6, 2024

Motivation

When a tx is sent, upon validation we are checking the tx.gas_price() against the block.basefee. The value returned from tx.gas_price() is max_fee_per_blob_gas in case of a 4844 tx, which would more often than not be less than that of 1559 basefee, especially on startup.

This would cause the transaction to be failed with error InvalidTransactionError::FeeCapTooLow even though max_fee_per_gas would have been set correctly.

Solution

Check which type of tx is incoming and associate gas_price correctly.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

The value returned from tx.gas_price() is max_fee_per_blob_gas in case of a 4844 tx

this sounds wrong, imo this is the issue gas price should return the gas price or 1559 max fee

@yash-atreya yash-atreya requested a review from mattsse May 7, 2024 15:29
@yash-atreya yash-atreya changed the title fix(anvil): cmp 1559 fees with basefee in 4844 tx not blobfee fix(anvil): tx.gas_price() return val May 7, 2024
@mattsse mattsse merged commit 58c0c00 into foundry-rs:master May 7, 2024
19 checks passed
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.

None yet

2 participants