Skip to content

fix: no-std on reth-scroll-engine-primitives #186

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

Merged
merged 6 commits into from
Apr 8, 2025
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: 8 additions & 0 deletions .github/assets/check_rv32imac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ crates_to_check=(
reth-optimism-consensus
reth-optimism-primitives
reth-optimism-evm

## scroll
reth-scroll-chainspec
scroll-alloy-consensus
scroll-alloy-evm
scroll-alloy-rpc-types
scroll-alloy-rpc-types-engine

)

# Array to hold the results
Expand Down
11 changes: 5 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ revm-context = { version = "2.0.0", default-features = false }
revm-context-interface = { version = "2.0.0", default-features = false }
revm-database-interface = { version = "2.0.0", default-features = false }
op-revm = { version = "2.0.0", default-features = false }
revm-scroll = { git = "https://github.com/scroll-tech/scroll-revm" }
revm-scroll = { git = "https://github.com/scroll-tech/scroll-revm", default-features = false }
revm-inspectors = "0.18.0"

# eth
Expand Down Expand Up @@ -512,19 +512,19 @@ alloy-transport-ipc = { version = "0.13.0", default-features = false }
alloy-transport-ws = { version = "0.13.0", default-features = false }

# scroll
scroll-alloy-consensus = { path = "crates/scroll/alloy/consensus" }
scroll-alloy-consensus = { path = "crates/scroll/alloy/consensus", default-features = false }
scroll-alloy-evm = { path = "crates/scroll/alloy/evm" }
scroll-alloy-hardforks = { path = "crates/scroll/alloy/hardforks" }
scroll-alloy-hardforks = { path = "crates/scroll/alloy/hardforks", default-features = false }
scroll-alloy-network = { path = "crates/scroll/alloy/network" }
scroll-alloy-rpc-types = { path = "crates/scroll/alloy/rpc-types" }
scroll-alloy-rpc-types-engine = { path = "crates/scroll/alloy/rpc-types-engine" }
scroll-alloy-rpc-types-engine = { path = "crates/scroll/alloy/rpc-types-engine", default-features = false }
scroll-alloy-provider = { path = "crates/scroll/alloy/provider" }
reth-scroll-chainspec = { path = "crates/scroll/chainspec" }
reth-scroll-chainspec = { path = "crates/scroll/chainspec", default-features = false }
reth-scroll-cli = { path = "crates/scroll/cli" }
reth-scroll-consensus = { path = "crates/scroll/consensus" }
reth-scroll-evm = { path = "crates/scroll/evm" }
reth-scroll-engine-primitives = { path = "crates/scroll/engine-primitives" }
reth-scroll-forks = { path = "crates/scroll/hardforks" }
reth-scroll-forks = { path = "crates/scroll/hardforks", default-features = false }
reth-scroll-node = { path = "crates/scroll/node" }
reth-scroll-payload = { path = "crates/scroll/payload" }
reth-scroll-primitives = { path = "crates/scroll/primitives" }
Expand All @@ -546,7 +546,7 @@ op-alloy-rpc-jsonrpsee = { version = "0.12.0", default-features = false }

# misc
aquamarine = "0.6"
auto_impl = "1"
auto_impl = { version = "1", default-features = false }
backon = { version = "1.2", default-features = false, features = ["std-blocking-sleep", "tokio-sleep"] }
bincode = "1.3"
bitflags = "2.4"
Expand Down
1 change: 1 addition & 0 deletions crates/payload/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ std = [
"serde/std",
"thiserror/std",
"reth-primitives-traits/std",
"scroll-alloy-rpc-types-engine?/std",
]
op = [
"dep:op-alloy-rpc-types-engine",
Expand Down
1 change: 1 addition & 0 deletions crates/primitives-traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ std = [
"reth-chainspec/std",
"revm-bytecode/std",
"revm-state/std",
"scroll-alloy-consensus?/std",
]
secp256k1 = ["dep:secp256k1"]
test-utils = [
Expand Down
6 changes: 3 additions & 3 deletions crates/scroll/alloy/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ default = [
std = [
"serde/std",
"alloy-primitives/std",
"reth-codecs/std",
"reth-codecs?/std",
"alloy-consensus/std",
"alloy-eips/std",
"alloy-rlp/std",
Expand Down Expand Up @@ -85,7 +85,7 @@ arbitrary = [
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-serde/arbitrary",
"reth-codecs/arbitrary",
"reth-codecs?/arbitrary",
"alloy-primitives/rand",
]
serde = [
Expand All @@ -95,7 +95,7 @@ serde = [
"alloy-consensus/serde",
"alloy-eips/serde",
"rand/serde",
"reth-codecs/serde",
"reth-codecs?/serde",
]
serde-bincode-compat = [
"alloy-consensus/serde-bincode-compat",
Expand Down
20 changes: 11 additions & 9 deletions crates/scroll/alloy/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ workspace = true

[dependencies]
# alloy
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-evm.workspace = true
alloy-primitives.workspace = true
alloy-consensus = { workspace = true, default-features = false }
alloy-eips = { workspace = true, default-features = false }
alloy-evm = { workspace = true, default-features = false }
alloy-primitives = { workspace = true, default-features = false }

# revm
revm = { workspace = true, features = ["optional_no_base_fee"] }
revm = { workspace = true, default-features = false, features = ["optional_no_base_fee"] }

# scroll
revm-scroll.workspace = true
revm-scroll = { workspace = true, default-features = false }

# scroll
scroll-alloy-consensus.workspace = true
scroll-alloy-hardforks.workspace = true
scroll-alloy-consensus = { workspace = true, default-features = false }
scroll-alloy-hardforks = { workspace = true, default-features = false }

# misc
auto_impl.workspace = true
auto_impl = { workspace = true, default-features = false }
serde = { workspace = true, default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
Expand All @@ -44,6 +44,8 @@ std = [
"serde/std",
"alloy-consensus/std",
"alloy-eips/std",
"scroll-alloy-consensus/std",
"scroll-alloy-hardforks/std",
]
serde = [
"dep:serde",
Expand Down
4 changes: 3 additions & 1 deletion crates/scroll/alloy/hardforks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ workspace = true
alloy-hardforks.workspace = true

# misc
auto_impl.workspace = true
auto_impl = { workspace = true, default-features = false }
serde = { workspace = true, optional = true }

[features]
default = ["std"]
std = ["serde?/std"]
serde = ["dep:serde", "alloy-hardforks/serde"]
5 changes: 5 additions & 0 deletions crates/scroll/alloy/hardforks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
//! Scroll-Reth hard forks.

#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc as std;

use alloy_hardforks::{EthereumHardfork, EthereumHardforks, ForkCondition};
use std::vec::Vec;

pub use hardfork::ScrollHardfork;
pub mod hardfork;
Expand Down
2 changes: 1 addition & 1 deletion crates/scroll/alloy/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ reth-rpc-engine-api.workspace = true
reth-scroll-engine-primitives.workspace = true
reth-scroll-node.workspace = true
reth-scroll-payload = { workspace = true, features = ["test-utils"] }
reth-scroll-primitives.workspace = true
reth-scroll-chainspec.workspace = true
reth-tasks.workspace = true
reth-tracing.workspace = true
Expand All @@ -65,4 +64,5 @@ std = [
"reth-primitives-traits/std",
"reth-scroll-payload/std",
"futures-util/std",
"reth-scroll-chainspec/std",
]
4 changes: 2 additions & 2 deletions crates/scroll/alloy/provider/src/engine/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use reqwest::Url;
use scroll_alloy_network::Scroll;
use scroll_alloy_rpc_types_engine::ScrollPayloadAttributes;

/// An authenticated [`alloy_provider::Provider`] to the [`super::ScrollEngineApi`].
/// An authenticated [`alloy_provider::Provider`] to the [`ScrollEngineApi`].
#[derive(Debug, Clone, Deref)]
pub struct ScrollAuthEngineApiProvider<N: Network = Scroll> {
auth_provider: RootProvider<N>,
Expand All @@ -43,7 +43,7 @@ impl ScrollAuthEngineApiProvider {
}

#[async_trait::async_trait]
impl ScrollEngineApi<scroll_alloy_network::Scroll> for ScrollAuthEngineApiProvider {
impl ScrollEngineApi<Scroll> for ScrollAuthEngineApiProvider {
async fn new_payload_v1(&self, payload: ExecutionPayloadV1) -> TransportResult<PayloadStatus> {
self.auth_provider.new_payload_v1(payload).await
}
Expand Down
1 change: 1 addition & 0 deletions crates/scroll/alloy/rpc-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ std = [
"derive_more/std",
"serde/std",
"serde_json/std",
"scroll-alloy-consensus/std",
]
33 changes: 17 additions & 16 deletions crates/scroll/chainspec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ workspace = true
[dependencies]
# reth
reth-chainspec = { workspace = true, features = ["scroll"] }
reth-ethereum-forks.workspace = true
reth-network-peers.workspace = true
reth-primitives-traits.workspace = true
reth-trie-common.workspace = true
reth-ethereum-forks = { workspace = true, default-features = false }
reth-network-peers = { workspace = true, default-features = false }
reth-primitives-traits = { workspace = true, default-features = false }
reth-trie-common = { workspace = true, default-features = false }

# scroll
reth-scroll-forks.workspace = true
scroll-alloy-hardforks.workspace = true
reth-scroll-forks = { workspace = true, default-features = false }
scroll-alloy-hardforks = { workspace = true, default-features = false }

# ethereum
alloy-chains.workspace = true
alloy-genesis.workspace = true
alloy-primitives.workspace = true
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-serde.workspace = true
alloy-chains = { workspace = true, default-features = false }
alloy-genesis = { workspace = true, default-features = false }
alloy-primitives = { workspace = true, default-features = false }
alloy-consensus = { workspace = true, default-features = false }
alloy-eips = { workspace = true, default-features = false }
alloy-serde = { workspace = true, default-features = false }

# io
serde_json.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, default-features = false }
serde = { workspace = true, default-features = false, features = ["derive"] }

# misc
derive_more.workspace = true
once_cell.workspace = true
derive_more = { workspace = true, default-features = false }
once_cell = { workspace = true, default-features = false }

[dev-dependencies]
alloy-genesis.workspace = true
Expand All @@ -62,4 +62,5 @@ std = [
"derive_more/std",
"reth-network-peers/std",
"serde_json/std",
"scroll-alloy-hardforks/std",
]
3 changes: 3 additions & 0 deletions crates/scroll/engine-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ std = [
"reth-primitives-traits/std",
"serde/std",
"sha2/std",
"reth-scroll-chainspec/std",
"scroll-alloy-hardforks/std",
"scroll-alloy-rpc-types-engine/std",
]
2 changes: 2 additions & 0 deletions crates/scroll/engine-primitives/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! The engine primitives for Scroll.

#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc as std;

mod payload;
pub use payload::{
Expand Down
1 change: 1 addition & 0 deletions crates/scroll/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ std = [
"revm/std",
"thiserror/std",
"tracing/std",
"scroll-alloy-hardforks/std",
]
1 change: 1 addition & 0 deletions crates/scroll/hardforks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ std = [
"serde?/std",
"alloy-chains/std",
"reth-ethereum-forks/std",
"scroll-alloy-hardforks/std",
]
serde = [
"dep:serde",
Expand Down
4 changes: 4 additions & 0 deletions crates/scroll/hardforks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Scroll-Reth hard forks.

#![cfg_attr(not(feature = "std"), no_std)]
#![doc = include_str!("../docs/hardforks.md")]
#[cfg(not(feature = "std"))]
extern crate alloc as std;

use reth_ethereum_forks::{ChainHardforks, EthereumHardfork, ForkCondition, Hardfork};

Expand All @@ -11,6 +14,7 @@ pub use scroll_alloy_hardforks::{ScrollHardfork, ScrollHardforks};
use once_cell::sync::Lazy as LazyLock;
#[cfg(feature = "std")]
use std::sync::LazyLock;
use std::vec;

/// Scroll mainnet hardforks
pub static SCROLL_MAINNET_HARDFORKS: LazyLock<ChainHardforks> = LazyLock::new(|| {
Expand Down
4 changes: 4 additions & 0 deletions crates/scroll/payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ std = [
"revm/std",
"thiserror/std",
"tracing/std",
"reth-scroll-chainspec/std",
"reth-scroll-forks/std",
"scroll-alloy-consensus/std",
"scroll-alloy-hardforks/std",
]
test-utils = [
"dep:futures-util",
Expand Down
Loading