Skip to content

feat: detect empty blocks by querying pending txes#722

Merged
shaspitz merged 19 commits intomainfrom
empty-blocks-via-rpc
Jul 17, 2025
Merged

feat: detect empty blocks by querying pending txes#722
shaspitz merged 19 commits intomainfrom
empty-blocks-via-rpc

Conversation

@shaspitz
Copy link
Copy Markdown
Contributor

@shaspitz shaspitz commented Jul 9, 2025

Describe your changes

Previously we were requesting many payloads to be built by the EL without those payloads actually being used. If a payload had no txes in it, we'd throw away that payload and continuously try again. With LEADER_EVM_BUILD_DELAY set to 1ms and no pending txes, the old logic would request payloads to be rebuilt up to every 1ms.

This PR allows created payloads to 1:1 align with sealed blocks using the txpool_status json rpc method. A payload is only built by the EL if there are one or more pending transactions for the node.

@shaspitz shaspitz changed the title Update blockbuilder.go feat: detect empty blocks by querying pending txes Jul 10, 2025
@shaspitz shaspitz marked this pull request as ready for review July 10, 2025 00:53
@shaspitz shaspitz marked this pull request as draft July 10, 2025 07:35
@shaspitz
Copy link
Copy Markdown
Contributor Author

shaspitz commented Jul 10, 2025

Marking as draft. ethclient.PendingTransactionCount returns a count that's not updated fast enough. I'll update this PR to use txpool_status rpc

@shaspitz shaspitz marked this pull request as ready for review July 10, 2025 22:58
@shaspitz shaspitz force-pushed the empty-blocks-via-rpc branch from aa445c2 to 901517d Compare July 15, 2025 19:25
@shaspitz shaspitz force-pushed the empty-blocks-via-rpc branch from 901517d to eb523e3 Compare July 16, 2025 18:14
@shaspitz shaspitz merged commit c177685 into main Jul 17, 2025
5 checks passed
@shaspitz shaspitz deleted the empty-blocks-via-rpc branch July 17, 2025 17:58
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