Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit ec512d0

Browse files
committed
feat: port op-alloy -> maili in all crates
1 parent f4b0a07 commit ec512d0

31 files changed

+75
-65
lines changed

crates/driver/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ alloy-provider = { workspace = true, features = ["ipc", "ws", "reqwest"] }
3333
alloy-primitives = { workspace = true, features = ["map"] }
3434

3535
# Op Alloy
36-
op-alloy-genesis.workspace = true
37-
op-alloy-protocol.workspace = true
3836
op-alloy-rpc-types-engine.workspace = true
3937

38+
# Maili
39+
maili-genesis.workspace = true
40+
maili-protocol.workspace = true
41+
4042
# Reth
4143
reth-primitives.workspace = true
4244
reth-execution-types.workspace = true

crates/driver/src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use alloy_rpc_types_engine::JwtSecret;
44
use kona_derive::traits::ChainProvider;
55
use kona_driver::PipelineCursor;
6-
use op_alloy_genesis::RollupConfig;
7-
use op_alloy_protocol::{BatchValidationProvider, BlockInfo, L2BlockInfo};
6+
use maili_genesis::RollupConfig;
7+
use maili_protocol::{BatchValidationProvider, BlockInfo, L2BlockInfo};
88
use serde::{Deserialize, Serialize};
99
use std::sync::Arc;
1010
use url::Url;

crates/driver/src/context/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ fn parse_reth_header_to_alloy_rpc(block: &reth_primitives::SealedBlock) -> Heade
139139
blob_gas_used: block.blob_gas_used,
140140
excess_blob_gas: block.excess_blob_gas,
141141
parent_beacon_block_root: block.parent_beacon_block_root,
142-
requests_hash: block.requests_hash,
143-
target_blobs_per_block: None,
142+
requests_hash: block.requests_root,
144143
},
145144
}
146145
}

crates/driver/src/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ where
141141
loop {
142142
tokio::select! {
143143
result = driver.advance_to_target(&self.cfg.rollup_config, None) => match result {
144-
Ok((bn, hash)) => {
144+
Ok((bn, hash, _output_root)) => {
145145
error!("Driver unexpectedly stopped at target block: {} {}", bn, hash);
146146
}
147147
Err(e) => {

crates/driver/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![doc = include_str!("../README.md")]
2-
#![doc(issue_tracker_base_url = "https://github.com/anton-rs/hilo/issues/")]
2+
#![doc(issue_tracker_base_url = "https://github.com/op-rs/hilo/issues/")]
33
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
44
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
55

crates/driver/src/pipeline.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use kona_derive::{
1414
types::{PipelineResult, Signal, StepResult},
1515
};
1616
use kona_driver::{DriverPipeline, PipelineCursor};
17-
use op_alloy_genesis::{RollupConfig, SystemConfig};
18-
use op_alloy_protocol::{BlockInfo, L2BlockInfo};
17+
use maili_genesis::{RollupConfig, SystemConfig};
18+
use maili_protocol::{BlockInfo, L2BlockInfo};
1919
use op_alloy_rpc_types_engine::OpAttributesWithParent;
2020
use std::{boxed::Box, sync::Arc};
2121

crates/engine/Cargo.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ alloy-transport-http = { workspace = true, features = ["jwt-auth"] }
3131
alloy-rpc-types-engine = { workspace = true, features = ["jwt", "serde"] }
3232

3333
# Op Alloy
34-
op-alloy-genesis.workspace = true
3534
op-alloy-provider.workspace = true
36-
op-alloy-consensus.workspace = true
37-
op-alloy-protocol.workspace = true
3835
op-alloy-rpc-types-engine.workspace = true
36+
op-alloy-consensus.workspace = true
37+
38+
# Maili
39+
maili-genesis.workspace = true
40+
maili-protocol.workspace = true
3941

4042
# Misc
4143
async-trait.workspace = true

crates/engine/src/client.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use alloy_eips::eip1898::BlockNumberOrTag;
44
use alloy_network::AnyNetwork;
55
use alloy_primitives::{Bytes, B256};
6-
use alloy_provider::{ReqwestProvider, RootProvider /* , ext::EngineApi */};
6+
use alloy_provider::{ReqwestProvider, RootProvider};
77
use alloy_rpc_client::RpcClient;
88
use alloy_rpc_types_engine::{
99
ExecutionPayloadEnvelopeV2, ExecutionPayloadFieldV2, ExecutionPayloadInputV2,
@@ -19,8 +19,8 @@ use alloy_transport_http::{
1919
};
2020
use async_trait::async_trait;
2121
use http_body_util::Full;
22-
use op_alloy_genesis::RollupConfig;
23-
use op_alloy_protocol::{BatchValidationProvider, BlockInfo, L2BlockInfo};
22+
use maili_genesis::RollupConfig;
23+
use maili_protocol::{BatchValidationProvider, BlockInfo, L2BlockInfo};
2424
use op_alloy_provider::ext::engine::OpEngineApi;
2525
use op_alloy_rpc_types_engine::{OpExecutionPayloadEnvelopeV3, OpPayloadAttributes};
2626
use std::sync::Arc;
@@ -66,7 +66,7 @@ impl EngineClient {
6666
/// Returns which fork choice version to use based on the timestamp
6767
/// and rollup config.
6868
pub fn fork_choice_version(&self, timestamp: u64) -> u64 {
69-
// TODO: replace this with https://github.com/alloy-rs/op-alloy/pull/321
69+
// TODO: replace this with https://github.com/alloy-rs/maili/pull/321
7070
// once it's merged and updated in kona.
7171
if self.cfg.ecotone_time.is_some_and(|t| timestamp >= t) {
7272
// Cancun

crates/engine/src/controller.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use alloy_rpc_types_engine::{
1111
use async_trait::async_trait;
1212
use hilo_providers_alloy::AlloyL2ChainProvider;
1313
use kona_driver::Executor;
14+
use maili_genesis::RollupConfig;
15+
use maili_protocol::{BatchValidationProvider, BlockInfo};
1416
use op_alloy_consensus::OpBlock;
15-
use op_alloy_genesis::RollupConfig;
16-
use op_alloy_protocol::{BatchValidationProvider, BlockInfo};
1717
use op_alloy_rpc_types_engine::OpPayloadAttributes;
1818
use std::{sync::Arc, time::Duration};
1919
use tokio::time::sleep;

crates/engine/src/epoch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Contains an epoch type.
22
33
use alloy_primitives::B256;
4-
use op_alloy_protocol::BlockInfo;
4+
use maili_protocol::BlockInfo;
55

66
/// L1 epoch block
77
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]

crates/engine/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![doc = include_str!("../README.md")]
2-
#![doc(issue_tracker_base_url = "https://github.com/anton-rs/hilo/issues/")]
2+
#![doc(issue_tracker_base_url = "https://github.com/op-rs/hilo/issues/")]
33
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
44
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
55

crates/engine/src/traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloy_rpc_types_engine::{
77
ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus,
88
};
99
use async_trait::async_trait;
10-
use op_alloy_protocol::L2BlockInfo;
10+
use maili_protocol::L2BlockInfo;
1111
use op_alloy_rpc_types_engine::{OpExecutionPayloadEnvelopeV3, OpPayloadAttributes};
1212

1313
/// Engine trait specifies the interface between the hilo-engine and the engine-api.

crates/engine/src/validator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ impl TrustedPayloadValidator {
102102
// Withdrawals on optimism are always empty, *after* canyon (Shanghai) activation
103103
withdrawals: (header.timestamp >= self.canyon_activation).then_some(Vec::default()),
104104
parent_beacon_block_root: header.parent_beacon_block_root,
105-
target_blobs_per_block: header.target_blobs_per_block,
106-
max_blobs_per_block: None,
107105
},
108106
transactions: Some(transactions),
109107
no_tx_pool: Some(true),

crates/hilo/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
## `hilo`
22

3-
<a href="https://github.com/anton-rs/hilo/actions/workflows/rust_ci.yaml"><img src="https://github.com/anton-rs/hilo/actions/workflows/rust_ci.yaml/badge.svg?label=ci" alt="CI"></a>
3+
<a href="https://github.com/op-rs/hilo/actions/workflows/rust_ci.yaml"><img src="https://github.com/op-rs/hilo/actions/workflows/rust_ci.yaml/badge.svg?label=ci" alt="CI"></a>
44
<a href="https://crates.io/crates/hilo"><img src="https://img.shields.io/crates/v/hilo.svg?label=hilo&labelColor=2a2f35" alt="Kona Derive Alloy"></a>
5-
<a href="https://github.com/anton-rs/hilo/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-d1d1f6.svg?label=license&labelColor=2a2f35" alt="License"></a>
6-
<a href="https://img.shields.io/codecov/c/github/anton-rs/hilo"><img src="https://img.shields.io/codecov/c/github/anton-rs/hilo" alt="Codecov"></a>
7-
5+
<a href="https://github.com/op-rs/hilo/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-d1d1f6.svg?label=license&labelColor=2a2f35" alt="License"></a>
6+
<a href="https://img.shields.io/codecov/c/github/op-rs/hilo"><img src="https://img.shields.io/codecov/c/github/op-rs/hilo" alt="Codecov"></a>
87

98
A suite of `std` components for the Superchain.
109

crates/hilo/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![doc = include_str!("../README.md")]
22
#![doc(
3-
html_logo_url = "https://raw.githubusercontent.com/anton-rs/hilo/main/assets/alloy.jpg",
4-
html_favicon_url = "https://raw.githubusercontent.com/anton-rs/hilo/main/assets/favicon.ico"
3+
html_logo_url = "https://raw.githubusercontent.com/op-rs/hilo/main/assets/alloy.jpg",
4+
html_favicon_url = "https://raw.githubusercontent.com/op-rs/hilo/main/assets/favicon.ico"
55
)]
66
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
77
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

crates/net/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ futures.workspace = true
2727
discv5.workspace = true
2828
libp2p = { workspace = true, features = ["macros", "tokio", "tcp", "noise", "gossipsub", "ping", "yamux"] }
2929
openssl = { workspace = true, features = ["vendored"] }
30-
libp2p-identity = { workspace = true, features = [ "secp256k1" ] }
30+
libp2p-identity = { workspace = true, features = ["secp256k1"] }
3131

3232
# Misc
3333
eyre.workspace = true

crates/net/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![doc = include_str!("../README.md")]
2-
#![doc(issue_tracker_base_url = "https://github.com/anton-rs/hilo/issues/")]
2+
#![doc(issue_tracker_base_url = "https://github.com/op-rs/hilo/issues/")]
33
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
44
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
55

crates/node/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ alloy-transport.workspace = true
2121
alloy-primitives.workspace = true
2222
alloy-rpc-types-engine = { workspace = true, features = ["jwt", "serde"] }
2323

24-
# op-alloy
25-
op-alloy-genesis = { workspace = true, features = ["serde"] }
24+
# maili
25+
maili-genesis = { workspace = true, features = ["serde"] }
2626

2727
# Misc
2828
serde.workspace = true
@@ -32,4 +32,4 @@ url = { workspace = true, features = ["serde"] }
3232

3333
[dev-dependencies]
3434
serde_json.workspace = true
35-
op-alloy-registry.workspace = true
35+
maili-registry.workspace = true

crates/node/src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::SyncMode;
44
use alloy_rpc_types_engine::JwtSecret;
5-
use op_alloy_genesis::RollupConfig;
5+
use maili_genesis::RollupConfig;
66
use serde::{Deserialize, Serialize};
77
use url::Url;
88

@@ -90,7 +90,7 @@ where
9090
#[cfg(test)]
9191
mod tests {
9292
use super::*;
93-
use op_alloy_registry::ROLLUP_CONFIGS;
93+
use maili_registry::ROLLUP_CONFIGS;
9494

9595
#[test]
9696
fn test_roundtrip_config() {

crates/node/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![doc = include_str!("../README.md")]
2-
#![doc(issue_tracker_base_url = "https://github.com/anton-rs/hilo/issues/")]
2+
#![doc(issue_tracker_base_url = "https://github.com/op-rs/hilo/issues/")]
33
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
44
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
55

crates/providers-alloy/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ alloy-provider = { workspace = true, features = ["ipc", "ws", "reqwest"] }
2727
alloy-primitives = { workspace = true, features = ["map"] }
2828

2929
# Op Alloy
30-
op-alloy-genesis.workspace = true
31-
op-alloy-protocol.workspace = true
3230
op-alloy-consensus.workspace = true
3331

32+
# Maili
33+
maili-genesis.workspace = true
34+
maili-protocol.workspace = true
35+
3436
# Misc
3537
url.workspace = true
3638
tracing.workspace = true

crates/providers-alloy/src/blob_provider.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloy_primitives::{map::HashMap, B256};
77
use async_trait::async_trait;
88
use eyre::{eyre, Result};
99
use kona_derive::{errors::BlobProviderError, traits::BlobProvider};
10-
use op_alloy_protocol::BlockInfo;
10+
use maili_protocol::BlockInfo;
1111
use parking_lot::Mutex;
1212
use tracing::warn;
1313
use url::Url;

crates/providers-alloy/src/blobs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use alloy_eips::eip4844::{Blob, BlobTransactionSidecarItem, IndexedBlobHash};
44
use alloy_rpc_types_beacon::sidecar::BlobData;
55
use async_trait::async_trait;
66
use kona_derive::{errors::BlobProviderError, traits::BlobProvider};
7-
use op_alloy_protocol::BlockInfo;
7+
use maili_protocol::BlockInfo;
88
use std::{
99
boxed::Box,
1010
string::{String, ToString},

crates/providers-alloy/src/chain_provider.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use kona_derive::{
1111
traits::ChainProvider,
1212
};
1313
use lru::LruCache;
14-
use op_alloy_protocol::BlockInfo;
14+
use maili_protocol::BlockInfo;
1515
use std::{boxed::Box, num::NonZeroUsize, vec::Vec};
1616

1717
const CACHE_SIZE: usize = 16;

crates/providers-alloy/src/l2_chain_provider.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Providers that use alloy provider types on the backend.
22
3+
use alloy_consensus::Block;
34
use alloy_primitives::{Bytes, U64};
45
use alloy_provider::{Provider, ReqwestProvider};
56
use alloy_rlp::Decodable;
@@ -10,9 +11,9 @@ use kona_derive::{
1011
traits::L2ChainProvider,
1112
};
1213
use lru::LruCache;
13-
use op_alloy_consensus::OpBlock;
14-
use op_alloy_genesis::{RollupConfig, SystemConfig};
15-
use op_alloy_protocol::{to_system_config, BatchValidationProvider, L2BlockInfo};
14+
use maili_genesis::{RollupConfig, SystemConfig};
15+
use maili_protocol::{to_system_config, BatchValidationProvider, L2BlockInfo};
16+
use op_alloy_consensus::OpTxEnvelope;
1617
use std::{boxed::Box, num::NonZeroUsize, sync::Arc};
1718

1819
const CACHE_SIZE: usize = 16;
@@ -30,7 +31,7 @@ pub struct AlloyL2ChainProvider {
3031
/// The rollup configuration.
3132
rollup_config: Arc<RollupConfig>,
3233
/// `block_by_number` LRU cache.
33-
block_by_number_cache: LruCache<u64, OpBlock>,
34+
block_by_number_cache: LruCache<u64, Block<OpTxEnvelope>>,
3435
/// `l2_block_info_by_number` LRU cache.
3536
l2_block_info_by_number_cache: LruCache<u64, L2BlockInfo>,
3637
/// `system_config_by_l2_hash` LRU cache.
@@ -105,6 +106,7 @@ impl From<AlloyL2ChainProviderError> for PipelineErrorKind {
105106
#[async_trait]
106107
impl BatchValidationProvider for AlloyL2ChainProvider {
107108
type Error = AlloyL2ChainProviderError;
109+
type Transaction = OpTxEnvelope;
108110

109111
async fn l2_block_info_by_number(&mut self, number: u64) -> Result<L2BlockInfo, Self::Error> {
110112
if let Some(l2_block_info) = self.l2_block_info_by_number_cache.get(&number) {
@@ -128,7 +130,10 @@ impl BatchValidationProvider for AlloyL2ChainProvider {
128130
Ok(l2_block_info)
129131
}
130132

131-
async fn block_by_number(&mut self, number: u64) -> Result<OpBlock, Self::Error> {
133+
async fn block_by_number(
134+
&mut self,
135+
number: u64,
136+
) -> Result<Block<Self::Transaction>, Self::Error> {
132137
if let Some(block) = self.block_by_number_cache.get(&number) {
133138
return Ok(block.clone());
134139
}
@@ -141,7 +146,7 @@ impl BatchValidationProvider for AlloyL2ChainProvider {
141146
return Err(AlloyL2ChainProviderError::BlockNotFound(number));
142147
}
143148
};
144-
let block = match OpBlock::decode(&mut raw_block.as_ref()) {
149+
let block: Block<Self::Transaction> = match Block::decode(&mut raw_block.as_ref()) {
145150
Ok(b) => b,
146151
Err(_) => {
147152
return Err(AlloyL2ChainProviderError::OpBlockDecode(number));

crates/providers-alloy/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![doc = include_str!("../README.md")]
2-
#![doc(issue_tracker_base_url = "https://github.com/anton-rs/hilo/issues/")]
2+
#![doc(issue_tracker_base_url = "https://github.com/op-rs/hilo/issues/")]
33
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
44
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
55

crates/providers-local/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ alloy-consensus.workspace = true
2222
alloy-primitives = { workspace = true, features = ["map"] }
2323

2424
# Op Alloy
25-
op-alloy-genesis.workspace = true
26-
op-alloy-protocol.workspace = true
2725
op-alloy-consensus.workspace = true
2826

27+
# Maili
28+
maili-genesis.workspace = true
29+
maili-protocol.workspace = true
30+
2931
# Reth
3032
reth-provider.workspace = true
3133
reth-primitives.workspace = true

0 commit comments

Comments
 (0)