From 1f53982e17236f13ac4215d18c2f8b878d87de46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= Date: Tue, 10 Sep 2024 09:33:22 +0200 Subject: [PATCH] fix: comments --- sequencesender/ethtx.go | 4 ++-- sequencesender/rpc.go | 5 ++--- sequencesender/sequencesender.go | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sequencesender/ethtx.go b/sequencesender/ethtx.go index 973f410c..77ca016a 100644 --- a/sequencesender/ethtx.go +++ b/sequencesender/ethtx.go @@ -213,7 +213,7 @@ func (s *SequenceSender) syncAllEthTxResults(ctx context.Context) error { for _, result := range results { txSequence, exists := s.ethTransactions[result.ID] if !exists { - log.Infof("transaction %v missing in memory structure. Adding it", result.ID) + log.Debugf("transaction %v missing in memory structure. Adding it", result.ID) // No info: from/to batch and the sent timestamp s.ethTransactions[result.ID] = ðTxData{ SentL1Timestamp: time.Time{}, @@ -352,7 +352,7 @@ func (s *SequenceSender) saveSentSequencesTransactions(ctx context.Context) erro // Purge tx s.purgeEthTx(ctx) - // Ceate file + // Create file fileName := s.cfg.SequencesTxFileName[0:strings.IndexRune(s.cfg.SequencesTxFileName, '.')] + ".tmp" s.sequencesTxFile, err = os.Create(fileName) if err != nil { diff --git a/sequencesender/rpc.go b/sequencesender/rpc.go index 80927f72..b87ab84a 100644 --- a/sequencesender/rpc.go +++ b/sequencesender/rpc.go @@ -71,8 +71,6 @@ func (s *SequenceSender) getL2BlockTimestampFromRPC(blockHash string) (uint64, e Timestamp string `json:"timestamp"` } - l2Block := zkeEVML2Block{} - log.Infof("Getting l2 block timestamp from RPC. Block hash: %s", blockHash) response, err := rpc.JSONRPCCall(s.cfg.RPCURL, "eth_getBlockByHash", blockHash, false) @@ -85,7 +83,8 @@ func (s *SequenceSender) getL2BlockTimestampFromRPC(blockHash string) (uint64, e return 0, fmt.Errorf("error in the response calling eth_getBlockByHash: %v", response.Error) } - // Get the batch number from the response hex string + // Get the l2 block from the response + l2Block := zkeEVML2Block{} err = json.Unmarshal(response.Result, &l2Block) if err != nil { return 0, fmt.Errorf("error unmarshalling the l2 block from the response calling eth_getBlockByHash: %v", err) diff --git a/sequencesender/sequencesender.go b/sequencesender/sequencesender.go index 75514ac2..144cb28a 100644 --- a/sequencesender/sequencesender.go +++ b/sequencesender/sequencesender.go @@ -440,9 +440,10 @@ func (s *SequenceSender) getLatestVirtualBatch() error { if err != nil { log.Errorf("error getting latest virtual batch, error: %v", err) return errors.New("fail to get latest virtual batch") - } else { - log.Infof("latest virtual batch is %d", s.latestVirtualBatchNumber) } + + log.Infof("latest virtual batch is %d", s.latestVirtualBatchNumber) + return nil }