Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ocp/worker/nonce/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (p *runtime) handle(ctx context.Context, record *nonce.Record) error {
}
if err != nil {
switch err {
case solana.ErrStaleData:
case solana.ErrStaleData, ErrStaleIndexerRpcData:
log.With(zap.Error(err)).Debug("failure handling nonce")
default:
log.With(zap.Error(err)).Warn("failure handling nonce")
Expand Down
4 changes: 3 additions & 1 deletion ocp/worker/nonce/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var (
sigTimeout = time.Minute * 5
sigTimeoutCache = make(map[string]time.Time) // temporary hack
sigCacheMu sync.Mutex

ErrStaleIndexerRpcData = errors.New("rpc returned stale account state")
)

func (p *runtime) markReleased(ctx context.Context, record *nonce.Record) error {
Expand Down Expand Up @@ -273,7 +275,7 @@ func (p *runtime) getBlockhashFromVmNonce(ctx context.Context, record *nonce.Rec
} else if resp.Result != indexerpb.GetVirtualDurableNonceResponse_OK {
return "", errors.Errorf("received rpc result %s", resp.Result.String())
} else if resp.Item.Slot <= slot {
return "", errors.New("rpc returned stale account state")
return "", ErrStaleIndexerRpcData
}
return base58.Encode(resp.Item.Account.Value.Value), nil
}
Loading