Skip to content

Initialize the ExecutionRequests field in gossip block map#16047

Merged
rkapka merged 1 commit into
developfrom
init-gossip-execution-requests
Nov 25, 2025
Merged

Initialize the ExecutionRequests field in gossip block map#16047
rkapka merged 1 commit into
developfrom
init-gossip-execution-requests

Conversation

@rkapka

@rkapka rkapka commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?

Other

What does this PR do? Why is it needed?

When unmarshaling a block with fastssz, if the target block's ExecutionRequests field is nil, it will not get populated

if b.ExecutionRequests == nil {
	b.ExecutionRequests = new(v1.ExecutionRequests)
}
if err = b.ExecutionRequests.UnmarshalSSZ(buf); err != nil {
	return err
}

This is true for other fields and that's why we initialize them in our gossip data maps. There is no bug at the moment because even if execution requests are nil, we initialize them in consensus-types/blocks/proto.go

er := pb.ExecutionRequests
if er == nil {
	er = &enginev1.ExecutionRequests{}
}

However, since we initialize other fields in the data map, it's safer to do it for execution requests too, to avoid a bug in case the code in consensus-types/blocks/proto.go changes in the future.

Acknowledgements

@rkapka rkapka enabled auto-merge November 25, 2025 16:14
@rkapka rkapka added this pull request to the merge queue Nov 25, 2025
Merged via the queue into develop with commit 6be1541 Nov 25, 2025
18 checks passed
@rkapka rkapka deleted the init-gossip-execution-requests branch November 25, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants