Skip to content

Commit

Permalink
merger: add FORCE_FINALITY_AFTER_BLOCKS env var to unblock Goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Jan 27, 2024
1 parent 7115763 commit b0036c0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Operators, you should copy/paste content of this content straight to your projec

If you were at `firehose-core` version `1.0.0` and are bumping to `1.1.0`, you should copy the content between those 2 version to your own repository, replacing placeholder value `fire{chain}` with your chain's own binary.

# UNRELEASED

* Added `FORCE_FINALITY_AFTER_BLOCKS` environment variable to allow goerli merger to keep progressing after (ex: 200 blocks), even if the consensus chain is currently not finalizing any epoch.

## v1.1.0

* Updated `substreams` and `dgrpc` to latest versions to reduce logging.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/streamingfast/bstream v0.0.2-0.20240126213849-967cb5709af1
github.com/streamingfast/bstream v0.0.2-0.20240127132523-330edbf00208
github.com/streamingfast/cli v0.0.4-0.20230825151644-8cc84512cd80
github.com/streamingfast/dauth v0.0.0-20231120142446-843f4e045cc2
github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/streamingfast/bstream v0.0.2-0.20240126213849-967cb5709af1 h1:Ge/hQX+0l47v6l/7vTgAYBDtng7ekejWEFteCL7kXww=
github.com/streamingfast/bstream v0.0.2-0.20240126213849-967cb5709af1/go.mod h1:08GVb+DXyz6jVNIsbf+2zlaC81UeEGu5o1h49KrSR3Y=
github.com/streamingfast/bstream v0.0.2-0.20240127132523-330edbf00208 h1:Lu7c8HMNy48V7RtV5Zc7LcZRJYCPkrGWu8KUV4vRrUs=
github.com/streamingfast/bstream v0.0.2-0.20240127132523-330edbf00208/go.mod h1:08GVb+DXyz6jVNIsbf+2zlaC81UeEGu5o1h49KrSR3Y=
github.com/streamingfast/cli v0.0.4-0.20230825151644-8cc84512cd80 h1:UxJUTcEVkdZy8N77E3exz0iNlgQuxl4m220GPvzdZ2s=
github.com/streamingfast/cli v0.0.4-0.20230825151644-8cc84512cd80/go.mod h1:QxjVH73Lkqk+mP8bndvhMuQDUINfkgsYhdCH/5TJFKI=
github.com/streamingfast/dauth v0.0.0-20231120142446-843f4e045cc2 h1:g4mG6ZCy3/XtcsZXfOHrQOsjVGoX9uTc/QlemaPV4EE=
Expand Down
8 changes: 8 additions & 0 deletions merger/bundler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"errors"
"fmt"
"io"
"os"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -118,6 +120,12 @@ func (b *Bundler) Reset(nextBase uint64, lib bstream.BlockRef) {
} else {
b.enforceNextBlockOnBoundary = true
}
if fin := os.Getenv("FORCE_FINALITY_AFTER_BLOCKS"); fin != "" {
fin64, err := strconv.ParseInt(fin, 10, 64)
if err == nil {
options = append(options, forkable.WithForceFinalityAfter(uint64(fin64)))
}
}
b.forkable = forkable.New(b, options...)

b.Lock()
Expand Down

0 comments on commit b0036c0

Please sign in to comment.