Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 980d6b5

Browse files
authored
fix: update log so it says for what period are we rotating (#29)
1 parent 3dd7c41 commit 980d6b5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

chains/evm/listener/handlers/rotate.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func NewRotateHandler(
7272
// period and rotates the committee if it is
7373
func (h *RotateHandler) HandleEvents(checkpoint *apiv1.Finality) error {
7474
currentPeriod := uint64(checkpoint.Finalized.Epoch) / h.committeePeriodLength
75-
if currentPeriod < h.latestPeriod.Uint64() {
75+
if currentPeriod <= h.latestPeriod.Uint64() {
7676
return nil
7777
}
7878

@@ -94,7 +94,7 @@ func (h *RotateHandler) HandleEvents(checkpoint *apiv1.Finality) error {
9494
Spec: args.Spec,
9595
}
9696

97-
log.Info().Uint8("domainID", h.domainID).Uint64("period", targetPeriod.Uint64()).Msgf("Rotating committee")
97+
log.Info().Uint8("domainID", h.domainID).Uint64("period", targetPeriod.Uint64()+1).Msgf("Rotating committee")
9898

9999
rotateProof, err := h.prover.RotateProof(args)
100100
if err != nil {

chains/evm/listener/handlers/rotate_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (s *RotateHandlerTestSuite) Test_HandleEvents_ValidPeriod() {
9191

9292
err := s.handler.HandleEvents(&apiv1.Finality{
9393
Finalized: &phase0.Checkpoint{
94-
Epoch: phase0.Epoch(768),
94+
Epoch: phase0.Epoch(1024),
9595
},
9696
})
9797
s.Nil(err)

chains/evm/listener/handlers/step.go

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ func (h *StepEventHandler) HandleEvents(checkpoint *apiv1.Finality) error {
8181
return err
8282
}
8383

84+
log.Info().Uint8("domainID", h.domainID).Uint64("slot", args.Update.FinalizedHeader.Header.Slot).Msgf("Executing sync step")
85+
8486
proof, err := h.prover.StepProof(args)
8587
if err != nil {
8688
return err

0 commit comments

Comments
 (0)