File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
2626
2727 "github.com/berachain/beacon-kit/node-api/handlers"
2828 "github.com/berachain/beacon-kit/node-api/handlers/beacon/types"
29+ handlertypes "github.com/berachain/beacon-kit/node-api/handlers/types"
2930 "github.com/berachain/beacon-kit/node-api/handlers/utils"
3031 "github.com/berachain/beacon-kit/primitives/math"
3132)
@@ -93,6 +94,18 @@ func (h *Handler) GetBlobSidecars(c handlers.Context) (any, error) {
9394 return nil , err
9495 }
9596
97+ // If no blobs found, check if we expect blobs for this slot. If so, it means that
98+ // we are still waiting for the blobs to be fetched via BlobReactor.
99+ if len (blobSidecars ) == 0 {
100+ st , _ , stateErr := h .backend .StateAndSlotFromHeight (int64 (slot )) //#nosec: G115 // practically safe
101+ if stateErr == nil {
102+ payloadHeader , headerErr := st .GetLatestExecutionPayloadHeader ()
103+ if headerErr == nil && payloadHeader .GetBlobGasUsed () > 0 {
104+ return nil , fmt .Errorf ("blobs pending: %w" , handlertypes .ErrNotFound )
105+ }
106+ }
107+ }
108+
96109 // Create a map of requested indices for O(1) index lookups.
97110 isRequestIndex := make (map [uint64 ]bool )
98111 for _ , idx := range indices {
You can’t perform that action at this time.
0 commit comments