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

Implemented decoding and hash rules for execution requests #8668

Merged

Conversation

lucassaldanha
Copy link
Member

PR Description

Implementing the rules for decoding and hashing execution requests according to ethereum/execution-apis#591

Fixed Issue(s)

part of #8620

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@lucassaldanha lucassaldanha requested a review from mkalinin October 2, 2024 04:22
Copy link
Contributor

@gfukushima gfukushima left a 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

Comment on lines 23 to 25
/*
https://eips.ethereum.org/EIPS/eip-7251
*/
Copy link
Contributor

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?

Comment on lines 44 to 68
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;
Copy link
Contributor

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?

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM just nits

Copy link

@mkalinin mkalinin left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@lucassaldanha lucassaldanha force-pushed the electra-requests-codec branch from 9428759 to 3daf1a8 Compare October 8, 2024 04:47
@lucassaldanha lucassaldanha requested a review from mkalinin October 8, 2024 04:48
Copy link
Contributor

@StefanBratanov StefanBratanov left a 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.

@lucassaldanha lucassaldanha force-pushed the electra-requests-codec branch from 2d138c5 to 68567dc Compare October 8, 2024 07:24
@lucassaldanha lucassaldanha enabled auto-merge (squash) October 8, 2024 07:24
@lucassaldanha lucassaldanha merged commit be4f9b7 into Consensys:master Oct 8, 2024
16 of 17 checks passed
@lucassaldanha lucassaldanha deleted the electra-requests-codec branch October 8, 2024 07:47
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.

5 participants