signet_bundle/
lib.rs

1//! Signet Bundle Library
2//!
3//! Contains the [`SignetCallBundle`] and [`SignetEthBundle`] type, and
4//! utilities related to creating and simulating Signet bundles.
5//!
6//! # Bundles
7//!
8//! The [`SignetCallBundle`] and [`SignetEthBundle`] types are used to simulate
9//! transaction bundles in different ways. The [`SignetBundleDriver`] type
10//! drives a [`SignetCallBundle`] to completion and generates a
11//! [`SignetCallBundleResponse`]. This is used primarily by the RPC server to
12//! serve `signet_callBundle` requests. The response includes the standard
13//! flashbots-style response information, as well as a description of the fills
14//! necessary to make the bundle valid on Signet.
15//!
16//! The [`SignetEthBundle`] type is used to simulate transaction bundles while
17//! building blocks. It is used primarily by builders and relays. The
18//! [`SignetEthBundleDriver`] drives a [`SignetEthBundle`] to completion and
19//! enforces bundle rules. When used in a block builder, it will ensure that the
20//! bundle is valid and that the fills are valid at the time of block
21//! construction.
22//!
23//! # Using [`SignetEthBundle`] safely
24//!
25//! The [`SignetEthBundle`] type contains actions that must be performed on
26//! both chains. As such, its simulation must be performed on both chains. The
27//! primary transaction simulation via [`SignetEthBundleDriver`] is performed
28//! locally using [`trevm`]. However, the [`SignedFill`] must be checked
29//! against the host chain. This is done by calling the
30//! [`SignetEthBundle::alloy_validate_fills_onchain`] method. This MUST be
31//! called BEFORE simulating.
32//!
33//! Builders running in an exex may choose to simulate using the local host
34//! chain DB copy. This is not yet implemented in this library, but may be in
35//! the future.
36
37#![warn(
38    missing_copy_implementations,
39    missing_debug_implementations,
40    missing_docs,
41    unreachable_pub,
42    clippy::missing_const_for_fn,
43    rustdoc::all
44)]
45#![cfg_attr(not(test), warn(unused_crate_dependencies))]
46#![deny(unused_must_use, rust_2018_idioms)]
47#![cfg_attr(docsrs, feature(doc_cfg))]
48
49mod call;
50pub use call::{SignetBundleDriver, SignetCallBundle, SignetCallBundleResponse};
51
52mod send;
53pub use send::{
54    BundleInspector, SignetEthBundle, SignetEthBundleDriver, SignetEthBundleError,
55    SignetEthBundleInsp, SignetEthBundleResponse,
56};