-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
Conversation
&self.chain_spec, | ||
self.block_rewards_contract, | ||
block.timestamp, | ||
block.body().withdrawals.as_ref(), | ||
block.beneficiary, | ||
&mut evm, | ||
blob_fee_to_refund, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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 | ||
}; |
There was a problem hiding this comment.
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
Changes
The core logic changes for Pectra are limited to
gnosis.rs
,execute.rs
andpayload.rs
. On EVM side, they include additions of deposit, withdrawal and consolidation requests to therequests
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 theincrement_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.