-
Notifications
You must be signed in to change notification settings - Fork 288
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
Implemented decoding and hash rules for execution requests #8668
Implemented decoding and hash rules for execution requests #8668
Conversation
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.
lgtm with a question
.../pegasys/teku/spec/datastructures/execution/versions/electra/ExecutionRequestsDataCodec.java
Outdated
Show resolved
Hide resolved
/* | ||
https://eips.ethereum.org/EIPS/eip-7251 | ||
*/ |
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.
if we do need this comment at all, maybe single line?
switch (type) { | ||
case DepositRequest.REQUEST_TYPE: | ||
// https://eips.ethereum.org/EIPS/eip-6110 | ||
executionRequestsBuilder.deposits( | ||
executionRequestsSchema | ||
.getDepositRequestsSchema() | ||
.sszDeserialize(data.slice(1)) | ||
.asList()); | ||
break; | ||
case WithdrawalRequest.REQUEST_TYPE: | ||
// https://eips.ethereum.org/EIPS/eip-7002 | ||
executionRequestsBuilder.withdrawals( | ||
executionRequestsSchema | ||
.getWithdrawalRequestsSchema() | ||
.sszDeserialize(data.slice(1)) | ||
.asList()); | ||
break; | ||
case ConsolidationRequest.REQUEST_TYPE: | ||
// https://eips.ethereum.org/EIPS/eip-7251 | ||
executionRequestsBuilder.consolidations( | ||
executionRequestsSchema | ||
.getConsolidationRequestsSchema() | ||
.sszDeserialize(data.slice(1)) | ||
.asList()); | ||
break; |
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.
nit: new syntax for case statements?
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.
LGTM just nits
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.
LGTM! 👍
9428759
to
3daf1a8
Compare
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.
LGTM. I think it makes sense to statically initialize these: Bytes.of(DepositRequest.REQUEST_TYPE)
(maybe can turn those into enum not sure) to avoid creating all the time Bytes single byte instance.
2d138c5
to
68567dc
Compare
PR Description
Implementing the rules for decoding and hashing execution requests according to ethereum/execution-apis#591
Fixed Issue(s)
part of #8620
Documentation
doc-change-required
label to this PR if updates are required.Changelog