Skip to content

Commit

Permalink
ugly forked block handling
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Feb 1, 2024
1 parent 2970954 commit 8237654
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 7 additions & 4 deletions block/fetcher/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions cmd/firesol/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
1 change: 1 addition & 0 deletions proto/sf/solana/type/v1/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ message TransactionStatusMeta {
optional uint64 compute_units_consumed = 16;
}


message TransactionError {
bytes err = 1;
}
Expand Down

0 comments on commit 8237654

Please sign in to comment.