| Crates.io | montana-txmgr |
| lib.rs | montana-txmgr |
| version | 0.0.1 |
| created_at | 2025-12-16 16:53:59.51384+00 |
| updated_at | 2025-12-16 16:53:59.51384+00 |
| description | Transaction manager for L1 batch submission with blob and calldata support |
| homepage | https://github.com/base/montana |
| repository | https://github.com/base/montana |
| max_upload_size | |
| id | 1988265 |
| size | 232,813 |
Transaction manager for L1 batch submission with EIP-4844 blob and calldata support.
montana-txmgr provides a robust, production-ready transaction management system for submitting batch data to L1. It handles:
| Component | Description |
|---|---|
TxManagerConfig |
Configuration with sane defaults |
TxCandidate |
Transaction candidate (calldata or blob) |
TxReceipt |
Confirmed transaction receipt |
NonceTracker |
Thread-safe nonce management |
GasCaps |
Gas fee caps for EIP-1559 transactions |
TxBuilder |
Transaction construction |
TxSubmitter |
Mempool submission with retry |
TxMonitor |
Receipt polling and confirmation |
SendState |
Per-transaction state machine |
use montana_txmgr::{TxCandidate, TxManagerConfig};
use alloy::primitives::{Address, Bytes, U256};
use alloy::consensus::BlobTransactionSidecar;
// Create a calldata transaction candidate
let candidate = TxCandidate::calldata(
Address::ZERO, // batch inbox address
Bytes::from_static(&[0x01, 0x02, 0x03]),
)
.with_gas_limit(100_000) // Optional gas limit override
.with_value(U256::ZERO); // Optional value (default is 0)
// Or create a blob transaction
let sidecar = BlobTransactionSidecar::default(); // Create with your blob data
let candidate = TxCandidate::blob(
Address::ZERO, // batch inbox address
sidecar,
);
// Check transaction type
assert!(candidate.is_blob());
use std::time::Duration;
let config = TxManagerConfig::builder()
.num_confirmations(10)
.resubmission_timeout(Duration::from_secs(48))
.network_timeout(Duration::from_secs(10))
.price_bump_percent(10)
.blob_price_bump_percent(100)
.build();
use montana_txmgr::TxReceipt;
// After successful submission, you receive a receipt
// let receipt: TxReceipt = ...
// Calculate total cost (base gas + blob gas if applicable)
let total_wei = receipt.total_cost();
Default configuration values:
| Setting | Default | Description |
|---|---|---|
num_confirmations |
10 | Required block confirmations |
receipt_query_interval |
12s | Receipt polling interval |
network_timeout |
10s | RPC call timeout |
resubmission_timeout |
48s | Fee bump interval |
not_in_mempool_timeout |
2m | Max mempool wait time |
safe_abort_nonce_too_low_count |
3 | Nonce errors before abort |
fee_limit_multiplier |
5x | Fee cap multiplier |
price_bump_percent |
10% | Regular tx fee bump |
blob_price_bump_percent |
100% | Blob tx fee bump |
Errors are classified for retry logic:
Rpc, Underpriced, NonceTooLowInsufficientFunds, AlreadyReserved, NonceTooLowAbortLicensed under the MIT license.