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

wip: better custom evm abstraction #843

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

zobront
Copy link
Contributor

@zobront zobront commented Nov 26, 2024

addresses #839

to do:

  • redo Executor w ConfigureEvmEnv abstraction
  • new ExecutorBuilder
  • DefaultEvmConfig impl of ConfigureEvmEnv
  • get rest of kona native compiling with these changes
  • fix dependencies to ensure cannon & asterisc can compile
  • add CI checks on Reth side for all imported dependencies
  • tests passing, addl test on customized chain

@clabby
Copy link
Collaborator

clabby commented Nov 26, 2024

I'm a fan of the direction of this. If the reth dependency is removed in favor of these traits being upstreamed in alloy, down to merge!

Comment on lines +123 to +125
// ZTODO: Use custom chainspec here, not defaulting to OP Mainnet
Arc::new(OpChainSpecBuilder::optimism_mainnet().build()),
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@clabby Is this client only for OP Mainnet (ie is this safe) or should it work for any chain that uses FPVM? If the latter, I'll construct ChainSpec out of data in the RollupConfig.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It should work for any chain with a RollupConfig, yep!

timestamp: u64,
block_number: u64,
parent_beacon_block_root: Option<B256>,
evm: &mut Evm<'_, (), &mut State<&mut TrieDB<F, H>>>,
// ZTODO: understand default external context better, is it ok to allow any here?
evm: &mut Evm<'_, C::DefaultExternalContext<'_>, &mut State<&mut TrieDB<F, H>>>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@clabby I think this change is fine to allow the Evm to be parameterized by any DefaultExternalContext rather than forcing it to be (). Do you see any problem with that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is all good. Right now the enforcement on () limits a degree of freedom that consumers might want.

.modify()
.with_tx_env(Self::prepare_tx_env(&transaction, raw_transaction)?)
.build();
let reth_tx = TransactionSigned::decode_2718(&mut raw_transaction).map_err(ExecutorError::RLPError)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@clabby This decoding is failing in the tests. Having trouble figuring out why. If you have any instincts, I'd love your input as I keep digging.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Likely because some of these txs are deposits. I assume TransactionSigned may not support the deposit (0x7e) variant, given that no features are enabled for reth-primitives.

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