-
Notifications
You must be signed in to change notification settings - Fork 150
feat: update beacon content types to support Pectra #1801
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
6ce6ad7
to
40e7ba0
Compare
40e7ba0
to
56fc676
Compare
I am not sure I understand this reasoning as the HistoricalSummariesWithProof format isn't likely to change in the future past Electra. So |
Isn't Electra hitting mainnet on May 7th so in 3 days? Shouldn't we just remove support for I don't see a reason to add support for both types, when we will just be removing the old type on Wednesday, we might as only only support
|
I think we should just replace our current |
I did as suggested. It did cause complexity in refactoring tests. I removed BeaconState that we used for tests before and now I'm using test vector that I added in ethereum/portal-spec-tests#51. Also updated PR description |
Separate PR |
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.
Most of the PR looks good. I was am a little confused why we changed the code to encode the fork_digest using ssz, I thought we were supposed to should set it as the pre-fix. I didn't see anything in the PR description about there being a bug with how we did it before.
So I am a little confused? Maybe it encodes to the same output? Maybe I am missing something?
crates/ethportal-api/src/types/consensus/historical_summaries.rs
Outdated
Show resolved
Hide resolved
The ssz encoding and actual ForkDigest are the same, so it doesn't make a difference. I can see how it can easily cause confusion, so I removed it. |
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.
looks good
let fork_digest = ForkDigest::try_from(fork_digest_bytes) | ||
.map_err(|err| DecodeError::BytesInvalid(err.to_string()))?; | ||
let fork_name = match ForkName::try_from(fork_digest) { | ||
Ok(fork_name) => fork_name, | ||
Err(err) => return Err(DecodeError::BytesInvalid(err.to_string())), | ||
}; |
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 might be nice to be consistent with match
/map_err
usage here
What was wrong?
The Beacon content types should be updated in order to support Pectra.
See ethereum/portal-network-specs#397 for details.
How was it fixed?
Modified existing type to support Pectra.
I had to update and remove all usage of the old type. That involved rewriting tests (I also added more test cases), which was tricky at times we now have different test data (I updated
portal-spec-tests
submodule)Followup work
light-client
ortrin-beacon
crates)To-Do