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'")) }