From d8bb895fb9a4c96dfbaef655804b474d61ccbe3c Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Mon, 20 May 2024 19:32:41 -0600 Subject: [PATCH] fix parlia default config --- crates/bsc/consensus/src/lib.rs | 6 +++++- crates/bsc/evm/src/execute.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/bsc/consensus/src/lib.rs b/crates/bsc/consensus/src/lib.rs index 2277492407..d2dda57d34 100644 --- a/crates/bsc/consensus/src/lib.rs +++ b/crates/bsc/consensus/src/lib.rs @@ -64,7 +64,7 @@ pub struct ParliaConfig { impl Default for ParliaConfig { fn default() -> Self { - Self { epoch: 300, period: 3 } + Self { epoch: 200, period: 3 } } } @@ -217,6 +217,10 @@ impl Parlia { ) -> Result, ParliaConsensusError> { self.check_header_extra_len(header)?; + if !self.chain_spec().fork(Hardfork::Luban).active_at_block(header.number) { + return Ok(None); + }; + let mut raw; let extra_len = header.extra_data.len(); if header.number % self.epoch != 0 { diff --git a/crates/bsc/evm/src/execute.rs b/crates/bsc/evm/src/execute.rs index 4565429876..079727b043 100644 --- a/crates/bsc/evm/src/execute.rs +++ b/crates/bsc/evm/src/execute.rs @@ -29,7 +29,11 @@ use reth_interfaces::{ executor::{BlockExecutionError, BlockValidationError}, provider::ProviderError, }; -use reth_primitives::{constants::SYSTEM_ADDRESS, system_contracts::get_upgrade_system_contracts, Address, BlockNumber, BlockWithSenders, Bytes, ChainSpec, GotExpected, Hardfork, Header, PruneModes, Receipt, Receipts, Transaction, TransactionSigned, B256, U256, hex}; +use reth_primitives::{ + constants::SYSTEM_ADDRESS, system_contracts::get_upgrade_system_contracts, Address, + BlockNumber, BlockWithSenders, Bytes, ChainSpec, GotExpected, Hardfork, Header, PruneModes, + Receipt, Receipts, Transaction, TransactionSigned, B256, U256, +}; use reth_provider::ParliaProvider; use reth_revm::{ batch::{BlockBatchRecord, BlockExecutorStats},