Skip to content

Commit

Permalink
Don't mark blocks as invalid on context deadlines (#14838)
Browse files Browse the repository at this point in the history
* Don't mark blocks as invalid on context deadlines

When processing state transition, if the error is because of a context
deadline, do not mark it as invalid.

* review

* fix changelog
  • Loading branch information
potuz authored Jan 31, 2025
1 parent bf81cd4 commit 4a487ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions beacon-chain/blockchain/receive_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ func (s *Service) validateStateTransition(ctx context.Context, preState state.Be
stateTransitionStartTime := time.Now()
postState, err := transition.ExecuteStateTransition(ctx, preState, signed)
if err != nil {
if ctx.Err() != nil {
return nil, err
}
return nil, invalidBlock{error: err}
}
stateTransitionProcessingTime.Observe(float64(time.Since(stateTransitionStartTime).Milliseconds()))
Expand Down
3 changes: 3 additions & 0 deletions changelog/potuz_invalid_context_deadlines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changed

- Do not mark blocks as invalid on context deadlines during state transition.

0 comments on commit 4a487ba

Please sign in to comment.