From 3cdf12c49b98e4e6e7a79fc530950f739c9f6eb1 Mon Sep 17 00:00:00 2001 From: arnaudberger Date: Thu, 7 Nov 2024 15:18:03 -0500 Subject: [PATCH] remove not necessary data --- CHANGELOG.md | 4 ++++ sinker/sinker.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e33f0e3..7314bfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v4.2.2 + +* Fix major bug when receiving empty `MapOutput` + ## v4.2.1 * Bump substreams to v1.10.3 to support new manifest data like `protobuf:excludePaths` diff --git a/sinker/sinker.go b/sinker/sinker.go index 592531f..1ce13fc 100644 --- a/sinker/sinker.go +++ b/sinker/sinker.go @@ -121,7 +121,7 @@ func (s *SQLSinker) HandleBlockScopedData(ctx context.Context, data *pbsubstream } } - if data.Clock.Number%s.batchBlockModulo(data, isLive) == 0 { + if data.Clock.Number%s.batchBlockModulo(isLive) == 0 { s.logger.Debug("flushing to database", zap.Stringer("block", cursor.Block()), zap.Bool("is_live", *isLive)) flushStart := time.Now() @@ -213,7 +213,7 @@ func (s *SQLSinker) HandleBlockUndoSignal(ctx context.Context, data *pbsubstream return s.loader.Revert(ctx, s.OutputModuleHash(), cursor, data.LastValidBlock.Number) } -func (s *SQLSinker) batchBlockModulo(blockData *pbsubstreamsrpc.BlockScopedData, isLive *bool) uint64 { +func (s *SQLSinker) batchBlockModulo(isLive *bool) uint64 { if isLive == nil { panic(fmt.Errorf("liveness checker has been disabled on the Sinker instance, this is invalid in the context of 'substreams-sink-sql'")) }