Skip to content

Commit

Permalink
Merge branch 'main' into operator-fee
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Dec 4, 2024
2 parents 0a31806 + 84cabaf commit 9bc01c7
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 17 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.3](https://github.com/alloy-rs/op-alloy
/releases/tag/v0.7.3) - 2024-12-04

### Dependencies

- Enable alloy-primitives/arbitrary in dev-deps ([#329](https://github.com/alloy-rs/op-alloy/issues/329))

### Features

- [consensus] Tx envelope tx hash ([#324](https://github.com/alloy-rs/op-alloy/issues/324))
- Add miner extension trait ([#325](https://github.com/alloy-rs/op-alloy/issues/325))
- [engine] FCU Version ([#321](https://github.com/alloy-rs/op-alloy/issues/321))
- Add typed 2718 for txtype ([#323](https://github.com/alloy-rs/op-alloy/issues/323))

### Miscellaneous Tasks

- [registry] Update SCR ([#327](https://github.com/alloy-rs/op-alloy/issues/327))

### Other

- Add placeholder for isthmus time to genesis ([#331](https://github.com/alloy-rs/op-alloy/issues/331))
- Propagate arbitrary ([#330](https://github.com/alloy-rs/op-alloy/issues/330))

## [0.7.2](https://github.com/alloy-rs/op-alloy
/releases/tag/v0.7.2) - 2024-12-02

Expand All @@ -14,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Miscellaneous Tasks

- Release 0.7.2
- Release 0.7.2

## [0.7.1](https://github.com/alloy-rs/op-alloy
Expand Down
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.7.2"
version = "0.7.3"
edition = "2021"
rust-version = "1.81"
authors = ["Alloy Contributors"]
Expand Down Expand Up @@ -36,15 +36,15 @@ rustdoc-args = ["--cfg", "docsrs"]

[workspace.dependencies]
# Workspace
op-alloy-genesis = { version = "0.7.2", path = "crates/genesis", default-features = false }
op-alloy-protocol = { version = "0.7.2", path = "crates/protocol", default-features = false }
op-alloy-consensus = { version = "0.7.2", path = "crates/consensus", default-features = false }
op-alloy-network = { version = "0.7.2", path = "crates/network", default-features = false }
op-alloy-provider = { version = "0.7.2", path = "crates/provider", default-features = false }
op-alloy-registry = { version = "0.7.2", path = "crates/registry", default-features = false }
op-alloy-rpc-types = { version = "0.7.2", path = "crates/rpc-types", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.7.2", path = "crates/rpc-jsonrpsee", default-features = false }
op-alloy-rpc-types-engine = { version = "0.7.2", path = "crates/rpc-types-engine", default-features = false }
op-alloy-genesis = { version = "0.7.3", path = "crates/genesis", default-features = false }
op-alloy-protocol = { version = "0.7.3", path = "crates/protocol", default-features = false }
op-alloy-consensus = { version = "0.7.3", path = "crates/consensus", default-features = false }
op-alloy-network = { version = "0.7.3", path = "crates/network", default-features = false }
op-alloy-provider = { version = "0.7.3", path = "crates/provider", default-features = false }
op-alloy-registry = { version = "0.7.3", path = "crates/registry", default-features = false }
op-alloy-rpc-types = { version = "0.7.3", path = "crates/rpc-types", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.7.3", path = "crates/rpc-jsonrpsee", default-features = false }
op-alloy-rpc-types-engine = { version = "0.7.3", path = "crates/rpc-types-engine", default-features = false }

# Alloy
alloy-eips = { version = "0.7.2", default-features = false }
Expand Down
11 changes: 9 additions & 2 deletions crates/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@ serde_json.workspace = true
alloy-signer.workspace = true
tokio = { workspace = true, features = ["macros"] }
arbitrary = { workspace = true, features = ["derive"] }
alloy-primitives = { workspace = true, features = ["rand"] }
alloy-primitives = { workspace = true, features = ["rand", "arbitrary"] }

[features]
default = ["std"]
std = ["alloy-eips/std", "alloy-consensus/std", "derive_more/std"]
k256 = ["alloy-primitives/k256", "alloy-consensus/k256"]
kzg = ["alloy-eips/kzg", "alloy-consensus/kzg", "std"]
arbitrary = ["std", "dep:arbitrary", "alloy-consensus/arbitrary", "alloy-eips/arbitrary", "alloy-primitives/rand"]
arbitrary = [
"std",
"dep:arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/rand",
"alloy-primitives/arbitrary",
]
serde = ["dep:serde", "dep:alloy-serde", "alloy-primitives/serde", "alloy-consensus/serde", "alloy-eips/serde"]
serde-bincode-compat = ["serde_with"]
11 changes: 11 additions & 0 deletions crates/consensus/src/transaction/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,17 @@ impl OpTxEnvelope {
}
}

/// Returns the inner transaction hash.
pub fn tx_hash(&self) -> B256 {
match self {
Self::Legacy(tx) => *tx.hash(),
Self::Eip1559(tx) => *tx.hash(),
Self::Eip2930(tx) => *tx.hash(),
Self::Eip7702(tx) => *tx.hash(),
Self::Deposit(tx) => tx.tx_hash(),
}
}

/// Return the length of the inner txn, including type byte length
pub fn eip2718_encoded_length(&self) -> usize {
match self {
Expand Down
11 changes: 9 additions & 2 deletions crates/genesis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ serde_repr = { workspace = true, optional = true }
rand.workspace = true
serde_json.workspace = true
arbitrary = { workspace = true, features = ["derive"] }
alloy-primitives = { workspace = true, features = ["rand"] }
alloy-primitives = { workspace = true, features = ["rand", "arbitrary"] }

[features]
default = ["serde", "std"]
std = []
arbitrary = ["std", "dep:arbitrary", "alloy-consensus/arbitrary", "alloy-eips/arbitrary", "alloy-primitives/rand"]
arbitrary = [
"std",
"dep:arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/rand",
"alloy-primitives/arbitrary",
]
serde = ["dep:serde", "dep:serde_repr", "alloy-primitives/serde", "alloy-eips/serde", "alloy-consensus/serde"]
3 changes: 3 additions & 0 deletions crates/genesis/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ impl ChainConfig {
if cfg.holocene_time.is_none() && defaults.holocene_time.is_some_and(|t| t > super_time) {
cfg.holocene_time = defaults.holocene_time;
}
if cfg.isthmus_time.is_none() && defaults.isthmus_time.is_some_and(|t| t > super_time) {
cfg.isthmus_time = defaults.isthmus_time;
}
}

/// Returns the base fee params for the chain.
Expand Down
10 changes: 9 additions & 1 deletion crates/protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,21 @@ alloy-sol-types.workspace = true
tokio = { workspace = true, features = ["full"] }
arbitrary = { workspace = true, features = ["derive"] }
tracing-subscriber = { workspace = true, features = ["fmt"] }
alloy-primitives = { workspace = true, features = ["arbitrary"] }

[features]
default = ["serde", "std"]
test-utils = [
"dep:spin",
"dep:tracing-subscriber",
]
arbitrary = ["std", "dep:arbitrary", "alloy-consensus/arbitrary", "alloy-eips/arbitrary", "alloy-primitives/rand"]
arbitrary = [
"std",
"dep:arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/rand",
"alloy-primitives/arbitrary",
]
std = ["op-alloy-consensus/std", "op-alloy-genesis/std", "brotli/std"]
serde = ["dep:serde", "dep:alloy-serde", "op-alloy-consensus/serde", "op-alloy-genesis/serde"]
12 changes: 11 additions & 1 deletion crates/rpc-jsonrpsee/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Rollup Node
use alloy_eips::BlockNumberOrTag;
use alloy_primitives::B256;
use alloy_primitives::{B256, U64};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use op_alloy_rpc_types::{
OutputResponse, PeerDump, PeerInfo, PeerStats, RollupConfig, SafeHeadResponse, SyncStatus,
Expand Down Expand Up @@ -135,3 +135,13 @@ pub trait EngineApiExt {
#[method(name = "signalSuperchainV1")]
async fn signal_superchain_v1(&self, signal: SuperchainSignal) -> RpcResult<ProtocolVersion>;
}

/// Op API extension for controlling the miner.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "miner"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "miner"))]
pub trait MinerApiExt {
/// Sets the maximum data availability size of any tx allowed in a block, and the total max l1
/// data size of the block. 0 means no maximum.
#[method(name = "setMaxDASize")]
async fn set_max_da_size(&self, max_tx_size: U64, max_block_size: U64) -> RpcResult<()>;
}
8 changes: 7 additions & 1 deletion crates/rpc-types-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ arbitrary = { workspace = true, features = ["derive"], optional = true }
arbtest.workspace = true
serde_json.workspace = true
arbitrary = { workspace = true, features = ["derive"] }
alloy-primitives = { workspace = true, features = ["arbitrary"] }

[features]
default = ["std", "serde"]
Expand All @@ -60,4 +61,9 @@ serde = [
"op-alloy-protocol/serde",
"alloy-rpc-types-engine/serde",
]
arbitrary = ["std", "dep:arbitrary", "alloy-primitives/arbitrary", "alloy-primitives/rand"]
arbitrary = [
"std",
"dep:arbitrary",
"alloy-primitives/arbitrary",
"alloy-primitives/rand",
]
6 changes: 6 additions & 0 deletions crates/rpc-types/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub struct OpGenesisInfo {
pub granite_time: Option<u64>,
/// holocene hardfork timestamp
pub holocene_time: Option<u64>,
/// isthmus hardfork timestamp
pub isthmus_time: Option<u64>,
}

impl OpGenesisInfo {
Expand Down Expand Up @@ -127,6 +129,7 @@ mod tests {
fjord_time: None,
granite_time: None,
holocene_time: None,
isthmus_time: None,
}
);
}
Expand Down Expand Up @@ -185,6 +188,7 @@ mod tests {
fjord_time: None,
granite_time: None,
holocene_time: None,
isthmus_time: None,
}),
base_fee_info: Some(OpBaseFeeInfo {
eip1559_elasticity: None,
Expand All @@ -207,6 +211,7 @@ mod tests {
fjord_time: None,
granite_time: None,
holocene_time: None,
isthmus_time: None,
}),
base_fee_info: Some(OpBaseFeeInfo {
eip1559_elasticity: None,
Expand Down Expand Up @@ -245,6 +250,7 @@ mod tests {
fjord_time: Some(0),
granite_time: Some(0),
holocene_time: Some(0),
isthmus_time: None,
}),
base_fee_info: None,
}
Expand Down

0 comments on commit 9bc01c7

Please sign in to comment.