feat: make DatabaseProvider generic over chainspec (#10978)

This commit is contained in:
Arsenii Kulikov
2024-09-19 17:23:06 +03:00
committed by GitHub
parent 161c2d2b0d
commit 6cb26f72af
38 changed files with 290 additions and 190 deletions

View File

@ -48,6 +48,8 @@ thiserror.workspace = true
schnellru.workspace = true
itertools.workspace = true
reth-chainspec = { workspace = true, optional = true }
[dev-dependencies]
# reth
reth-payload-builder = { workspace = true, features = ["test-utils"] }
@ -79,4 +81,5 @@ optimism = [
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-blockchain-tree/optimism",
"reth-chainspec"
]

View File

@ -197,7 +197,7 @@ where
/// The payload store.
payload_builder: PayloadBuilderHandle<N::Engine>,
/// Validator for execution payloads
payload_validator: ExecutionPayloadValidator,
payload_validator: ExecutionPayloadValidator<N::ChainSpec>,
/// Current blockchain tree action.
blockchain_tree_action: Option<BlockchainTreeAction<N::Engine>>,
/// Pending forkchoice update.
@ -462,7 +462,8 @@ where
) -> bool {
// On Optimism, the proposers are allowed to reorg their own chain at will.
#[cfg(feature = "optimism")]
if self.blockchain.chain_spec().is_optimism() {
if reth_chainspec::EthChainSpec::chain(self.blockchain.chain_spec().as_ref()).is_optimism()
{
debug!(
target: "consensus::engine",
fcu_head_num=?header.number,

View File

@ -517,7 +517,7 @@ mod tests {
fn build<N>(
self,
pipeline: Pipeline<N>,
chain_spec: Arc<ChainSpec>,
chain_spec: Arc<N::ChainSpec>,
) -> EngineSyncController<N, Either<Client, TestFullBlockClient>>
where
N: ProviderNodeTypes,