From d3edc58ef74184f1a19fb82d79f83de64733cd84 Mon Sep 17 00:00:00 2001 From: Richard Creighton Date: Fri, 22 May 2026 06:59:02 +0100 Subject: [PATCH] graphql: handle missing block body in Raw resolver (#35027) Return empty raw bytes when the GraphQL `Block.raw` resolver cannot load the block body. This matches the nil handling used by the other block-body-backed resolvers and avoids exposing RLP empty-list bytes as raw block data. --- graphql/graphql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index dadc91fac0..b25683cb0f 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -929,7 +929,7 @@ func (b *Block) RawHeader(ctx context.Context) (hexutil.Bytes, error) { func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) { block, err := b.resolve(ctx) - if err != nil { + if err != nil || block == nil { return hexutil.Bytes{}, err } return rlp.EncodeToBytes(block)