From 2fa78357ef270c803da37eaef35d80b43855cd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Sun, 12 May 2024 20:54:40 -0400 Subject: [PATCH] reenable support for substreams with only 'params' as inputs, fix stop-block-num validation when set to 0 --- docs/release-notes/change-log.md | 5 +++-- pipeline/exec/graph.go | 3 +++ service/tier1.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/change-log.md b/docs/release-notes/change-log.md index 0c8cc32e..10bedce4 100644 --- a/docs/release-notes/change-log.md +++ b/docs/release-notes/change-log.md @@ -9,9 +9,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). -## v1.6.1 (Unreleased) +## v1.6.1 -* Fix error handling when resolved start-block == stop-block +* Revert sanity check to support the special case of a substreams with only 'params' as input. This allows a chain-agnostic event to be sent, along with the clock. +* Fix error handling when resolved start-block == stop-block and stop-block is defined as non-zero ## v1.6.0 diff --git a/pipeline/exec/graph.go b/pipeline/exec/graph.go index be254b5b..16cfc1db 100644 --- a/pipeline/exec/graph.go +++ b/pipeline/exec/graph.go @@ -233,6 +233,9 @@ func computeStages(mods []*pbsubstreams.Module, initBlocks map[string]uint64) (s var depModName string switch input := dep.Input.(type) { case *pbsubstreams.Module_Input_Params_: + if len(mod.Inputs) == 1 { + validInputsAtInitialBlock = true // special case where a module has only params as input, to extract the clock + } continue case *pbsubstreams.Module_Input_Source_: validInputsAtInitialBlock = true diff --git a/service/tier1.go b/service/tier1.go index 5d4cc716..b4baf8ce 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -365,7 +365,7 @@ func (s *Tier1Service) blocks(ctx context.Context, request *pbsubstreamsrpc.Requ return fmt.Errorf("build request details: %w", err) } - if requestDetails.ResolvedStartBlockNum == request.StopBlockNum { + if requestDetails.ResolvedStartBlockNum == request.StopBlockNum && request.StopBlockNum != 0 { return bsstream.NewErrInvalidArg("start block and stop block are the same") }