fix: enable cancun in transaction validator if active at genesis (#4522)

This commit is contained in:
Dan Cline
2023-09-08 07:33:11 -04:00
committed by GitHub
parent 83987420f1
commit 123c797755

View File

@@ -380,6 +380,9 @@ pub struct EthTransactionValidatorBuilder {
impl EthTransactionValidatorBuilder {
/// Creates a new builder for the given [ChainSpec]
pub fn new(chain_spec: Arc<ChainSpec>) -> Self {
// If cancun is enabled at genesis, enable it
let cancun = chain_spec.is_cancun_activated_at_timestamp(chain_spec.genesis_timestamp());
Self {
chain_spec,
block_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
@@ -398,7 +401,7 @@ impl EthTransactionValidatorBuilder {
shanghai: true,
// TODO: can hard enable by default once mainnet transitioned
cancun: false,
cancun,
}
}