From 8237654e4de51606eb0ca1635725cafe76e8d73b Mon Sep 17 00:00:00 2001 From: billettc Date: Thu, 1 Feb 2024 15:31:46 -0500 Subject: [PATCH] ugly forked block handling --- block/fetcher/rpc.go | 11 +++++++---- cmd/firesol/main.go | 5 +++-- proto/sf/solana/type/v1/type.proto | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/block/fetcher/rpc.go b/block/fetcher/rpc.go index ce96dd94..4038f634 100644 --- a/block/fetcher/rpc.go +++ b/block/fetcher/rpc.go @@ -9,18 +9,16 @@ import ( "math" "time" - "github.com/streamingfast/derr" - - "golang.org/x/exp/slices" - "github.com/gagliardetto/solana-go" "github.com/gagliardetto/solana-go/rpc" "github.com/gagliardetto/solana-go/rpc/jsonrpc" bin "github.com/streamingfast/binary" pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1" + "github.com/streamingfast/derr" pbsol "github.com/streamingfast/firehose-solana/pb/sf/solana/type/v1" sfsol "github.com/streamingfast/solana-go" "go.uber.org/zap" + "golang.org/x/exp/slices" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -63,6 +61,11 @@ 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)) + //THIS IS A FKG Ugly hack! + if requestedSlot >= 13334464 && requestedSlot <= 13334475 { + return nil, true, nil + } + sleepDuration := time.Duration(0) for f.latestConfirmedSlot < requestedSlot { time.Sleep(sleepDuration) diff --git a/cmd/firesol/main.go b/cmd/firesol/main.go index 3cb2ebd1..84360658 100644 --- a/cmd/firesol/main.go +++ b/cmd/firesol/main.go @@ -3,13 +3,13 @@ package main import ( "fmt" "os" - - "github.com/streamingfast/firehose-solana/cmd/firesol/block" + "time" "github.com/spf13/cobra" firecore "github.com/streamingfast/firehose-core" "github.com/streamingfast/firehose-core/cmd/tools" "github.com/streamingfast/firehose-core/cmd/tools/compare" + "github.com/streamingfast/firehose-solana/cmd/firesol/block" "github.com/streamingfast/firehose-solana/cmd/firesol/rpc" pbsol "github.com/streamingfast/firehose-solana/pb/sf/solana/type/v1" "github.com/streamingfast/logging" @@ -48,6 +48,7 @@ func newFetchCmd(logger *zap.Logger, tracer logging.Tracer) *cobra.Command { Short: "fetch blocks from different sources", Args: cobra.ExactArgs(2), } + time.Now().UnixMilli() cmd.AddCommand(rpc.NewFetchCmd(logger, tracer)) return cmd } diff --git a/proto/sf/solana/type/v1/type.proto b/proto/sf/solana/type/v1/type.proto index aa8dc87e..df51b63c 100644 --- a/proto/sf/solana/type/v1/type.proto +++ b/proto/sf/solana/type/v1/type.proto @@ -73,6 +73,7 @@ message TransactionStatusMeta { optional uint64 compute_units_consumed = 16; } + message TransactionError { bytes err = 1; }