Skip to content
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
5 changes: 4 additions & 1 deletion crates/bundle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! primary transaction simulation via [`SignetEthBundleDriver`] is performed
//! locally using [`trevm`]. However, the [`SignedFill`] must be checked
//! against the host chain. This is done by calling the
//! [`SignetEthBundle::alloy_validate_fills_onchain`] method. This MUST be
//! [`SignetEthBundle::decode_and_validate_txs`] method. This MUST be
//! called BEFORE simulating.
//!
//! Builders running in an exex may choose to simulate using the local host
Expand All @@ -54,3 +54,6 @@ pub use send::{
BundleInspector, BundleRecoverError, RecoverError, RecoveredBundle, SignetEthBundle,
SignetEthBundleDriver, SignetEthBundleError, SignetEthBundleInsp, TxRequirement,
};

#[cfg(doc)]
use signet_types::SignedFill;
2 changes: 2 additions & 0 deletions crates/bundle/src/send/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(doc)]
use crate::SignetEthBundle;
use alloy::eips::eip2718::Eip2718Error;
use signet_types::{MarketError, SignedPermitError};
use trevm::{
Expand Down
3 changes: 1 addition & 2 deletions crates/constants/src/types/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// Error type for [`crate::config`] module. Captures errors related to loading
/// configuration from the environment or other sources.
/// Captures errors related to loading configuration from the environment or other sources.
#[derive(Debug, thiserror::Error)]
pub enum ConfigError {
/// Missing `signetConstants` genesis field.
Expand Down
2 changes: 2 additions & 0 deletions crates/evm/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use signet_types::{
primitives::{BlockBody, RecoveredBlock, SealedBlock, SealedHeader, TransactionSigned},
AggregateFills, MarketError,
};
#[cfg(doc)]
use signet_zenith::Transactor;
use std::collections::VecDeque;
use tracing::{debug, debug_span, info_span, warn};
use trevm::{
Expand Down
34 changes: 11 additions & 23 deletions crates/evm/src/sys/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use crate::{
};
use alloy::primitives::{map::HashSet, U256};
use signet_extract::Extractable;
#[cfg(doc)]
use signet_zenith::Transactor;
use signet_zenith::MINTER_ADDRESS;
use tracing::{debug, debug_span};
use trevm::{
Expand Down Expand Up @@ -46,22 +48,18 @@ impl<'a, 'b, C: Extractable> SignetDriver<'a, 'b, C> {
///
/// This will do the following:
/// - Run the system action, allowing direct EVM state changes.
/// - Produce the transaction using [`SysOutput::produce_transaction`].
/// - Produce the syslog for the receipt using [`SysOutput::produce_log`].
/// - Produce the transaction using [`SysBase::produce_transaction`].
/// - Produce the syslog for the receipt using [`SysBase::produce_log`].
/// - Produce a receipt containing the gas used and logs.
/// - Push the resulting transaction to the block.
/// - Push the resulting receipt to the output.
///
/// [`SysAction`]s have the following properties:
/// - DO NOT pay for gas.
/// - DO update the nonce of the [`SysOutput::sender`] sender.
/// - DO update the nonce of the [`SysBase::evm_sender`] sender.
/// - DO NOT run the EVM.
///
/// See the [`SysAction`] trait documentation for more details.
///
/// [`SysOutput::sender`]: crate::sys::SysOutput::sender
/// [`SysOutput::produce_log`]: crate::sys::SysOutput::produce_log
/// [`SysOutput::produce_transaction`]: crate::sys::SysOutput::produce_transaction
pub(crate) fn apply_sys_action_single<Db, Insp, S>(
&mut self,
mut trevm: EvmNeedsTx<Db, Insp>,
Expand Down Expand Up @@ -202,10 +200,8 @@ impl<'a, 'b, C: Extractable> SignetDriver<'a, 'b, C> {
///
/// [`UnmeteredSysTx`]s have the following properties:
/// - DO NOT pay for gas.
/// - DO update the nonce of the [`SysOutput::sender`].
/// - DO update the nonce of the [`SysBase::evm_sender`].
/// - DO run the EVM.
///
/// [`SysOutput::sender`]: crate::sys::SysOutput::sender
pub(crate) fn apply_unmetered_sys_transaction_single<Db, Insp, S>(
&mut self,
trevm: EvmNeedsTx<Db, Insp>,
Expand Down Expand Up @@ -233,10 +229,8 @@ impl<'a, 'b, C: Extractable> SignetDriver<'a, 'b, C> {
///
/// /// [`UnmeteredSysTx`]s have the following properties:
/// - DO NOT pay for gas.
/// - DO update the nonce of the [`SysOutput::sender`].
/// - DO update the nonce of the [`SysBase::evm_sender`].
/// - DO run the EVM.
///
/// [`SysOutput::sender`]: crate::sys::SysOutput::sender
pub(crate) fn apply_unmetered_sys_transactions<Db, Insp, S>(
&mut self,
trevm: EvmNeedsTx<Db, Insp>,
Expand All @@ -260,20 +254,16 @@ impl<'a, 'b, C: Extractable> SignetDriver<'a, 'b, C> {
/// - Run the system transaction in the EVM.
/// - Double-check that the sender has enough balance to pay for the unused
/// gas.
/// - Produce the transaction using [`SysOutput::produce_transaction`].
/// - Produce a syslog using [`SysOutput::produce_log`].
/// - Produce the transaction using [`SysBase::produce_transaction`].
/// - Produce a syslog using [`SysBase::produce_log`].
/// - Push the syslog to the outcome.
/// - Invoke [`Self::check_fills_and_accept`] to check the fills and
/// accept the transaction and receipt.
///
/// [`MeteredSysTx`]s have the following properties:
/// - DO pay for gas, INCLUDING unused gas.
/// - DO update the nonce of the [`SysOutput::sender`].
/// - DO update the nonce of the [`SysBase::evm_sender`].
/// - DO run the EVM.
///
/// [`SysOutput::produce_transaction`]: crate::sys::SysOutput::produce_transaction
/// [`SysOutput::sender`]: crate::sys::SysOutput::sender
/// [`SysOutput::produce_log`]: crate::sys::SysOutput::produce_log
pub(crate) fn apply_metered_sys_transaction_single<Db, Insp, S>(
&mut self,
mut trevm: EvmNeedsTx<Db, Insp>,
Expand Down Expand Up @@ -362,10 +352,8 @@ impl<'a, 'b, C: Extractable> SignetDriver<'a, 'b, C> {
///
/// [`MeteredSysTx`]s have the following properties:
/// - DO pay for gas, INCLUDING unused gas.
/// - DO update the nonce of the [`SysOutput::sender`].
/// - DO update the nonce of the [`SysBase::evm_sender`].
/// - DO run the EVM.
///
/// [`SysOutput::sender`]: crate::sys::SysOutput::sender
fn apply_metered_sys_transactions<Db, Insp, S>(
&mut self,
mut trevm: EvmNeedsTx<Db, Insp>,
Expand Down
2 changes: 2 additions & 0 deletions crates/evm/src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub use token::MintToken;
mod transact;
pub use transact::TransactSysTx;

#[cfg(doc)]
use crate::SignetDriver;
use alloy::{
consensus::ReceiptEnvelope,
primitives::{Address, Bytes, Log, TxKind, U256},
Expand Down
2 changes: 2 additions & 0 deletions crates/extract/src/extractor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::{r#trait::Extractable, ExtractStep, Extracts};
#[cfg(doc)]
use crate::{Events, ExtractedEvent};
use alloy::consensus::BlockHeader;
use signet_types::constants::SignetSystemConstants;

Expand Down
4 changes: 2 additions & 2 deletions crates/extract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! which containing the relevant [`ExtractedEvent`]s and a [`AggregateFills`]
//! for a specific host block.
//!
//! [`SignetSystemConstants`]: signet_types::config::SignetSystemConstants
//! [`SignetSystemConstants`]: signet_types::constants::SignetSystemConstants
//! [`AggregateFills`]: signet_types::AggregateFills

#![warn(
Expand All @@ -26,7 +26,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]

mod block;
pub use block::Extracts;
pub use block::{Extracts, HostEvents};

mod events;
pub use events::Events;
Expand Down
2 changes: 2 additions & 0 deletions crates/sim/src/outcome.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[cfg(doc)]
use crate::SimCache;
use crate::SimItem;
use alloy::primitives::U256;
use signet_types::{AggregateFills, AggregateOrders};
Expand Down
4 changes: 2 additions & 2 deletions crates/test-utils/src/specs/ru_spec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use super::{sign_tx_with_key_pair, simple_send};
#[cfg(doc)]
use crate::specs::HostBlockSpec;
use alloy::{
consensus::{BlobTransactionSidecar, SidecarBuilder, SimpleCoder, TxEnvelope},
eips::eip2718::Encodable2718,
Expand All @@ -20,8 +22,6 @@ use std::str::FromStr;
/// 3. Optionally set the gas limit with [`Self::with_gas_limit`].
/// 4. Optionally set the reward address with [`Self::with_reward_address`].
/// 5. Add to a [`HostBlockSpec`] via `HostBlockSpec::add_ru_block`.
///
/// [`HostBlockSpec`]: crate::test_utils::HostBlockSpec
#[derive(Debug, Clone)]
pub struct RuBlockSpec {
/// The system constants for the block.
Expand Down
3 changes: 3 additions & 0 deletions crates/types/src/signing/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[cfg(doc)]
use signet_zenith::RollupOrders::Permit2Batch;

/// An error that can occur when validating a signed order or fill.
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum SignedPermitError {
Expand Down