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: use maximum possible data fee for 4844 balance checks #981

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

Rjected
Copy link
Collaborator

@Rjected Rjected commented Jan 16, 2024

ref paradigmxyz/reth#6077

The balance checks shown in EIP-4844 use the maximum possible blob fee:

        # modify the check for sufficient balance
        max_total_fee = tx.gas * tx.max_fee_per_gas
        if get_tx_type(tx) == BLOB_TX_TYPE:
            max_total_fee += get_total_blob_gas(tx) * tx.max_fee_per_blob_gas
        assert signer(tx).balance >= max_total_fee

This implements what is written in the spec, introducing a new method calc_max_data_fee to calculate get_total_blob_gas(tx) * tx.max_fee_per_blob_gas

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

lgtm, we should backport this to reth_freeze branch

@rakita rakita merged commit 9d42562 into bluealloy:main Jan 16, 2024
23 checks passed
rakita pushed a commit that referenced this pull request Jan 16, 2024
* fix: use maximum possible data fee for 4844 balance checks

* fix docs

* use unwrap_or_default to cover non-blob txs
@github-actions github-actions bot mentioned this pull request Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hf-cancun Cancun hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants