From 67189be6e1fd0fe598c12440803b96aa67236fb3 Mon Sep 17 00:00:00 2001 From: billettc Date: Tue, 6 Feb 2024 15:09:07 -0500 Subject: [PATCH] remove resolve start block --- Dockerfile | 2 +- cmd/firesol/rpc/fetcher.go | 21 +-------------------- go.mod | 4 ++-- go.sum | 4 ++-- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index d62f7cb0..201842da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.2 -FROM ghcr.io/streamingfast/firehose-core:a4ba225 as core +FROM ghcr.io/streamingfast/firehose-core:b248423 as core FROM ubuntu:20.04 diff --git a/cmd/firesol/rpc/fetcher.go b/cmd/firesol/rpc/fetcher.go index b7d0504a..54818377 100644 --- a/cmd/firesol/rpc/fetcher.go +++ b/cmd/firesol/rpc/fetcher.go @@ -1,15 +1,12 @@ package rpc import ( - "errors" "fmt" "strconv" "time" "github.com/gagliardetto/solana-go/rpc" - "github.com/gagliardetto/solana-go/rpc/jsonrpc" "github.com/spf13/cobra" - "github.com/streamingfast/bstream" "github.com/streamingfast/cli/sflags" firecore "github.com/streamingfast/firehose-core" "github.com/streamingfast/firehose-core/blockpoller" @@ -74,23 +71,7 @@ func fetchRunE(logger *zap.Logger, tracer logging.Tracer) firecore.CommandExecut logger.Info("Found latest slot", zap.Uint64("slot_number", latestSlot)) - var requestedBlock *rpc.GetBlockResult - for { - requestedBlock, err = rpcClient.GetBlockWithOpts(ctx, latestSlot, fetcher.GetBlockOpts) - if err != nil { - var rpcErr *jsonrpc.RPCError - if errors.As(err, &rpcErr) { - if rpcErr.Code == -32004 { - time.Sleep(latestBlockRetryInterval) - continue - } - } - return fmt.Errorf("getting requested block %d: %w", latestSlot, err) - } - break - } - - err = poller.Run(ctx, startBlock, bstream.NewBlockRef(requestedBlock.Blockhash.String(), latestSlot), sflags.MustGetInt(cmd, "block-fetch-batch-size")) + err = poller.Run(ctx, startBlock, sflags.MustGetInt(cmd, "block-fetch-batch-size")) if err != nil { return fmt.Errorf("running poller: %w", err) } diff --git a/go.mod b/go.mod index a85dcd2b..ba40090e 100644 --- a/go.mod +++ b/go.mod @@ -18,8 +18,9 @@ require ( github.com/streamingfast/binary v0.0.0-20240116152459-ebe30de95370 github.com/streamingfast/bstream v0.0.2-0.20240118123300-2bc69dde3598 github.com/streamingfast/cli v0.0.4-0.20230825151644-8cc84512cd80 + github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1 github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77 - github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b + github.com/streamingfast/firehose-core v1.0.1-0.20240206200209-b248423346ea 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 @@ -154,7 +155,6 @@ require ( github.com/spf13/viper v1.15.0 // indirect github.com/streamingfast/dauth v0.0.0-20231120142446-843f4e045cc2 // indirect github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c // indirect - github.com/streamingfast/derr v0.0.0-20230515163924-8570aaa43fe1 // indirect github.com/streamingfast/dgrpc v0.0.0-20240119162453-69517bcc1a7f // indirect github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4 // indirect github.com/streamingfast/dmetering v0.0.0-20231120142327-a3405f0eed83 // indirect diff --git a/go.sum b/go.sum index 996bae50..0adfc246 100644 --- a/go.sum +++ b/go.sum @@ -706,8 +706,8 @@ github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77 h1:u7FWLqz3 github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77/go.mod h1:ngKU7WzHwVjOFpt2g+Wtob5mX4IvN90HYlnARcTRbmQ= github.com/streamingfast/dtracing v0.0.0-20220305214756-b5c0e8699839 h1:K6mJPvh1jAL+/gBS7Bh9jyzWaTib6N47m06gZOTUPwQ= github.com/streamingfast/dtracing v0.0.0-20220305214756-b5c0e8699839/go.mod h1:huOJyjMYS6K8upTuxDxaNd+emD65RrXoVBvh8f1/7Ns= -github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b h1:KauLK86b2y2VmE+snS+EFYXbASOe2nr/f8e7dx1NgqI= -github.com/streamingfast/firehose-core v1.0.1-0.20240131133941-a4ba225c6f6b/go.mod h1:mwzlzxtjSqJy81zFv1X77+YoKhe59rBZopisrQTmaqo= +github.com/streamingfast/firehose-core v1.0.1-0.20240206200209-b248423346ea h1:meVzSjdDrnuutYUWu5cikQOF2XVdXEOxHe4bQhiKGuM= +github.com/streamingfast/firehose-core v1.0.1-0.20240206200209-b248423346ea/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=