From 5398cac8d749ba5198d24f390faf3e0adc3c0a99 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Tue, 9 Apr 2024 08:48:56 -0600 Subject: [PATCH] exec sync monitor: improve fields and naming --- execution/gethexec/sync_monitor.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/execution/gethexec/sync_monitor.go b/execution/gethexec/sync_monitor.go index 35256f72a0..564c6d74bd 100644 --- a/execution/gethexec/sync_monitor.go +++ b/execution/gethexec/sync_monitor.go @@ -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 }