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

chore(engine): Migrate types in engine rpc types from op-alloy #5

Merged
merged 1 commit into from
Jan 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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ rustdoc-args = ["--cfg", "docsrs"]
maili-protocol = { version = "0.1.0", path = "crates/protocol", default-features = false }
maili-provider = { version = "0.1.0", path = "crates/provider", default-features = false }
maili-registry = { version = "0.9.1", path = "crates/registry", default-features = false }
maili-rpc-types-engine = { version = "0.1.0", path = "crates/rpc-types-engine", default-features = false }

# OP-Alloy
op-alloy-genesis = { version = "0.9.0", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following crates are provided by `maili`.
- [`maili-protocol`][maili-protocol]
- [`maili-provider`][maili-provider]
- [`maili-registry`][maili-registry]
- [`maili-rpc-types-engine`][maili-rpc-types-engine]


## Development Status
Expand Down Expand Up @@ -53,6 +54,7 @@ Notice, provider crates do not support `no_std` compatibility.
- [`maili-protocol`][maili-protocol]
- [`maili-provider`][maili-provider]
- [`maili-registry`][maili-registry] (note: requires `serde`)
- [`maili-rpc-types-engine`][maili-rpc-types-engine]

If you would like to add no_std support to a crate,
please make sure to update [scripts/check_no_std.sh][check-no-std].
Expand Down Expand Up @@ -86,3 +88,4 @@ shall be dual licensed as above, without any additional terms or conditions.
[maili-protocol]: https://crates.io/crates/maili-protocol
[maili-provider]: https://crates.io/crates/maili-provider
[maili-registry]: https://crates.io/crates/maili-registry
[maili-rpc-types-engine]: https://crates.io/crates/maili-rpc-types-engine
1 change: 1 addition & 0 deletions book/src/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

[maili-protocol]: https://crates.io/crates/maili-protocol
[maili-provider]: https://crates.io/crates/maili-provider
[maili-rpc-types-engine]: https://crates.io/crates/maili-rpc-types-engine

<!-- maili-protocol -->

Expand Down
2 changes: 2 additions & 0 deletions book/src/starting.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ so `maili-protocol` types can be used from `maili` through `maili::protocol::Ins

- [`maili-protocol`][maili-protocol] (supports `no_std`)
- [`maili-provider`][maili-provider]
- [`maili-rpc-types-engine`][maili-rpc-types-engine] (supports `no_std`)

## `no_std`

As noted above, the following crates are `no_std` compatible.

- [`maili-protocol`][maili-protocol]
- [`maili-rpc-types-engine`][maili-rpc-types-engine]

To add `no_std` support to a crate, ensure the [check_no_std][check-no-std]
script is updated to include this crate once `no_std` compatible.
Expand Down
3 changes: 3 additions & 0 deletions crates/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ exclude.workspace = true
workspace = true

[dependencies]
# Workspace
maili-rpc-types-engine = { workspace = true, features = ["serde"] }

# OP-Alloy
op-alloy-rpc-types-engine = { workspace = true, features = ["serde"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/provider/src/ext/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use alloy_rpc_types_engine::{
ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus,
};
use alloy_transport::{Transport, TransportResult};
use maili_rpc_types_engine::{ProtocolVersion, SuperchainSignal};
use op_alloy_rpc_types_engine::{
OpExecutionPayloadEnvelopeV3, OpExecutionPayloadEnvelopeV4, OpPayloadAttributes,
ProtocolVersion, SuperchainSignal,
};

/// Extension trait that gives access to Optimism engine API RPC methods.
Expand Down
33 changes: 33 additions & 0 deletions crates/rpc-types-engine/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "maili-rpc-types-engine"
description = "Optimism RPC types for the `engine` namespace"

version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
authors.workspace = true
repository.workspace = true
exclude.workspace = true

[lints]
workspace = true

[dependencies]
# Alloy
alloy-primitives.workspace = true

# serde
serde = { workspace = true, optional = true }

# misc
derive_more = { workspace = true, default-features = false, features = ["display", "from"] }

[features]
default = ["std", "serde"]
std = ["alloy-primitives/std"]
serde = [
"dep:serde",
"alloy-primitives/serde"
]
10 changes: 10 additions & 0 deletions crates/rpc-types-engine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## `maili-rpc-types-engine`

<a href="https://github.com/op-rs/maili/actions/workflows/ci.yml"><img src="https://github.com/op-rs/maili/actions/workflows/ci.yml/badge.svg?label=ci" alt="CI"></a>
<a href="https://crates.io/crates/maili-rpc-types-engine"><img src="https://img.shields.io/crates/v/maili-rpc-types-engine.svg" alt="maili-rpc-types-engine crate"></a>
<a href="https://github.com/op-rs/maili/blob/main/LICENSE-MIT"><img src="https://img.shields.io/badge/License-MIT-d1d1f6.svg?label=license&labelColor=2a2f35" alt="MIT License"></a>
<a href="https://github.com/op-rs/maili/blob/main/LICENSE-APACHE"><img src="https://img.shields.io/badge/License-APACHE-d1d1f6.svg?label=license&labelColor=2a2f35" alt="Apache License"></a>
<a href="https://op-rs.github.io/maili"><img src="https://img.shields.io/badge/Book-854a15?logo=mdBook&labelColor=2a2f35" alt="Book"></a>


Optimism RPC types for the `engine` namespace.
15 changes: 15 additions & 0 deletions crates/rpc-types-engine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/alloy.jpg",
html_favicon_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/favicon.ico"
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(not(any(test, feature = "std")), no_std)]

extern crate alloc;

mod superchain;
pub use superchain::{
ProtocolVersion, ProtocolVersionError, ProtocolVersionFormatV0, SuperchainSignal,
};
Loading
Loading