Skip to content

Commit

Permalink
Merge branch 'main' into rf/cargo-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Jan 8, 2025
2 parents 7599a89 + 9a7f010 commit 8f81601
Show file tree
Hide file tree
Showing 14 changed files with 648 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ rustdoc-args = ["--cfg", "docsrs"]
# Workspace
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-registry = { version = "0.1.0", 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.1", 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
2 changes: 2 additions & 0 deletions book/src/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

[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

<!-- 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
57 changes: 57 additions & 0 deletions crates/maili/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[package]
name = "maili"
description = "Connect applications to the OP Stack"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
# Workspace
maili-protocol = { workspace = true, optional = true }
maili-provider = { workspace = true, optional = true }
maili-registry = { workspace = true, optional = true }
maili-rpc-types-engine = { workspace = true, optional = true }

[features]
default = ["std", "serde"]

std = [
"maili-protocol?/std",
"maili-registry?/std",
"maili-rpc-types-engine?/std",
]

full = [
"protocol",
"provider",
"registry",
]

arbitrary = [
"maili-protocol?/arbitrary",
]

serde = [
"maili-protocol?/serde",
"maili-rpc-types-engine?/serde",
]

# `no_std` support
registry = ["dep:maili-registry"]
protocol = ["dep:maili-protocol"]
rpc-types-engine = ["dep:maili-rpc-types-engine"]

# std features
provider = ["dep:maili-provider"]
85 changes: 85 additions & 0 deletions crates/maili/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## `maili`

<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"><img src="https://img.shields.io/crates/v/maili.svg" alt="op-alloy crate"></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="License"></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="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>


Built on [Alloy][alloy], `maili` connects applications to the OP Stack.


### Usage

To use `maili`, add the crate as a dependency to a `Cargo.toml`.

```toml
maili = "0.6"
```

### Development Status

`maili` is currently in active development, and is not yet ready for use in production.


### Supported Rust Versions (MSRV)

The current MSRV (minimum supported rust version) is 1.81.

Unlike Alloy, maili may use the latest stable release,
to benefit from the latest features.

The MSRV is not increased automatically, and will be updated
only as part of a patch (pre-1.0) or minor (post-1.0) release.


### Contributing

Maili is built by open source contributors like you, thank you for improving the project!

A [contributing guide][contributing] is available that sets guidelines for contributing.

Pull requests will not be merged unless CI passes, so please ensure that your contribution follows the
linting rules and passes clippy.


### `no_std`

Maili is intended to be `no_std` compatible, initially for use in [kona][kona].

The following crates support `no_std`.
Notice, provider crates do not support `no_std` compatibility.

- [`maili-protocol`][maili-protocol]

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].


### Credits

Maili is inspired by the work of several teams and projects, most notably [the Alloy project][alloy].

This would not be possible without the hard work from open source contributors. Thank you.


### License

Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in these crates by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.


<!-- Hyperlinks -->

[check-no-std]: https://github.com/op-rs/maili/blob/main/scripts/check_no_std.sh

[kona]: https://github.com/anton-rs/kona
[alloy]: https://github.com/alloy-rs/alloy
[contributing]: https://op-rs.github.io/maili

[maili-protocol]: https://crates.io/crates/maili-protocol
24 changes: 24 additions & 0 deletions crates/maili/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/op-rs/maili/main/assets/square.png",
html_favicon_url = "https://raw.githubusercontent.com/op-rs/maili/main/assets/favicon.ico"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(any(feature = "full", feature = "std")), no_std)]

#[cfg(feature = "protocol")]
#[doc(inline)]
pub use maili_protocol as protocol;

#[cfg(feature = "registry")]
#[doc(inline)]
pub use maili_registry as registry;

#[cfg(feature = "provider")]
#[doc(inline)]
pub use maili_provider as provider;

#[cfg(feature = "rpc-types-engine")]
#[doc(inline)]
pub use maili_rpc_types_engine as rpc_types_engine;
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
2 changes: 1 addition & 1 deletion crates/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://crates.io/crates/maili-registry"><img src="https://img.shields.io/crates/v/maili-registry.svg?label=maili-registry&labelColor=2a2f35" alt="maili-registry"></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://alloy-rs.github.io/maili"><img src="https://img.shields.io/badge/Book-854a15?logo=mdBook&labelColor=2a2f35" alt="Book"></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>


[`maili-registry`][sc] is a `no_std` crate that exports rust type definitions for chains
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

0 comments on commit 8f81601

Please sign in to comment.