Skip to content

Conversation

@ltitanb
Copy link
Collaborator

@ltitanb ltitanb commented Feb 19, 2025

new electra PR based on #257 from @JasonVranek

@ltitanb ltitanb changed the title feat: electra support feat(pbs): electra support Feb 19, 2025
Copy link

@eserilev eserilev left a comment

Choose a reason for hiding this comment

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

In general I think this looks fine. I tried to pay special attention to electra specific changes

As you mentioned in a previous comment, much of the fork variant complexity can be refactored in a future PR.

type MaxAttestations = typenum::U128;

// Ignore Electra
type MaxValidatorsPerSlot = typenum::U0;
Copy link

@eserilev eserilev Feb 19, 2025

Choose a reason for hiding this comment

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

nit: I'm pretty sure this doesn't matter pre-electra but technically MaxValidatorsPerSlot should still be U131072 (i.e. MaxValidatorsPerCommittee * MaxCommitteesPerSlot) pre-electra

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in 061966b

Comment on lines +34 to +38
pub enum VersionedResponse<D, E> {
#[serde(rename = "deneb")]
Deneb(D),
#[serde(rename = "electra")]
Electra(E),
Copy link

@eserilev eserilev Feb 19, 2025

Choose a reason for hiding this comment

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

In a future refactor we should be able to revert to the previous VersionedResponse struct definition

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep fair point, my thinking here would be that in this case i can be sure that the version field matches with the correct payload. Although probably could have also had a simple validate check for this tbh. After pectra I'm leaning towards removing all the deneb specific code to avoid cluttering types

}

fn extra_validation(
fn extra_validation_deneb(
Copy link

@eserilev eserilev Feb 19, 2025

Choose a reason for hiding this comment

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

nit: is this validation actually deneb specific?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, had changed in a previous refactor. Fixed in 061966b

@ltitanb ltitanb merged commit c74421f into main Feb 20, 2025
5 checks passed
@ltitanb ltitanb deleted the ltitanb/electra_support branch February 20, 2025 10:22
@ltitanb ltitanb mentioned this pull request Mar 24, 2025
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.

3 participants