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

missed adding electra process epoch on state replay - devnet 1 #14272

Merged
merged 11 commits into from
Jul 30, 2024

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Jul 29, 2024

What type of PR is this?

Other

What does this PR do? Why is it needed?

The core logic of process slots was duplicated in the replay function,so we forgot to update epoch processing in the replay function for the electra process slot. This PR refactors the core logic to be reusable and adds the corrected electra process epoch

Which issues(s) does this PR fix?

Fixes #

Other notes for review

@james-prysm james-prysm added the Electra electra hardfork label Jul 29, 2024
}
} else if err != nil {
return nil, err
}
defer func() {
SkipSlotCache.MarkNotInProgress(key)
}()

for state.Slot() < slot {
customErrFn := func(ctx context.Context, st state.BeaconState) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

reviewer please carefully look at the use of this function and let me know if this works well for our usecase

@james-prysm james-prysm marked this pull request as ready for review July 30, 2024 19:31
@james-prysm james-prysm requested a review from a team as a code owner July 30, 2024 19:31
func ProcessEpoch(ctx context.Context, state state.BeaconState) (state.BeaconState, error) {
var err error
if time.CanProcessEpoch(state) {
if state.Version() == version.Phase0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we switch the order of these ones?

Comment on lines +264 to +265
if fn != nil {
if err = fn(ctx, state); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if fn != nil {
if err = fn(ctx, state); err != nil {
if fn != nil && (err = fn(ctx, state)) != nil {

@@ -231,42 +222,63 @@ func ProcessSlots(ctx context.Context, state state.BeaconState, slot primitives.
defer func() {
SkipSlotCache.MarkNotInProgress(key)
}()
state, err = ProcessSlotsCore(ctx, span, state, slot, cacheBestBeaconStateOnErrFn(highestSlot, key))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

please look at the use of cacheBestBeaconStateOnErrFn carefully

@james-prysm james-prysm added this pull request to the merge queue Jul 30, 2024
Merged via the queue into develop with commit 52c036c Jul 30, 2024
16 of 17 checks passed
@james-prysm james-prysm deleted the electra-replay-process-miss branch July 30, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electra electra hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants