Skip to content

Commit

Permalink
reenable support for substreams with only 'params' as inputs, fix sto…
Browse files Browse the repository at this point in the history
…p-block-num validation when set to 0
  • Loading branch information
sduchesneau committed May 13, 2024
1 parent 2ab88a6 commit 2fa7835
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/release-notes/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions pipeline/exec/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion service/tier1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 2fa7835

Please sign in to comment.