mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat(op): timestamp below bedrock (#7768)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -7156,7 +7156,6 @@ dependencies = [
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"c-kzg",
|
||||
"cfg-if",
|
||||
"clap",
|
||||
"criterion",
|
||||
"derive_more",
|
||||
|
||||
@@ -51,7 +51,6 @@ tempfile = { workspace = true, optional = true }
|
||||
thiserror.workspace = true
|
||||
zstd = { version = "0.13", features = ["experimental"], optional = true }
|
||||
roaring = "0.10.2"
|
||||
cfg-if = "1.0.0"
|
||||
|
||||
# `test-utils` feature
|
||||
hash-db = { version = "~0.15", optional = true }
|
||||
|
||||
@@ -776,6 +776,17 @@ impl SealedHeader {
|
||||
}
|
||||
|
||||
// timestamp in past check
|
||||
#[cfg(feature = "optimism")]
|
||||
if chain_spec.is_bedrock_active_at_block(self.header.number) &&
|
||||
self.header.is_timestamp_in_past(parent.timestamp)
|
||||
{
|
||||
return Err(HeaderValidationError::TimestampIsInPast {
|
||||
parent_timestamp: parent.timestamp,
|
||||
timestamp: self.timestamp,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "optimism"))]
|
||||
if self.header.is_timestamp_in_past(parent.timestamp) {
|
||||
return Err(HeaderValidationError::TimestampIsInPast {
|
||||
parent_timestamp: parent.timestamp,
|
||||
@@ -786,16 +797,14 @@ impl SealedHeader {
|
||||
// TODO Check difficulty increment between parent and self
|
||||
// Ace age did increment it by some formula that we need to follow.
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "optimism")] {
|
||||
// On Optimism, the gas limit can adjust instantly, so we skip this check
|
||||
// if the optimism feature is enabled in the chain spec.
|
||||
if !chain_spec.is_optimism() {
|
||||
self.validate_gas_limit(parent, chain_spec)?;
|
||||
}
|
||||
} else {
|
||||
if cfg!(feature = "optimism") {
|
||||
// On Optimism, the gas limit can adjust instantly, so we skip this check
|
||||
// if the optimism feature is enabled in the chain spec.
|
||||
if !chain_spec.is_optimism() {
|
||||
self.validate_gas_limit(parent, chain_spec)?;
|
||||
}
|
||||
} else {
|
||||
self.validate_gas_limit(parent, chain_spec)?;
|
||||
}
|
||||
|
||||
// EIP-1559 check base fee
|
||||
|
||||
Reference in New Issue
Block a user