-
Notifications
You must be signed in to change notification settings - Fork 63
fix(l1): add deposit request layout validations + return invalid deposit request error #2832
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
Conversation
Lines of code reportTotal lines added: Detailed view
|
@@ -17,6 +20,11 @@ const DEPOSIT_TYPE: u8 = 0x00; | |||
const WITHDRAWAL_TYPE: u8 = 0x01; | |||
const CONSOLIDATION_TYPE: u8 = 0x02; | |||
|
|||
lazy_static! { | |||
static ref DEPOSIT_TOPIC: H256 = | |||
H256::from_str("649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5").unwrap(); |
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.
Do we want to have these constants in a centralized place like https://github.com/lambdaclass/ethrex/blob/main/crates/common/constants.rs ?
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.
It is something specific to requests so I don't think we will be using it anywhere else to warrant it being centralized
Motivation
Currently, when we fail to parse a deposit request we simply ignore it and keep the rest of the deposits, relying on the request hash check afterwards to notice the missing deposit request. This PR handles the error earlier and returns the appropriate
InvalidDepositRequest Error
. This will provide better debugging information and also more accurate testing via tools such asexecution-spec-tests
which rely on specific error returns.We also were not correctly validating the layout according to the EIP, as we were only checking the total size and not the size and offset of each request field
Description
Allows us to address review comment made on execution-specs-test PR ethereum/execution-spec-tests#1607 + also closes #2132