Skip to content

Commit

Permalink
exec sync monitor: improve fields and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Apr 9, 2024
1 parent 4ac357c commit 5398cac
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions execution/gethexec/sync_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@ func NewSyncMonitor(config *SyncMonitorConfig, exec *ExecutionEngine) *SyncMonit

func (s *SyncMonitor) FullSyncProgressMap() map[string]interface{} {
res := s.consensus.FullSyncProgressMap()
consensusSyncTarget := s.consensus.SyncTargetMessageCount()

built, err := s.exec.HeadMessageNumber()
res["consensusSyncTarget"] = s.consensus.SyncTargetMessageCount()

header, err := s.exec.getCurrentHeader()
if err != nil {
res["headMsgNumberError"] = err
res["currentHeaderError"] = err
} else {
blockNum := header.Number.Uint64()
res["blockNum"] = blockNum
messageNum, err := s.exec.BlockNumberToMessageIndex(blockNum)
if err != nil {
res["messageOfLastBlockError"] = err
} else {
res["messageOfLastBlock"] = messageNum
}
}

res["builtBlock"] = built
res["consensusSyncTarget"] = consensusSyncTarget

return res
}

Expand Down

0 comments on commit 5398cac

Please sign in to comment.