Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: minor evm doc changes #10867

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/ethereum/evm/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use reth_chainspec::{ChainSpec, EthereumHardforks};
use reth_ethereum_forks::{EthereumHardfork, Head};

/// Returns the spec id at the given timestamp.
/// Returns the revm [`SpecId`](revm_primitives::SpecId) at the given timestamp.
///
/// Note: This is only intended to be used after the merge, when hardforks are activated by
/// # Note
///
/// This is only intended to be used after the merge, when hardforks are activated by
/// timestamp.
pub fn revm_spec_by_timestamp_after_merge(
chain_spec: &ChainSpec,
Expand All @@ -20,7 +22,7 @@ pub fn revm_spec_by_timestamp_after_merge(
}
}

/// return `revm_spec` from spec configuration.
/// Map the latest active hardfork at the given block to a revm [`SpecId`](revm_primitives::SpecId).
pub fn revm_spec(chain_spec: &ChainSpec, block: &Head) -> revm_primitives::SpecId {
if chain_spec.fork(EthereumHardfork::Prague).active_at_head(block) {
revm_primitives::PRAGUE
Expand Down
8 changes: 5 additions & 3 deletions crates/optimism/evm/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use reth_chainspec::{ChainSpec, OptimismHardfork};
use reth_ethereum_forks::{EthereumHardfork, Head};

/// Returns the spec id at the given timestamp.
/// Returns the revm [`SpecId`](revm_primitives::SpecId) at the given timestamp.
///
/// Note: This is only intended to be used after the merge, when hardforks are activated by
/// # Note
///
/// This is only intended to be used after the Bedrock, when hardforks are activated by
/// timestamp.
pub fn revm_spec_by_timestamp_after_bedrock(
chain_spec: &ChainSpec,
Expand All @@ -24,7 +26,7 @@ pub fn revm_spec_by_timestamp_after_bedrock(
}
}

/// return `revm_spec` from spec configuration.
/// Map the latest active hardfork at the given block to a revm [`SpecId`](revm_primitives::SpecId).
pub fn revm_spec(chain_spec: &ChainSpec, block: &Head) -> revm_primitives::SpecId {
if chain_spec.fork(OptimismHardfork::Granite).active_at_head(block) {
revm_primitives::GRANITE
Expand Down
Loading