From 83f8619f6d5254035feda0a32a63c79944d77d36 Mon Sep 17 00:00:00 2001 From: Fraser Hutchison <190532+Fraser999@users.noreply.github.com> Date: Wed, 28 Jan 2026 14:13:59 +0000 Subject: [PATCH] fix: doc comments --- crates/bundle/src/lib.rs | 5 +++- crates/bundle/src/send/error.rs | 2 ++ crates/constants/src/types/error.rs | 3 +-- crates/evm/src/driver.rs | 2 ++ crates/evm/src/sys/driver.rs | 34 +++++++++----------------- crates/evm/src/sys/mod.rs | 2 ++ crates/extract/src/extractor.rs | 2 ++ crates/extract/src/lib.rs | 4 +-- crates/sim/src/outcome.rs | 2 ++ crates/test-utils/src/specs/ru_spec.rs | 4 +-- crates/types/src/signing/error.rs | 3 +++ 11 files changed, 33 insertions(+), 30 deletions(-) diff --git a/crates/bundle/src/lib.rs b/crates/bundle/src/lib.rs index 9e83e695..afc11f6e 100644 --- a/crates/bundle/src/lib.rs +++ b/crates/bundle/src/lib.rs @@ -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 @@ -54,3 +54,6 @@ pub use send::{ BundleInspector, BundleRecoverError, RecoverError, RecoveredBundle, SignetEthBundle, SignetEthBundleDriver, SignetEthBundleError, SignetEthBundleInsp, TxRequirement, }; + +#[cfg(doc)] +use signet_types::SignedFill; diff --git a/crates/bundle/src/send/error.rs b/crates/bundle/src/send/error.rs index fa592a98..4b4ffe3f 100644 --- a/crates/bundle/src/send/error.rs +++ b/crates/bundle/src/send/error.rs @@ -1,3 +1,5 @@ +#[cfg(doc)] +use crate::SignetEthBundle; use alloy::eips::eip2718::Eip2718Error; use signet_types::{MarketError, SignedPermitError}; use trevm::{ diff --git a/crates/constants/src/types/error.rs b/crates/constants/src/types/error.rs index 284ae29d..efe74ee4 100644 --- a/crates/constants/src/types/error.rs +++ b/crates/constants/src/types/error.rs @@ -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. diff --git a/crates/evm/src/driver.rs b/crates/evm/src/driver.rs index fefd5413..7e6b133c 100644 --- a/crates/evm/src/driver.rs +++ b/crates/evm/src/driver.rs @@ -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::{ diff --git a/crates/evm/src/sys/driver.rs b/crates/evm/src/sys/driver.rs index 98412f22..9abaa50a 100644 --- a/crates/evm/src/sys/driver.rs +++ b/crates/evm/src/sys/driver.rs @@ -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::{ @@ -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( &mut self, mut trevm: EvmNeedsTx, @@ -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( &mut self, trevm: EvmNeedsTx, @@ -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( &mut self, trevm: EvmNeedsTx, @@ -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( &mut self, mut trevm: EvmNeedsTx, @@ -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( &mut self, mut trevm: EvmNeedsTx, diff --git a/crates/evm/src/sys/mod.rs b/crates/evm/src/sys/mod.rs index dc626356..2beaf94b 100644 --- a/crates/evm/src/sys/mod.rs +++ b/crates/evm/src/sys/mod.rs @@ -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}, diff --git a/crates/extract/src/extractor.rs b/crates/extract/src/extractor.rs index f22485fd..9a37077b 100644 --- a/crates/extract/src/extractor.rs +++ b/crates/extract/src/extractor.rs @@ -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; diff --git a/crates/extract/src/lib.rs b/crates/extract/src/lib.rs index d788c649..753a69ae 100644 --- a/crates/extract/src/lib.rs +++ b/crates/extract/src/lib.rs @@ -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( @@ -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; diff --git a/crates/sim/src/outcome.rs b/crates/sim/src/outcome.rs index 5ac66b34..81be23d3 100644 --- a/crates/sim/src/outcome.rs +++ b/crates/sim/src/outcome.rs @@ -1,3 +1,5 @@ +#[cfg(doc)] +use crate::SimCache; use crate::SimItem; use alloy::primitives::U256; use signet_types::{AggregateFills, AggregateOrders}; diff --git a/crates/test-utils/src/specs/ru_spec.rs b/crates/test-utils/src/specs/ru_spec.rs index 71ea0364..92c371d2 100644 --- a/crates/test-utils/src/specs/ru_spec.rs +++ b/crates/test-utils/src/specs/ru_spec.rs @@ -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, @@ -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. diff --git a/crates/types/src/signing/error.rs b/crates/types/src/signing/error.rs index 5b5290a9..151ea54a 100644 --- a/crates/types/src/signing/error.rs +++ b/crates/types/src/signing/error.rs @@ -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 {