Skip to content

Commit

Permalink
more verbose logging around FSM build and block syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott committed Mar 13, 2024
1 parent e9ea6c1 commit a93eea0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions consensus/polybft/consensus_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ func (c *consensusRuntime) getGuardedData() (guardedDataDTO, error) {
c.lock.RLock()
defer c.lock.RUnlock()

c.logger.Info("getting guarded data")

lastBuiltBlock := c.lastBuiltBlock.Copy()
epoch := new(epochMetadata)
*epoch = *c.epoch // shallow copy, don't need to make validators copy because AccountSet is immutable
Expand Down Expand Up @@ -380,7 +382,9 @@ func (c *consensusRuntime) FSM() error {

valSet := validator.NewValidatorSet(epoch.Validators, c.logger)

c.logger.Info("building event root", "endOfSprint", isEndOfSprint, "endOfEpoch", isEndOfEpoch)
exitRootHash, err := c.checkpointManager.BuildEventRoot(epoch.Number)
c.logger.Info("built event root")
if err != nil {
return fmt.Errorf("could not build exit root hash for fsm: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions syncer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ func (m *syncPeerClient) GetBlocks(
if !ok {
return
}
m.logger.Info("Stream block channel closed")

blockCh <- block
case err := <-streamErrorCh:
Expand Down
1 change: 1 addition & 0 deletions syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func (s *syncer) bulkSyncWithPeer(peerID peer.ID, newBlockCallback func(*types.F
localLatest := s.blockchain.Header().Number
shouldTerminate := false

s.logger.Info("Starting getting blocks", "peer", peerID, "block", localLatest+1)
blockCh, err := s.syncPeerClient.GetBlocks(peerID, localLatest+1, s.blockTimeout)
if err != nil {
return 0, false, err
Expand Down

0 comments on commit a93eea0

Please sign in to comment.