Skip to content

Commit

Permalink
bump firecore
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Jan 31, 2024
1 parent 544353a commit 5ea3ce3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.2

FROM ghcr.io/streamingfast/firehose-core:c2781fa as core
FROM ghcr.io/streamingfast/firehose-core:a4ba225 as core

FROM ubuntu:20.04

Expand Down
19 changes: 11 additions & 8 deletions block/fetcher/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,36 @@ func (f *RPCFetcher) IsBlockAvailable(requestedSlot uint64) bool {
func (f *RPCFetcher) Fetch(ctx context.Context, requestedSlot uint64) (out *pbbstream.Block, skip bool, err error) {
f.logger.Info("fetching block", zap.Uint64("block_num", requestedSlot))

sleepDuration := time.Duration(0)
for f.latestConfirmedSlot < requestedSlot {
time.Sleep(sleepDuration)
f.latestConfirmedSlot, err = f.rpcClient.GetSlot(ctx, rpc.CommitmentConfirmed)
if err != nil {
return nil, false, fmt.Errorf("fetching latestConfirmedSlot block num: %w", err)
}

f.logger.Info("got latest confirmed slot block", zap.Uint64("latest_confirmed_slot", f.latestConfirmedSlot), zap.Uint64("requested_block_num", requestedSlot))
//
if f.latestConfirmedSlot < requestedSlot {
time.Sleep(f.latestBlockRetryInterval)
continue
if f.latestConfirmedSlot >= requestedSlot {
break
}
break
sleepDuration = f.latestBlockRetryInterval
}

sleepDuration = time.Duration(0)
for f.latestFinalizedSlot < requestedSlot {
time.Sleep(sleepDuration)
f.latestFinalizedSlot, err = f.rpcClient.GetSlot(ctx, rpc.CommitmentFinalized)
if err != nil {
return nil, false, fmt.Errorf("fetching latest finalized Slot block num: %w", err)
}

f.logger.Info("got latest finalized slot block", zap.Uint64("latest_finalized_slot", f.latestFinalizedSlot), zap.Uint64("request_block_num", requestedSlot))
//
if f.latestFinalizedSlot < requestedSlot {
time.Sleep(f.latestBlockRetryInterval)
continue
if f.latestFinalizedSlot >= requestedSlot {
break
}
break
sleepDuration = f.latestBlockRetryInterval
}

blockResult, skip, err := f.fetch(ctx, requestedSlot)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/streamingfast/bstream v0.0.2-0.20240118123300-2bc69dde3598
github.com/streamingfast/cli v0.0.4-0.20230825151644-8cc84512cd80
github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77
github.com/streamingfast/firehose-core v1.0.1-0.20240129204613-f839e5d69f02
github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091
github.com/streamingfast/solana-go v0.5.1-0.20230622180848-8faf68a7cb1d
github.com/test-go/testify v1.1.4
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ github.com/streamingfast/dtracing v0.0.0-20220305214756-b5c0e8699839 h1:K6mJPvh1
github.com/streamingfast/dtracing v0.0.0-20220305214756-b5c0e8699839/go.mod h1:huOJyjMYS6K8upTuxDxaNd+emD65RrXoVBvh8f1/7Ns=
github.com/streamingfast/firehose-core v1.0.1-0.20240129204613-f839e5d69f02 h1:drsRlqWE3vKaCsM/tdsaonlBITcL7lvBeHNL82VNEjw=
github.com/streamingfast/firehose-core v1.0.1-0.20240129204613-f839e5d69f02/go.mod h1:mwzlzxtjSqJy81zFv1X77+YoKhe59rBZopisrQTmaqo=
github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b/go.mod h1:mwzlzxtjSqJy81zFv1X77+YoKhe59rBZopisrQTmaqo=
github.com/streamingfast/gagliardetto-solana-go v0.0.0-20240115191424-05c37cd0760d h1:Db3yKJeN5DWPz8pesR9tuFXdbs0MnpRLmov+ttsHoTU=
github.com/streamingfast/gagliardetto-solana-go v0.0.0-20240115191424-05c37cd0760d/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8=
github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0 h1:g8eEYbFSykyzIyuxNMmHEUGGUvJE0ivmqZagLDK42gw=
Expand Down

0 comments on commit 5ea3ce3

Please sign in to comment.