Skip to content

Conversation

@mattsse
Copy link
Contributor

@mattsse mattsse commented May 21, 2025

migrates to latest reth 1.4.3

this includes a few breaking changes around the executor/evm type and some internal revm changes.

there's only one thing I'm not entirely sure of of which is the deduct_caller change, which I need to double check.

we also swapped out the EthPrecompiles type to a more flexible PrecompilesMap

BlobScheduleBlobParams {
cancun: CANCUN_BLOB_PARAMS,
prague: PRAGUE_BLOB_PARAMS,
osaka: PRAGUE_BLOB_PARAMS,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assigned the prague blob params here for now,

this entire thing is subject to change as the format is still wip

let components = |spec: Arc<C::ChainSpec>| {
(
GnosisExecutorProvider::new(spec.clone()),
GnosisEvmConfig::new(spec.clone()),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in 1.4 the ExecutorProvider was unified with EvmConfig

Comment on lines +157 to +158
Commands::ImportEra(_) => unimplemented!(),
Commands::Download(_) => unimplemented!(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are new wip commands for era import /pre-merge history expiry


#[allow(missing_debug_implementations)] // missing revm::Context Debug impl
pub struct GnosisEvm<DB: Database, I, PRECOMPILE = EthPrecompiles> {
pub struct GnosisEvm<DB: Database, I, PRECOMPILE = PrecompilesMap> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just a different representation of the precompiles


/// Provides a mutable reference to the EVM inspector.
pub fn inspector_mut(&mut self) -> &mut I {
&mut self.inner.0.data.inspector
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this layer has been flattened

Comment on lines +105 to +106
type Precompiles = PRECOMPILE;
type Inspector = I;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are additional AT that allow us to access this via the trait directly

Comment on lines 51 to 55
fn validate_against_state_and_deduct_caller(
&self,
evm: &mut Self::Evm,
) -> Result<(), Self::Error> {
// TODO: is this equivalent to pre_execution::validate_against_state_and_deduct_caller(evm.ctx())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this replaced deduct_caller but I'm not sure if this here is equivalent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rakita how to migrate this from fn deduct_caller

Copy link

Choose a reason for hiding this comment

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

It merges two function validate_agains_state and deduct_caller

We should call pre_execution::validate_against_state_and_deduct_caller(evm.ctx()) from revm here

And add gnosis specific code after it

// GNOSIS-SPECIFIC // START
let spec: SpecId = context.cfg().spec().into();
if spec.is_enabled_in(SpecId::PRAGUE) {
let fee_collector_account = context.journal().load_account(fee_collector)?.data;
// Set new fee collector account balance.
fee_collector_account.info.balance = fee_collector_account
.info
.balance
.saturating_add(U256::from(blob_gas_cost));
// Touch account so we know it is changed.
fee_collector_account.mark_touch();
}
// GNOSIS-SPECIFIC // END

Copy link
Member

Choose a reason for hiding this comment

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

made this change

@debjit-bw debjit-bw requested a review from dapplion May 28, 2025 09:39
Copy link
Member

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

LGTM

@debjit-bw debjit-bw merged commit e76f50f into gnosischain:master May 28, 2025
7 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.

4 participants