chore: rm redundant is_optimism checks (#9438)

This commit is contained in:
Matthias Seitz
2024-07-11 10:43:14 +02:00
committed by GitHub
parent 4e5162cb3f
commit a1e93b79aa
4 changed files with 4 additions and 9 deletions

View File

@ -198,11 +198,7 @@ impl Consensus for EthBeaconConsensus {
})
}
// Early OP exception:
// * If the network is pre-Bedrock OP, ignore the extradata check.
if !self.chain_spec.is_optimism() {
validate_header_extradata(header)?;
}
validate_header_extradata(header)?;
}
Ok(())

View File

@ -246,8 +246,7 @@ where
// If the canyon hardfork is active at the current timestamp, and it was not active at the
// previous block timestamp (heuristically, block time is not perfectly constant at 2s), and the
// chain is an optimism chain, then we need to force-deploy the create2 deployer contract.
if chain_spec.is_optimism() &&
chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, timestamp) &&
if chain_spec.is_fork_active_at_timestamp(OptimismHardfork::Canyon, timestamp) &&
!chain_spec
.is_fork_active_at_timestamp(OptimismHardfork::Canyon, timestamp.saturating_sub(2))
{

View File

@ -150,7 +150,7 @@ impl PayloadBuilderAttributes for OptimismPayloadBuilderAttributes {
{
cfg_with_handler_cfg = CfgEnvWithHandlerCfg {
cfg_env: cfg,
handler_cfg: HandlerCfg { spec_id, is_optimism: chain_spec.is_optimism() },
handler_cfg: HandlerCfg { spec_id, is_optimism: true },
};
}

View File

@ -147,7 +147,7 @@ impl PayloadAttributes for OptimismPayloadAttributes {
) -> Result<(), EngineObjectValidationError> {
validate_version_specific_fields(chain_spec, version, self.into())?;
if self.gas_limit.is_none() && chain_spec.is_optimism() {
if self.gas_limit.is_none() {
return Err(EngineObjectValidationError::InvalidParams(
"MissingGasLimitInPayloadAttributes".to_string().into(),
))