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

feat: portable sbv-primitives #89

Merged
merged 22 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
366 changes: 168 additions & 198 deletions Cargo.lock

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ alloy-trie = { version = "0.7", default-features = false }
# https://github.com/alloy-rs/core
alloy-primitives = { version = "0.8", default-features = false, features = ["map-hashbrown", "map-fxhash", "rkyv"] }

reth-chainspec = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-evm = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-evm-ethereum = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-ethereum-forks = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-execution-types = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-primitives = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-storage-errors = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-trie = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-trie-sparse = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }

reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }

scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth", branch = "feat/euclid-v2", default-features = false }
reth-chainspec = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-evm = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-evm-ethereum = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-ethereum-forks = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-execution-types = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-primitives = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-storage-errors = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-trie = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-trie-sparse = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }

reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }

scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth", branch = "zkvm/euclid-v2", default-features = false }

async-trait = "0.1"
auto_impl = "1.2"
Expand Down Expand Up @@ -121,10 +121,10 @@ ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" }

alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.18" }

revm = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
revm-interpreter = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
revm-precompile = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
revm-primitives = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
#revm = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
#revm-interpreter = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
#revm-precompile = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }
#revm-primitives = { git = "https://github.com/scroll-tech/revm", branch = "scroll-evm-executor/feat/v55/euclid-v2" }

# for local development
# [patch."https://github.com/scroll-tech/revm"]
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/chainspec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::sync::Arc;

pub use reth_chainspec;
pub use reth_chainspec::*;

#[cfg(feature = "scroll")]
Expand Down
1 change: 0 additions & 1 deletion crates/primitives/src/types/auth_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub struct Authorization {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct SignedAuthorization {
/// Inner authorization.
#[cfg_attr(feature = "serde", serde(flatten))]
pub inner: Authorization,
/// Signature parity value. We allow any [`U8`] here, however, the only valid values are `0`
/// and `1` and anything else will result in error during recovery.
Expand Down
9 changes: 3 additions & 6 deletions crates/primitives/src/types/block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ pub struct BlockHeader {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
#[cfg_attr(
Expand All @@ -177,7 +176,7 @@ pub struct BlockHeader {
/// <https://eips.ethereum.org/EIPS/eip-4895>
#[cfg_attr(
feature = "serde",
serde(default, skip_serializing_if = "Option::is_none")
serde(default)
)]
#[cfg_attr(
feature = "rkyv",
Expand All @@ -193,7 +192,6 @@ pub struct BlockHeader {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
#[cfg_attr(
Expand All @@ -211,7 +209,6 @@ pub struct BlockHeader {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
#[cfg_attr(
Expand All @@ -230,7 +227,7 @@ pub struct BlockHeader {
/// The beacon roots contract handles root storage, enhancing Ethereum's functionalities.
#[cfg_attr(
feature = "serde",
serde(default, skip_serializing_if = "Option::is_none")
serde(default)
)]
#[cfg_attr(
feature = "rkyv",
Expand All @@ -245,7 +242,7 @@ pub struct BlockHeader {
/// [EIP-7685]: https://eips.ethereum.org/EIPS/eip-7685
#[cfg_attr(
feature = "serde",
serde(default, skip_serializing_if = "Option::is_none")
serde(default)
)]
#[cfg_attr(
feature = "rkyv",
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/types/scroll/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::B256;
use serde::{Deserialize, Serialize};

mod chunk;
pub use chunk::*;
Expand Down
10 changes: 1 addition & 9 deletions crates/primitives/src/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pub struct Transaction {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
pub gas_price: Option<u128>,
Expand All @@ -57,7 +56,6 @@ pub struct Transaction {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
pub max_priority_fee_per_gas: Option<u128>,
Expand All @@ -71,7 +69,6 @@ pub struct Transaction {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
pub max_fee_per_blob_gas: Option<u128>,
Expand All @@ -89,7 +86,7 @@ pub struct Transaction {
)]
#[cfg_attr(
feature = "serde",
serde(flatten, skip_serializing_if = "Option::is_none")
serde(flatten)
)]
pub signature: Option<Signature>,
/// The chain id of the transaction, if any.
Expand All @@ -101,7 +98,6 @@ pub struct Transaction {
feature = "serde",
serde(
default,
skip_serializing_if = "Option::is_none",
with = "alloy_serde::quantity::opt"
)
)]
Expand All @@ -111,7 +107,6 @@ pub struct Transaction {
feature = "rkyv",
rkyv(attr(doc = "Contains the blob hashes for eip-4844 transactions."))
)]
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub blob_versioned_hashes: Option<Vec<B256>>,
/// EIP2930
///
Expand All @@ -120,15 +115,13 @@ pub struct Transaction {
feature = "rkyv",
rkyv(attr(doc = "EIP2930 Pre-pay to warm storage access."))
)]
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub access_list: Option<AccessList>,
/// EIP7702
///
/// Authorizations are used to temporarily set the code of its signer to
/// the code referenced by `address`. These also include a `chain_id` (which
/// can be set to zero and not evaluated) as well as an optional `nonce`.
#[cfg_attr(feature = "rkyv", rkyv(attr(doc = "EIP7702 Authorizations")))]
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub authorization_list: Option<Vec<SignedAuthorization>>,
/// EIP2718
///
Expand All @@ -151,7 +144,6 @@ pub struct Transaction {
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
pub queue_index: Option<u64>,
Expand Down
10 changes: 6 additions & 4 deletions testdata/scroll_witness/euclid_v2/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
"max_fee_per_gas": "0x3b9aca00",
"max_priority_fee_per_gas": "0x1",
"input": "0x6080604052348015600e575f80fd5b506104a58061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063c566b2091461002d575b5f80fd5b61004760048036038101906100429190610298565b61005e565b604051610055929190610359565b60405180910390f35b5f606061010073ffffffffffffffffffffffffffffffffffffffff168360405161008891906103c1565b5f604051808303815f865af19150503d805f81146100c1576040519150601f19603f3d011682016040523d82523d5f602084013e6100c6565b606091505b5080925081935050508161010f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161010690610431565b60405180910390fd5b7fa82cc8725dfeb485badf0c830fc554a37ed268855e35805056c77c86946342098160405161013e919061044f565b60405180910390a1915091565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6101aa82610164565b810181811067ffffffffffffffff821117156101c9576101c8610174565b5b80604052505050565b5f6101db61014b565b90506101e782826101a1565b919050565b5f67ffffffffffffffff82111561020657610205610174565b5b61020f82610164565b9050602081019050919050565b828183375f83830152505050565b5f61023c610237846101ec565b6101d2565b90508281526020810184848401111561025857610257610160565b5b61026384828561021c565b509392505050565b5f82601f83011261027f5761027e61015c565b5b813561028f84826020860161022a565b91505092915050565b5f602082840312156102ad576102ac610154565b5b5f82013567ffffffffffffffff8111156102ca576102c9610158565b5b6102d68482850161026b565b91505092915050565b5f8115159050919050565b6102f3816102df565b82525050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f61032b826102f9565b6103358185610303565b9350610345818560208601610313565b61034e81610164565b840191505092915050565b5f60408201905061036c5f8301856102ea565b818103602083015261037e8184610321565b90509392505050565b5f81905092915050565b5f61039b826102f9565b6103a58185610387565b93506103b5818560208601610313565b80840191505092915050565b5f6103cc8284610391565b915081905092915050565b5f82825260208201905092915050565b7f507265636f6d70696c652063616c6c206661696c6564000000000000000000005f82015250565b5f61041b6016836103d7565b9150610426826103e7565b602082019050919050565b5f6020820190508181035f8301526104488161040f565b9050919050565b5f6020820190508181035f8301526104678184610321565b90509291505056fea26469706673582212200f74a92387ae88fee4fc7c9238aa9bb6091756accf22046271bf9d976083ed3664736f6c63430008190033",
"r": "0xe6de9d0c2690cb78e410ee6a968110d5a713de6b9f613986ff5a987d32afea31",
"s": "0x4e07c4fe9b184edef8c2c7a58e7b252fc19542c11474cd428d24c9da11bb9fcb",
"y_parity": true,
"chain_id": "0x51615",
"access_list": [],
"transaction_type": 2
"transaction_type": 2,
"signature": {
"r": "0xe6de9d0c2690cb78e410ee6a968110d5a713de6b9f613986ff5a987d32afea31",
"s": "0x4e07c4fe9b184edef8c2c7a58e7b252fc19542c11474cd428d24c9da11bb9fcb",
"y_parity": true
}
}
],
"withdrawals": null,
Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.