Skip to content

Commit

Permalink
Fix missed block nil
Browse files Browse the repository at this point in the history
  • Loading branch information
alrevuelta committed Feb 2, 2024
1 parent 2c858bc commit 23198cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oracle/onchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ func (o *Onchain) GetConsensusBlockAtSlot(slot uint64, opts ...retry.Option) (*s
// GET failed with status 404: {"code":404,"message":"NOT_FOUND: beacon block at slot 7408169","stacktraces":[]}
// To keep compatibility after go-eth2-client changes, we consider that a missed block is nil
if strings.Contains(err.Error(), "404") {
log.Info("error contains;: ", err.Error())
signedBeaconBlock = &api.Response[*spec.VersionedSignedBeaconBlock]{
Data: nil,
}
return nil
}
log.Warn("Failed attempt to fetch block at slot ", slotStr, ": ", err.Error(), " Retrying...")
Expand Down

0 comments on commit 23198cc

Please sign in to comment.