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

chore: change requests to flat encoding #1378

Closed
wants to merge 1 commit into from
Closed

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Sep 26, 2024

Motivation

In devnet 4, the current request encoding scheme is replaced with a flat encoding scheme, i.e. no rlp involved.

The request payloads (i.e. bytes following the request type byte) are now encoded as follows:

  • EIP-7251: source_address ++ source_pubkey ++ target_pubkey
  • EIP-7002: source_address ++ validator_pubkey ++ amount
  • EIP-6110: pubkey ++ withdrawal_credentials ++ amount ++ signature ++ index

Solution

I decided to simply implement Encodable7685 and Decodable7685 for each request type, and for the Request enum wrapper in alloy-consensus, I defer to these implementations.

Closes #1338

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@onbjerg onbjerg added the enhancement New feature or request label Sep 26, 2024
@onbjerg
Copy link
Member Author

onbjerg commented Sep 26, 2024

Please do not merge this upon approval, I'd like to merge the devnet 4 PRs in one go when necessary.

@onbjerg
Copy link
Member Author

onbjerg commented Oct 17, 2024

Putting this back in draft since the encoding changed yet again (and pretty significantly).

@onbjerg onbjerg marked this pull request as draft October 17, 2024 17:41
@onbjerg onbjerg closed this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Change request encodings to flat encoding
1 participant