Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Jan 31, 2024
1 parent bdf0059 commit 544353a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions block/fetcher/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func NewRPC(rpcClient *rpc.Client, fetchInterval time.Duration, latestBlockRetry
}

func (f *RPCFetcher) IsBlockAvailable(requestedSlot uint64) bool {
f.logger.Info("checking if block is available", zap.Uint64("request_block_num", requestedSlot), zap.Uint64("latest_confirmed_slot", f.latestConfirmedSlot))
return requestedSlot <= f.latestConfirmedSlot
}

Expand All @@ -66,7 +67,7 @@ func (f *RPCFetcher) Fetch(ctx context.Context, requestedSlot uint64) (out *pbbs
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("block_num", requestedSlot))
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)
Expand All @@ -80,7 +81,7 @@ func (f *RPCFetcher) Fetch(ctx context.Context, requestedSlot uint64) (out *pbbs
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("block_num", requestedSlot))
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)
Expand Down

0 comments on commit 544353a

Please sign in to comment.