Skip to content

feat(spec-tests): typing & ssz infrastructure #416

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

Open
wants to merge 10 commits into
base: spec-tests
Choose a base branch
from

Conversation

Zacholme7
Copy link
Member

@Zacholme7 Zacholme7 commented Jul 8, 2025

Issue Addressed

This contains all parsing logic, ssz typing, and tree hashing needed for the current state of the spec tests. Contains the logic from #377 alongside some additions

Copy link

mergify bot commented Jul 8, 2025

This pull request has merge conflicts. Could you please resolve them @Zacholme7? 🙏

@mergify mergify bot added waiting-on-author and removed ready-for-review This PR is ready to be reviewed labels Jul 8, 2025
@mergify mergify bot added ready-for-review This PR is ready to be reviewed and removed waiting-on-author labels Jul 9, 2025
Copy link

mergify bot commented Jul 9, 2025

This pull request has merge conflicts. Could you please resolve them @Zacholme7? 🙏

@mergify mergify bot added waiting-on-author and removed ready-for-review This PR is ready to be reviewed labels Jul 9, 2025
@mergify mergify bot added ready-for-review This PR is ready to be reviewed and removed waiting-on-author labels Jul 14, 2025
Copy link
Member

@dknopik dknopik left a comment

Choose a reason for hiding this comment

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

Nice! A few remarks, but otherwise I think this should go in soon to get a lot of testing in this release cycle.

Comment on lines -26 to 49
impl TryFrom<u64> for PartialSignatureKind {
type Error = ();

fn try_from(value: u64) -> Result<Self, Self::Error> {
impl From<u64> for PartialSignatureKind {
fn from(value: u64) -> Self {
match value {
0 => Ok(PartialSignatureKind::PostConsensus),
1 => Ok(PartialSignatureKind::RandaoPartialSig),
2 => Ok(PartialSignatureKind::SelectionProofPartialSig),
3 => Ok(PartialSignatureKind::ContributionProofs),
4 => Ok(PartialSignatureKind::ValidatorRegistration),
5 => Ok(PartialSignatureKind::VoluntaryExit),
_ => Err(()),
0 => PartialSignatureKind::PostConsensus,
1 => PartialSignatureKind::RandaoPartialSig,
2 => PartialSignatureKind::SelectionProofPartialSig,
3 => PartialSignatureKind::ContributionProofs,
4 => PartialSignatureKind::ValidatorRegistration,
5 => PartialSignatureKind::VoluntaryExit,
_ => panic!("Invalid PartialSignatureKind value: {value}"),
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Why is this change necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

To derive Deserialize on the PartialSignatureKind for reading in the test files it requires From not TryFrom

@dknopik dknopik added waiting-on-author and removed ready-for-review This PR is ready to be reviewed labels Jul 15, 2025
@Zacholme7 Zacholme7 changed the title Typing infrastructure for spec tests feat(spec-tests): typing & ssz infrastructure Jul 21, 2025
@Zacholme7 Zacholme7 changed the base branch from unstable to spec-tests July 28, 2025 12:47
@Zacholme7 Zacholme7 requested a review from dknopik July 28, 2025 14:40
@Zacholme7
Copy link
Member Author

Zacholme7 commented Jul 28, 2025

Did some cleanup and I think this is in a mergable place now. Merging into new spec-test branch, not unstable that I will keep up to date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants