-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
validate EOF bytecode on Genesis. #10172
Comments
Hello @rakita Can I help with this one? |
Go for it |
Hello @rakita can you give me more context about this? Is a validation that needs to be moved from to a different function? |
Comment for interests |
Hey @danielcdz any updates on your progress here? Happy to take over if you haven't been able to get around to it |
Hello! @emnul I definitely need some help here, can you provide me more context about the issue? |
I think this will help https://github.com/ipsilon/eof/blob/main/spec/eof.md. Although, I'm not sure what "Genesis" refers to in description here. I would reach out to the telegram or open a discussion for more information / clarification. This is the function that's referred to in the description https://github.com/bluealloy/revm/blob/1ad860469755e3cf71383f45d71c3faaf61d3029/crates/interpreter/src/interpreter/analysis.rs#L75 |
@emnul thank you! do yo have the link to the telegram? |
Check the README.md file |
The genesis file in the description refers to the It's possible to define smart contracts in the genesis block (src). If there are EVM Object Format bytecodes in the Genesis file they should be validated so that only valid EOF bytecodes are found in the state. |
Hey @rakita is this not already validated on this line? Bytecode::new_raw has EOF validation built-in. Or was the intention here to perform validation in the ChainSpecBuilder or somewhere else? Please clarify |
Hey, was on vacation last week. This looks like a good place but the function that needs to be called is |
Gotcha, so to be clear, @danielcdz should modify the insert_state function in reth/crates/storage/db-common/src/init.rs to use |
@danielcdz feel free to reach out if you run into any other blockers. |
Thanks all,I also understand. |
Hey @emnul I opened a PR for this, I don't know if it is good at all, but I would appreciate it if you take a look and provide feedback. |
Describe the feature
If there ar EOF bytecodes in the Genesis file we should validate those bytes so that only valid EOF bytecodes are found in the state.
The function is found in
use revm::interpreter::analysis::validate_raw_eof_inner
and it needs to beCodeType::ReturnOrStop
type (Will renaming it toContainerKind::Runtime
)Additional context
It does not affect mainnet, it is a guard for new chains that have EOF enabled from the start.
The text was updated successfully, but these errors were encountered: