From a8fdcd1dc8551ac36aa7e6fbca1d862ace5deaea Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Thu, 2 May 2024 14:20:46 +0200 Subject: [PATCH] changing default parameters + logging --- block/manager.go | 2 +- da/celestia/celestia.go | 5 +++++ da/celestia/config.go | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/block/manager.go b/block/manager.go index 86df50335..9dc43232b 100644 --- a/block/manager.go +++ b/block/manager.go @@ -167,7 +167,7 @@ func (m *Manager) Start(ctx context.Context, isAggregator bool) error { } } if !isAggregator { - go uevent.MustSubscribe(ctx, m.Pubsub, "applyBlockLoop", p2p.EventQueryNewNewGossipedBlock, m.onNewGossipedBlock, m.logger, 100) + go uevent.MustSubscribe(ctx, m.Pubsub, "applyBlockLoop", p2p.EventQueryNewNewGossipedBlock, m.onNewGossipedBlock, m.logger, 10000) } err := m.syncBlockManager() diff --git a/da/celestia/celestia.go b/da/celestia/celestia.go index c5acfbba3..0bd4db297 100644 --- a/da/celestia/celestia.go +++ b/da/celestia/celestia.go @@ -2,6 +2,7 @@ package celestia import ( "context" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -319,6 +320,7 @@ func (c *DataAvailabilityLayerClient) retrieveBatches(daMetaData *da.DASubmitMet ctx, cancel := context.WithTimeout(c.ctx, c.config.Timeout) defer cancel() + c.logger.Debug("Celestia DA getting blob", "height", daMetaData.Height, "namespace", hex.EncodeToString(daMetaData.Namespace), "commitment", hex.EncodeToString(daMetaData.Commitment)) var batches []*types.Batch blob, err := c.rpc.Get(ctx, daMetaData.Height, daMetaData.Namespace, daMetaData.Commitment) if err != nil { @@ -345,6 +347,9 @@ func (c *DataAvailabilityLayerClient) retrieveBatches(daMetaData *da.DASubmitMet if err != nil { c.logger.Error("unmarshal block", "daHeight", daMetaData.Height, "error", err) } + + c.logger.Debug("Celestia DA get blob successful", "DA height", daMetaData.Height, "lastBlockHeight", batch.EndHeight) + parsedBatch := new(types.Batch) err = parsedBatch.FromProto(&batch) if err != nil { diff --git a/da/celestia/config.go b/da/celestia/config.go index 601afb9e7..e4b2c1f4a 100644 --- a/da/celestia/config.go +++ b/da/celestia/config.go @@ -12,7 +12,7 @@ import ( ) const ( - defaultRpcRetryDelay = 10 * time.Second + defaultRpcRetryDelay = 1 * time.Second defaultRpcCheckAttempts = 10 namespaceVersion = 0 defaultGasPrices = 0.1 @@ -42,7 +42,7 @@ type Config struct { var CelestiaDefaultConfig = Config{ BaseURL: "http://127.0.0.1:26658", AppNodeURL: "", - Timeout: 30 * time.Second, + Timeout: 5 * time.Second, Fee: 0, GasLimit: 20000000, GasPrices: defaultGasPrices,