Skip to content

Commit

Permalink
verbose logging in checkpoint manager
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott committed Mar 13, 2024
1 parent 608ad3e commit 099023e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions consensus/polybft/checkpoint_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ func (c *checkpointManager) PostBlock(req *PostBlockRequest) error {
if err != nil {
return fmt.Errorf("could not get last processed block for exit events. Error: %w", err)
}
c.logger.Info("[checkPointManager] read last block", "block", lastBlock)

if lastBlock == 0 {
// if we are running in a forked context here we need to make sure that we update the last block
Expand All @@ -342,6 +343,8 @@ func (c *checkpointManager) PostBlock(req *PostBlockRequest) error {
return err
}

c.logger.Info("[checkPointManager] got exit events", "count", len(exitEvents))

sort.Slice(exitEvents, func(i, j int) bool {
// keep events in sequential order
return exitEvents[i].ID.Cmp(exitEvents[j].ID) < 0
Expand All @@ -351,6 +354,8 @@ func (c *checkpointManager) PostBlock(req *PostBlockRequest) error {
return err
}

c.logger.Info("[checkPointManager] written exit events")

if err := c.state.CheckpointStore.updateLastSaved(block); err != nil {
return err
}
Expand Down

0 comments on commit 099023e

Please sign in to comment.