Skip to content

Commit

Permalink
bump substreams/firehose-core to allow catching timeouts in rpc-calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Aug 20, 2024
1 parent 335607a commit 4b3ac86
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See [MAINTAINERS.md](./MAINTAINERS.md)
for instructions to keep up to date.

## Unreleased

* Substreams: revert module hash calculation from `v2.6.5`, when using a non-zero firstStreamableBlock. Hashes will now be the same even if the chain's first streamable block affects the initialBlock of a module.
* Substreams: add `--substreams-block-execution-timeout` flag (default 3 minutes) to prevent requests stalling. Timeout errors are returned to the client who can decide to retry.

## v2.6.7

* Bump substreams to v1.9.3: fix high CPU usage on tier1 caused by a bad error handling
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ require (
github.com/streamingfast/dstore v0.1.1-0.20240419152712-b7df14cba7b5
github.com/streamingfast/eth-go v0.0.0-20240312122859-216e183c0b7f
github.com/streamingfast/firehose v0.1.1-0.20240118135215-dcf04d40bfcd
github.com/streamingfast/firehose-core v1.5.8-0.20240812210115-c43568b2c384
github.com/streamingfast/firehose-core v1.5.8-0.20240814134036-ad3d137d66d4
github.com/streamingfast/firehose-ethereum/types v0.0.0-20240603154554-acc011d4f8c4
github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091
github.com/streamingfast/pbgo v0.0.6-0.20240430190514-722fe9d82e5d
github.com/streamingfast/shutter v1.5.0
github.com/streamingfast/substreams v1.9.4-0.20240812210000-635f7bcba6cf
github.com/streamingfast/substreams v1.9.4-0.20240820153702-37a109caa0da
github.com/stretchr/testify v1.9.0
github.com/test-go/testify v1.1.4
github.com/tidwall/gjson v1.14.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ github.com/streamingfast/eth-go v0.0.0-20240312122859-216e183c0b7f h1:1LwsmRVENf
github.com/streamingfast/eth-go v0.0.0-20240312122859-216e183c0b7f/go.mod h1:UEm8dqibr3c3A1iIA3CHpkhN7j3X78prN7/55sXf3A0=
github.com/streamingfast/firehose v0.1.1-0.20240118135215-dcf04d40bfcd h1:t5n8dDcgUi7t36Qwxm19K4H2vyOLJfY6MHxTbOvK1z8=
github.com/streamingfast/firehose v0.1.1-0.20240118135215-dcf04d40bfcd/go.mod h1:du6tys2Q6X2pRQ3JbCziWiy7Y7KrOcl4CSb9uiGsVxA=
github.com/streamingfast/firehose-core v1.5.8-0.20240812210115-c43568b2c384 h1:5/+vkcM7Stlhzz3ZvxyNGIBjQ8fL0oxQAeNJGGos36o=
github.com/streamingfast/firehose-core v1.5.8-0.20240812210115-c43568b2c384/go.mod h1:QR6NRnN9EEXVAtMJ05YEisd5UesdMoY9liILX1WzFgs=
github.com/streamingfast/firehose-core v1.5.8-0.20240814134036-ad3d137d66d4 h1:yZwkR1hLAQwaHbB6jQ7s6/8GPhvkc9Q+w2aFEohBS+I=
github.com/streamingfast/firehose-core v1.5.8-0.20240814134036-ad3d137d66d4/go.mod h1:QR6NRnN9EEXVAtMJ05YEisd5UesdMoY9liILX1WzFgs=
github.com/streamingfast/firehose-ethereum/types v0.0.0-20240603154554-acc011d4f8c4 h1:gr6ew/RxqQNDtDejLsNE3oAkvyitrtlj15alAjRDKs8=
github.com/streamingfast/firehose-ethereum/types v0.0.0-20240603154554-acc011d4f8c4/go.mod h1:CG22ObinxSbKIP19bAj0uro0a290kzZTiBbjL8VR0SE=
github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0 h1:g8eEYbFSykyzIyuxNMmHEUGGUvJE0ivmqZagLDK42gw=
Expand All @@ -600,8 +600,8 @@ github.com/streamingfast/shutter v1.5.0 h1:NpzDYzj0HVpSiDJVO/FFSL6QIK/YKOxY0gJAt
github.com/streamingfast/shutter v1.5.0/go.mod h1:B/T6efqdeMGbGwjzPS1ToXzYZI4kDzI5/u4I+7qbjY8=
github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0 h1:Y15G1Z4fpEdm2b+/70owI7TLuXadlqBtGM7rk4Hxrzk=
github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0/go.mod h1:/Rnz2TJvaShjUct0scZ9kKV2Jr9/+KBAoWy4UMYxgv4=
github.com/streamingfast/substreams v1.9.4-0.20240812210000-635f7bcba6cf h1:/5LEFtd/ws7Gl4Di3mMaZYbgasRC1ooK3einImpmVsg=
github.com/streamingfast/substreams v1.9.4-0.20240812210000-635f7bcba6cf/go.mod h1:Q/h8Mxe+MKVZqU9wIpMxLKZHb0hLIACZvDiBnR+IVyI=
github.com/streamingfast/substreams v1.9.4-0.20240820153702-37a109caa0da h1:dk5AfvQY3aJdW6CRzsDG3gDkY6ON/70RCv2iB9P8FSI=
github.com/streamingfast/substreams v1.9.4-0.20240820153702-37a109caa0da/go.mod h1:Q/h8Mxe+MKVZqU9wIpMxLKZHb0hLIACZvDiBnR+IVyI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
Expand Down
5 changes: 3 additions & 2 deletions substreams/rpccalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package substreams
import (
"context"
"encoding/hex"
"encoding/json"
"fmt"
"net/http"
"regexp"
Expand Down Expand Up @@ -96,7 +97,6 @@ func NewRPCEngine(rpcEndpoints []string, gasLimit uint64) (*RPCEngine, error) {
Transport: &http.Transport{
DisableKeepAlives: true, // don't reuse connections
},
Timeout: 60 * time.Second,
}
opts := []rpc.Option{
rpc.WithHttpClient(httpClient),
Expand Down Expand Up @@ -238,8 +238,9 @@ func (e *RPCEngine) rpcCalls(ctx context.Context, traceID string, retryCount int
}

if ctx.Err() != nil {
callDesc, _ := json.Marshal(reqs)
zlog.Info("stopping rpc calls here, context is canceled", zap.String("trace_id", traceID))
return nil, false, err
return nil, false, fmt.Errorf("timeout while doing eth_call: %s, %w", string(callDesc), ctx.Err())
}

e.rollRpcClient()
Expand Down

0 comments on commit 4b3ac86

Please sign in to comment.