Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic block for BlockchainTreeAction #13320

Open
Tracked by #12578
emhane opened this issue Dec 11, 2024 · 2 comments
Open
Tracked by #12578

Generic block for BlockchainTreeAction #13320

emhane opened this issue Dec 11, 2024 · 2 comments
Labels
A-consensus Related to the consensus engine A-sdk Related to reth's use as a library S-blocked This cannot more forward until something else changes

Comments

@emhane
Copy link
Member

emhane commented Dec 11, 2024

Describe the feature

Make BlockchainTreeAction generic over block as BlockchainTreeAction<EngineT: EngineTypes, B: reth_primitives_traits::Block> and generalise type nested in variants SealedBlock to SealedBlockFor<B>

enum BlockchainTreeAction<EngineT: EngineTypes> {
MakeForkchoiceHeadCanonical {
state: ForkchoiceState,
attrs: Option<EngineT::PayloadAttributes>,
tx: oneshot::Sender<RethResult<OnForkChoiceUpdated>>,
},
InsertNewPayload {
block: SealedBlock,
tx: oneshot::Sender<Result<PayloadStatus, BeaconOnNewPayloadError>>,
},
MakeNewPayloadCanonical {
payload_num_hash: BlockNumHash,
status: PayloadStatus,
tx: oneshot::Sender<Result<PayloadStatus, BeaconOnNewPayloadError>>,
},
/// Action to insert a new block that we successfully downloaded from the network.
/// There are several outcomes for inserting a downloaded block into the tree:
///
/// ## [`BlockStatus::Valid`]
///
/// The block is connected to the current canonical chain and is valid.
/// If the block is an ancestor of the current forkchoice head, then we can try again to
/// make the chain canonical.
///
/// ## [`BlockStatus::Disconnected`]
///
/// The block is not connected to the canonical chain, and we need to download the
/// missing parent first.
///
/// ## Insert Error
///
/// If the insertion into the tree failed, then the block was well-formed (valid hash),
/// but its chain is invalid, which means the FCU that triggered the
/// download is invalid. Here we can stop because there's nothing to do here
/// and the engine needs to wait for another FCU.
InsertDownloadedPayload { block: SealedBlock },
}

Additional context

No response

@emhane emhane added A-consensus Related to the consensus engine A-sdk Related to reth's use as a library D-good-first-issue Nice and easy! A great choice to get started labels Dec 11, 2024
@mattsse mattsse added S-blocked This cannot more forward until something else changes and removed D-good-first-issue Nice and easy! A great choice to get started labels Dec 11, 2024
@mattsse
Copy link
Collaborator

mattsse commented Dec 11, 2024

marking this as blocked because we need to figure out if we even have to do this because ideally we retire this entire thing asap

@emhane
Copy link
Member Author

emhane commented Dec 11, 2024

ah, you mean as a side effect of #12750 @mattsse ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine A-sdk Related to reth's use as a library S-blocked This cannot more forward until something else changes
Projects
Status: Todo
Development

No branches or pull requests

2 participants