Skip to content

Commit

Permalink
change latestBlockRetryInterval value using a param
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Jan 31, 2024
1 parent 4cc6141 commit bdf0059
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ ENV PATH "$PATH:/app"

COPY --from=core /app/firecore /app/firecore

ENTRYPOINT ["/app/firesol"]

ENTRYPOINT ["/app/firesol"]
6 changes: 6 additions & 0 deletions block/fetcher/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ func fixPreviousBlockHash(blockResult *rpc.GetBlockResult) (previousFixedBlockHa
previousFixedBlockHash = "J6rRToKMK5DQDzVLqo7ibL3snwBYtqkYnRnQ7vXoUSEc"
return previousFixedBlockHash
}
case "2TLDT6Z3WJ5h5958BjdzMwmNGnVo3e4qcHyGBVgBPDm9":
//zlogger.Warn("applying horrible tweak to block 61,328,766")
if previousFixedBlockHash == "11111111111111111111111111111111" {
previousFixedBlockHash = "FCgBdK9Fufcsdc9RGu5SwMwbCFiw4SxNnJzCpZTdNpDq"
return previousFixedBlockHash
}
}

return blockResult.PreviousBlockhash.String()
Expand Down
4 changes: 3 additions & 1 deletion cmd/firesol/rpc/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewFetchCmd(logger *zap.Logger, tracer logging.Tracer) *cobra.Command {

cmd.Flags().String("state-dir", "/data/poller", "interval between fetch")
cmd.Flags().Duration("interval-between-fetch", 0, "interval between fetch")
cmd.Flags().Duration("latest-block-retry-interval", time.Second, "interval between fetch")
cmd.Flags().Int("block-fetch-batch-size", 10, "Number of blocks to fetch in a single batch")

return cmd
Expand All @@ -53,11 +54,12 @@ func fetchRunE(logger *zap.Logger, tracer logging.Tracer) firecore.CommandExecut
zap.String("state_dir", stateDir),
zap.Uint64("first_streamable_block", startBlock),
zap.Duration("interval_between_fetch", fetchInterval),
zap.Duration("latest_block_retry_interval", sflags.MustGetDuration(cmd, "latest-block-retry-interval")),
)

rpcClient := rpc.New(rpcEndpoint)

latestBlockRetryInterval := 250 * time.Millisecond
latestBlockRetryInterval := sflags.MustGetDuration(cmd, "latest-block-retry-interval")
poller := blockpoller.New(
fetcher.NewRPC(rpcClient, fetchInterval, latestBlockRetryInterval, logger),
blockpoller.NewFireBlockHandler("type.googleapis.com/sf.solana.type.v1.Block"),
Expand Down

0 comments on commit bdf0059

Please sign in to comment.