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

feat: Eip1559 params in extradata #11887

Merged
merged 26 commits into from
Oct 30, 2024

Conversation

cody-wang-cb
Copy link
Contributor

Part of Holocene changes to add EIP1559 params to payload, and using the extradata field in block header to store the value.

Spec: https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/holocene/exec-engine.md

@onbjerg onbjerg changed the title Eip1559 params in extradata feat: Eip1559 params in extradata Oct 19, 2024
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

good start, left some comments

crates/optimism/chainspec/src/lib.rs Outdated Show resolved Hide resolved
crates/optimism/chainspec/src/lib.rs Outdated Show resolved Hide resolved
crates/optimism/node/src/engine.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/ethereum/engine-primitives/src/payload.rs Outdated Show resolved Hide resolved
@cody-wang-cb
Copy link
Contributor Author

Addressed comments, PTAL again @Rjected @clabby

Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

almost there, some more comments about the panics

crates/optimism/chainspec/src/lib.rs Outdated Show resolved Hide resolved
crates/optimism/chainspec/src/lib.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
@cody-wang-cb
Copy link
Contributor Author

@Rjected @clabby @mattsse can I get another round of review for this? Also have a question above in one of the review comments

Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

I have some more comments, almost there, definitely ping me for another review / if you have any more questions

crates/optimism/chainspec/src/lib.rs Outdated Show resolved Hide resolved
crates/optimism/node/src/engine.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
@cody-wang-cb
Copy link
Contributor Author

@Rjected PTAL again, removed all panic/unwrap().

Also I can't seem to run the wasm check locally. For example running cargo +stable build -p reth-evm --target wasm32-wasip1 --no-default-features I always get

error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-wasip1` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-wasip1`

error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-wasip1` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-wasip1`

But running the suggested command is not helpful.

};
let (elasticity, denominator) = decode_eip_1559_params(eip_1559_params)
.map_err(|e| EngineObjectValidationError::InvalidParams(e.to_string().into()))?;
if elasticity != 0 && denominator == 0 {
Copy link

Choose a reason for hiding this comment

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

I don't see test coverage of this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Rjected Rjected force-pushed the cody/eip1559-params-extradata branch from c1439bd to a2524ca Compare October 28, 2024 21:05
@Rjected Rjected force-pushed the cody/eip1559-params-extradata branch from 2058605 to 878c888 Compare October 28, 2024 21:37
@Rjected Rjected added C-enhancement New feature or request A-op-reth Related to Optimism and op-reth A-consensus Related to the consensus engine labels Oct 28, 2024
@cody-wang-cb
Copy link
Contributor Author

Looks like all the checks pass now (thanks to @Rjected !)
Can I get final reviews from others and see if everything looks good? @tynes @clabby @mattsse

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

only nits

@@ -192,7 +195,7 @@ pub trait ConfigureEvmEnv: Send + Sync + Unpin + Clone + 'static {
&self,
parent: &Self::Header,
attributes: NextBlockEnvAttributes,
) -> (CfgEnvWithHandlerCfg, BlockEnv);
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), Self::Error>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

imo this is reasonable

crates/optimism/chainspec/src/lib.rs Outdated Show resolved Hide resolved
crates/optimism/payload/src/builder.rs Outdated Show resolved Hide resolved
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@mattsse mattsse 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 can upstream some of this to op-alloy

@mattsse mattsse added this pull request to the merge queue Oct 30, 2024
Merged via the queue into paradigmxyz:main with commit 93a9b8a Oct 30, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine A-op-reth Related to Optimism and op-reth C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants