Skip to content

Conversation

@eserilev
Copy link
Member

Issue Addressed

In block lookup an RpcBlock is maybe available. In Range sync and backfill sync the RpcBlock is guaranteed to be available because consistency checks are made before the RpcBlock is constructed. In downstream code when we process blocks from lookup and sync, we are treating the RpcBlock as maybe available which adds match statements and edge cases that are mostly irrelevant for sync.

Proposed Changes

This PR is a first step towards cleaning up block processing. RpcBlock is now an enum with Available and MaybeAvailable variants. These variants are constructed when appropriate.

Additionally the RpcBlockInner is created based on the blocks fork variant. i.e. Deneb or Electra blocks will always use theRpcInnerBlock::BlockAndBlobs variant, even if blobs for that block don't exist (or may not be available yet)

In a subsequent PR, I'll be updating the block processing code paths to remove availability checks for the RpcBlock::Available variant. In the interest of keeping these PR reviews manageable this PR sticks to just converting the RpcBlock to an enum

@eserilev eserilev added code-quality ready-for-review The code is ready for review syncing labels Nov 17, 2025
@eserilev eserilev requested a review from ethDreamer November 17, 2025 19:29
@mergify
Copy link

mergify bot commented Nov 17, 2025

Some required checks have failed. Could you please take a look @eserilev? 🙏

@mergify mergify bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Nov 17, 2025
@eserilev
Copy link
Member Author

need to fix a few tests but the general idea is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality syncing waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant