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

Added logic changes and CI test for pectra #53

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

debjit-bw
Copy link
Member

@debjit-bw debjit-bw commented Mar 4, 2025

Changes

The core logic changes for Pectra are limited to gnosis.rs, execute.rs and payload.rs. On EVM side, they include additions of deposit, withdrawal and consolidation requests to the requests field (following upstream).

The Gnosis-specific change would be the fee-accounting for blob transactions. Reth doesn't provide an evm hook for the blob fee like it does for base fee. Therefore we need to separately add the blob fee used to the fee collector. We do it as part of the post block processing. We calculate the blob fee after the block execution or after payload building and send the value in apply_post_block_system_calls. Internally, it adds the value to the increment_balances hashmap for post-pectra blocks.

This PR also includes a pectra version for EIP4844 test, which is exactly similar to the cancun version, except the blob tx is sent at a timestamp later than pectra. We also add this test to CI.

@debjit-bw debjit-bw marked this pull request as ready for review March 4, 2025 19:04
@debjit-bw debjit-bw requested a review from dapplion March 4, 2025 19:04
@debjit-bw debjit-bw changed the title logic changes for pectra Added logic changes and CI test for pectra Mar 4, 2025
Base automatically changed from cancun-blob-vectors to master March 6, 2025 10:31
&self.chain_spec,
self.block_rewards_contract,
block.timestamp,
block.body().withdrawals.as_ref(),
block.beneficiary,
&mut evm,
blob_fee_to_refund,
Copy link
Member

@dapplion dapplion Mar 6, 2025

Choose a reason for hiding this comment

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

This is not really a system call, why not just do the addition into the map here after apply_post_block_system_calls call?

Copy link
Member Author

Choose a reason for hiding this comment

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

i want all the gnosis-specific stuff to be inside the gnosis.rs file, would renaming the function apply_post_block_system_calls be better?

.config
.extra_fields
.get("eip1559collector")
.expect("no eip1559collector field");
Copy link
Member

Choose a reason for hiding this comment

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

Config issues are expected and should not panic. You should parse this field at startup and store it in the GnosisExecutionStrategy or EvmConfig, and be infallible here

blob_gas_used * blob_gasprice
} else {
0
};
Copy link
Member

Choose a reason for hiding this comment

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

The logic

if prage { collect } else { not }

is duplicated once, dedup. Also it's not a refund, it's a collection since it goes to a different party

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.

2 participants