From 8a3508eb0b234cf334f97a213736ca370847162e Mon Sep 17 00:00:00 2001 From: Omri Date: Fri, 10 May 2024 12:08:04 +0200 Subject: [PATCH] fix(settlement): improved logging for settlement batch event (#841) (cherry picked from commit c5b3e079832538b294d6874901e8bc31c68ea149) --- settlement/dymension/dymension.go | 2 +- settlement/events.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index 9916dd81e..2ec9f6518 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -266,7 +266,7 @@ submitLoop: case event := <-subscription.Out(): eventData := event.Data().(*settlement.EventDataNewBatchAccepted) if eventData.EndHeight != batch.EndHeight { - d.logger.Error("Received event for a different batch, ignoring.", "event", eventData) + d.logger.Info("Received event for a different batch, ignoring.", "event", eventData) continue } uevent.MustPublish(d.ctx, d.pubsub, &settlement.EventDataHealth{}, settlement.EventHealthStatusList) diff --git a/settlement/events.go b/settlement/events.go index 4a53098e1..740e5e7ff 100644 --- a/settlement/events.go +++ b/settlement/events.go @@ -1,6 +1,8 @@ package settlement import ( + "fmt" + "github.com/dymensionxyz/dymint/types" uevent "github.com/dymensionxyz/dymint/utils/event" ) @@ -37,6 +39,10 @@ type EventDataNewBatchAccepted struct { StateIndex uint64 } +func (e EventDataNewBatchAccepted) String() string { + return fmt.Sprintf("EndHeight: %d, StateIndex: %d", e.EndHeight, e.StateIndex) +} + type EventDataSequencersListUpdated struct { // Sequencers is the list of new sequencers Sequencers []types.Sequencer