--help in v1.10.0.
Batcher policy
The batcher policy defines high-level constraints and responsibilities regarding how L2 data is posted to L1. Below are the standard guidelines for configuring the batcher within the OP Stack.| Parameter | Description | Administrator | Requirement | Notes |
|---|---|---|---|---|
| Data Availability Type | Specifies whether the batcher uses blobs, calldata, or auto to post transaction data to L1. | Batch submitter address | Ethereum (Blobs or Calldata) | - Alternative data availability (Alt-DA) is not yet supported in the standard configuration. - The sequencer can switch at will between blob transactions and calldata, with no restrictions, because both are fully secured by L1. |
| Batch Submission Frequency | Determines how frequently the batcher submits aggregated transaction data to L1 (via the batcher transaction). | Batch submitter address | Must target 1,800 L1 blocks (6 hours on Ethereum, assuming 12s L1 block time) or lower | - Batches must be posted before the sequencing window closes (commonly 12 hours by default). - Leave a buffer for L1 network congestion and data size to ensure that each batch is fully committed in a timely manner. |
-
Data Availability Types:
- Calldata is generally simpler but can be more expensive on mainnet Ethereum, depending on gas prices.
- Blobs are typically lower cost when your chain has enough transaction volume to fill large chunks of data.
- The
op-batchercan toggle between these approaches by setting the--data-availability-type=<blobs|calldata|auto>flag or with theOP_BATCHER_DATA_AVAILABILITY_TYPEenv variable. Setting this flag toautowill allow the batcher to automatically switch betweencalldataandblobsbased on the current L1 gas price.
-
Batch Submission Frequency (
OP_BATCHER_MAX_CHANNEL_DURATIONand related flags):- Standard OP Chains frequently target a maximum channel duration between 1–6 hours.
- Your chain should never exceed your L2’s sequencing window (commonly 12 hours).
- If targeting a longer submission window (e.g., 5 or 6 hours), be aware that the safe head can stall up to that duration.
op-batcher configuration. See the batcher configuration reference, which explains each CLI flag and environment variable in depth.
Recommendations
Set your OP_BATCHER_MAX_CHANNEL_DURATION
The default value inside
op-batcher, if not specified, is still 0, which means channel duration tracking is disabled.
For very low throughput chains, this would mean to fill channels until close to the sequencing window and post the channel to L1 SUB_SAFETY_MARGIN L1 blocks before the sequencing window expires.OP_BATCHER_MAX_CHANNEL_DURATION to target 5 hours, with a value of 1500 L1 blocks. When non-zero, this parameter is the max time (in L1 blocks, which are 12 seconds each) between which batches will be submitted to the L1. If you have this set to 5 for example, then your batcher will send a batch to the L1 every 5*12=60 seconds. When using blobs, because 130kb blobs need to be purchased in full, if your chain doesn’t generate at least ~130kb of data in those 60 seconds, then you’ll be posting only partially full blobs and wasting storage.
- We do not recommend setting any values higher than targeting 5 hours, as batches have to be submitted within the sequencing window which defaults to 12 hours for OP chains, otherwise your chain may experience a 12 hour long chain reorg. 5 hours is the longest length of time we recommend that still sits snugly within that 12 hour window to avoid affecting stability.
- If your chain fills up full blobs of data before the
OP_BATCHER_MAX_CHANNEL_DURATIONelapses, a batch will be submitted anyways - (e.g. even if the OP Mainnet batcher sets anOP_BATCHER_MAX_CHANNEL_DURATIONof 5 hours, it will still be submitting batches every few minutes)
While setting an
OP_BATCHER_MAX_CHANNEL_DURATION of 1500 results in the cheapest fees, it also means that your safe head can stall for up to 5 hours.- This will negatively impact apps on your chain that rely on the safe head for operation. While many apps can likely operate simply by following the unsafe head, often Centralized Exchanges or third party bridges wait until transactions are marked safe before processing deposits and withdrawal.
- Thus a larger gap between posting batches can result in significant delays in the operation of certain types of high-security applications.
Configure your batcher to use multiple blobs
When there’s blob congestion, running with high blob counts can backfire, because you will have a harder time getting blobs included and then fees will bump, which always means a doubling of the priority fees.
op-batcher has the capabilities to send multiple blobs per single blob transaction. This is accomplished by the use of multi-frame channels, see the specs for more technical details on channels and frames.
A minimal batcher configuration (with env vars) to enable 6-blob batcher transactions is:
This enables blob transactions and sets the target number of frames to 6, which translates to 6 blobs per transaction.
The minimum tip cap and base fee are also lifted to 2 gwei because it is uncertain how easy it will be to get 6-blob transactions included and slightly higher priority fees should help.
The resubmission timeout is increased to a few minutes to give more time for inclusion before bumping the fees because current transaction pool implementations require a doubling of fees for blob transaction replacements.
Multi-blob transactions are particularly useful for medium to high-throughput chains, where enough transaction volume exists to fill up 6 blobs in a reasonable amount of time.
You can use this calculator for your chain to determine what number of blobs are right for you, and what gas scalar configuration to use. Please also refer to guide on Using Blobs for chain operators.
Set your --batch-type=1 to use span batches
Span batches reduce the overhead of OP Stack chains, introduced in the Delta network upgrade. This is beneficial for sparse and low-throughput OP Stack chains.
The overhead is reduced by representing a span of consecutive L2 blocks in a more efficient manner, while preserving the same consistency checks as regular batch data.
Batcher sequencer throttling
This feature is a batcher-driven sequencer-throttling control loop. This is to avoid sudden spikes in L1 DA-usage consuming too much available gas and causing a backlog in batcher transactions. The batcher can throttle the sequencer’s data throughput instantly when it sees too much batcher data built up. There are two throttling knobs:- Transaction throttling, which skips individual transactions whose estimated compressed L1 DA usage goes over a certain threshold, and
- Block throttling, which caps a block’s estimated total L1 DA usage and leads to not including transactions during block building that would move the block’s L1 DA usage past a certain threshold.
- This new feature is enabled by default and requires running op-geth version
v1.101411.1or later. It can be disabled by setting--throttle-thresholdto 0. The sequencer’s op-geth node has to be updated first, before updating the batcher, so that the new required RPC is available at the time of the batcher restart. - It is required to upgrade to
op-conductor/v0.2.0if you are using conductor’s leader-aware rpc proxy feature. This conductor release includes support for theminer_setMaxDASizeop-geth rpc proxy.
Note that this feature requires the batcher to correctly follow the sequencer at all times, or it would set throttling parameters on a non-sequencer EL client. That means, active sequencer follow mode has to be enabled correctly by listing all the possible sequencers in the L2 rollup and EL endpoint flags.
- Backlog of pending block bytes beyond which the batcher will enable throttling on the sequencer via
--throttle.unsafe-da-bytes-lower/upper-threshold(env varOP_BATCHER_THROTTLE_UNSAFE_DA_BYTES_LOWER/UPPER_THRESHOLD): 3_200_000 and 12_800_000 (batcher backlog of 3.2MB to 12.8MB of data to batch). Disable throttling by setting the lower threshold to0. The upper threshold sets the level where the maximum throttling intensity is reached. - Individual tx size throttling via
--throttle.tx-size-lower/upper-limit(env varOP_BATCHER_THROTTLE_TX_SIZE_LOWER/UPPER-LIMIT): 150 and 20_000. This is the limit on the estimated compressed size of a transaction when throttling is at minimum/maximum intensity respectively. - Block size throttling via
--throttle.block-size-lower/upper-limit(env varOP_BATCHER_THROTTLE_BLOCK_SIZE_LOWER/UPPER-LIMIT): 2_000 and 130_000. This is the limit on the estimated compressed size of a block when throttling is at minimum/maximum intensity respectively. - Throttler controller type via
--throttle.controller-type(env varOP_BATCHER_THROTTLE_CONTROLLER_TYPE):quadraticby default. This determines how transaction and block size limits are interpolated when throttling is at intermediate intensity.
op-geth instance to which it’s talking doesn’t have the miner_setMaxDASize RPC enabled, it will fail with an error message like:
miner_setMaxDASize is available in op-geth since v1.101411.1. It has to be enabled by adding the miner namespace to the correct API flags, like
Example configuration
This is a basic example of a batcher configuration. Optimal batcher configuration is going to differ for each chain, however you can see some of the most important variables configured below:MAX_CHANNEL_DURATION is hit,
may save gas by increasing the MAX_CHANNEL_DURATION. See the recommendations section.
All configuration variables
Batch generation
batch-type
The batch type. 0 forSingularBatch and 1 for SpanBatch. The default value
is 0 for SingularBatch.
See the span batch feature page to learn more.
- Syntax
- Example
- Environment Variable
--batch-type=<value>max-blocks-per-span-batch
Indicates how many blocks back the batcher should look during startup for a recent batch tx on L1. This can speed up waiting for node sync. It should be set to the verifier confirmation depth of the sequencer (e.g. 4). The default value is0.
- Syntax
- Example
- Environment Variable
--check-recent-txs-depth=<value>compression-algo
The compression algorithm to use. Valid options: zlib, brotli, brotli-9, brotli-10, brotli-11. The default value iszlib.
- Syntax
- Example
- Environment Variable
--compression-algo=<value>compressor
The type of compressor. Valid options: none, ratio, shadow. The default value isshadow.
- Syntax
- Example
- Environment Variable
--compressor=<value>approx-compr-ratio
Only relevant for ratio compressor. The approximate compression ratio (<=1.0). The default value is 0.6.
- Syntax
- Example
- Environment Variable
--approx-compr-ratio=<value>poll-interval
How frequently to poll L2 for new blocks. The default value is6s.
- Syntax
- Example
- Environment Variable
--poll-interval=<value>Batch submission
data-availability-type
Setting this flag to
auto will allow the batcher to automatically switch between calldata and blobs based on the current L1 gas price.calldata, blobs, and auto. The default value is calldata.
- Syntax
- Example
- Environment Variable
--data-availability-type=<value>target-num-frames
The target number of frames to create per channel. Controls number of blobs per blob tx, if using Blob DA. The default value is1.
- Syntax
- Example
- Environment Variable
--target-num-frames=<value>max-channel-duration
The maximum duration of L1-blocks to keep a channel open. 0 to disable. The default value is0.
- Syntax
- Example
- Environment Variable
--max-channel-duration=<value>sub-safety-margin
The batcher tx submission safety margin (in #L1-blocks) to subtract from a channel’s timeout and sequencing window, to guarantee safe inclusion of a channel on L1. The default value is10.
- Syntax
- Example
- Environment Variable
--sub-safety-margin=<value>max-l1-tx-size-bytes
The maximum size of a batch tx submitted to L1. Ignored for blobs, where max blob size will be used. The default value is120000.
- Syntax
- Example
- Environment Variable
--max-l1-tx-size-bytes=<value>Batcher startup
wait-node-sync
Indicates if, during startup, the batcher should wait for a recent batcher tx on L1 to finalize (via more block confirmations). This should help avoid duplicate batcher txs. The default value isfalse.
- Syntax
- Example
- Environment Variable
--wait-node-sync=<value>check-recent-txs-depth
Indicates how many blocks back the batcher should look during startup for a recent batch tx on L1. This can speed up waiting for node sync. It should be set to the verifier confirmation depth of the sequencer (e.g. 4). The default value is0.
- Syntax
- Example
- Environment Variable
--check-recent-txs-depth=<value>stopped
Initialize the batcher in a stopped state. The batcher can be started using the admin_startBatcher RPC. The default value isfalse.
- Syntax
- Example
- Environment Variable
--stopped=<value>Throttling
The batcher supports throttling configuration to limit DA usage for transactions and blocks, and to control throttle intensity via several controller types (including an experimental PID controller). The following flags are available:throttle.additional-endpoints
Comma-separated list of endpoints to distribute throttling configuration to (in addition to the L2 endpoints specified with--l2-eth-rpc).
- Syntax
- Example
- Environment Variable
--throttle.additional-endpoints=<endpoint1>,<endpoint2>,...throttle.tx-size-lower-limit
The DA size limit for individual transactions when the throttle intensity is at its maximum.0 disables limits; use 1 as the smallest effective limit.
- Syntax
- Example
- Environment Variable
--throttle.tx-size-lower-limit=<bytes>throttle.tx-size-upper-limit
The DA size limit for individual transactions as throttle intensity approaches0 (minimal throttling). Not applied when throttling is inactive.
- Syntax
- Example
- Environment Variable
--throttle.tx-size-upper-limit=<bytes>throttle.block-size-lower-limit
The DA size limit for blocks when throttle intensity is at maximum (applies for linear and quadratic controllers).0 disables limits; use 1 as the smallest effective limit.
- Syntax
- Example
- Environment Variable
--throttle.block-size-lower-limit=<bytes>throttle.block-size-upper-limit
The DA size limit for blocks when throttling is inactive (throttle intensity = 0).- Syntax
- Example
- Environment Variable
--throttle.block-size-upper-limit=<bytes>throttle.controller-type
Type of throttle controller to use. Valid values:step, linear, or quadratic (default).
- Syntax
- Example
- Environment Variable
--throttle.controller-type=<step|linear|quadratic|pid>throttle.unsafe-da-bytes-lower-threshold
Threshold onunsafe_da_bytes beyond which the batcher will start to throttle the block builder. 0 disables throttling.
- Syntax
- Example
- Environment Variable
--throttle.unsafe-da-bytes-lower-threshold=<bytes>throttle.unsafe-da-bytes-upper-threshold
Threshold onunsafe_da_bytes at which throttling reaches maximum intensity (applies for linear and quadratic controllers).
- Syntax
- Example
- Environment Variable
--throttle.unsafe-da-bytes-upper-threshold=<bytes>Transaction manager
num-confirmations
Number of confirmations which we will wait after sending a transaction. The default value is10.
- Syntax
- Example
- Environment Variable
--num-confirmations=<value>max-pending-tx
The maximum number of pending transactions. 0 for no limit. The default value is1.
- Syntax
- Example
- Environment Variable
--max-pending-tx=<value>resubmission-timeout
Duration we will wait before resubmitting a transaction to L1. The default value is48s.
- Syntax
- Example
- Environment Variable
--resubmission-timeout=<value>safe-abort-nonce-too-low-count
Number of ErrNonceTooLow observations required to give up on a tx at a particular nonce without receiving confirmation. The default value is3.
- Syntax
- Example
- Environment Variable
--safe-abort-nonce-too-low-count=<value>txmgr.min-basefee
Enforces a minimum base fee (in GWei) to assume when determining tx fees. 1 GWei by default. The default value is1.
- Syntax
- Example
- Environment Variable
--txmgr.min-basefee=<value>txmgr.min-tip-cap
Enforces a minimum tip cap (in GWei) to use when determining tx fees. 1 GWei by default. The default value is1.
- Syntax
- Example
- Environment Variable
--txmgr.min-tip-cap=<value>fee-limit-multiplier
The multiplier applied to fee suggestions to put a hard limit on fee increases. The default value is5.
- Syntax
- Example
- Environment Variable
--fee-limit-multiplier=<value>txmgr.fee-limit-threshold
The minimum threshold (in GWei) at which fee bumping starts to be capped. Allows arbitrary fee bumps below this threshold. The default value is100.
- Syntax
- Example
- Environment Variable
--txmgr.fee-limit-threshold=<value>txmgr.receipt-query-interval
Frequency to poll for receipts. The default value is12s.
- Syntax
- Example
- Environment Variable
--txmgr.receipt-query-interval=<value>txmgr.not-in-mempool-timeout
Timeout for aborting a tx send if the tx does not make it to the mempool. The default value is2m0s.
- Syntax
- Example
- Environment Variable
--txmgr.not-in-mempool-timeout=<value>txmgr.send-timeout
Timeout for sending transactions. If 0 it is disabled. The default value is0s.
- Syntax
- Example
- Environment Variable
--txmgr.send-timeout=<value>Authentication and wallet
private-key
The private key to use with the service. Must not be used with mnemonic.- Syntax
- Example
- Environment Variable
--private-key=<value>mnemonic
The mnemonic used to derive the wallets for either the service.- Syntax
- Example
- Environment Variable
--mnemonic=<value>hd-path
The HD path used to derive the sequencer wallet from the mnemonic. The mnemonic flag must also be set.- Syntax
- Example
- Environment Variable
--hd-path=<value>signer.address
Address the signer is signing transactions for.- Syntax
- Example
- Environment Variable
--signer.address=<value>signer.endpoint
Signer endpoint the client will connect to.- Syntax
- Example
- Environment Variable
--signer.endpoint=<value>signer.header
Headers to pass to the remote signer. Formatkey=value.Value can contain any character allowed in an HTTP header.
When using env vars, split multiple headers with commas.
When using flags, provide one key-value pair per flag.
- Syntax
- Example
- Environment Variable
--signer.header=<key=value>signer.tls.ca
tls ca cert path. The default value istls/ca.crt.
- Syntax
- Example
- Environment Variable
--signer.tls.ca=<value>signer.tls.cert
tls cert path. The default value istls/tls.crt.
- Syntax
- Example
- Environment Variable
--signer.tls.cert=<value>signer.tls.key
tls key. The default value istls/tls.key.
- Syntax
- Example
- Environment Variable
--signer.tls.key=<value>Network connections
l1-eth-rpc
HTTP provider URL for L1.- Syntax
- Example
- Environment Variable
--l1-eth-rpc=<value>l2-eth-rpc
HTTP provider URL for L2 execution engine. A comma-separated list enables the active L2 endpoint provider. Such a list needs to match the number of rollup-rpcs provided.- Syntax
- Example
- Environment Variable
--l2-eth-rpc=<value>rollup-rpc
HTTP provider URL for Rollup node. A comma-separated list enables the active L2 endpoint provider. Such a list needs to match the number of l2-eth-rpcs provided.- Syntax
- Example
- Environment Variable
--rollup-rpc=<value>rpc.addr
rpc listening address. The default value is0.0.0.0.
- Syntax
- Example
- Environment Variable
--rpc.addr=<value>rpc.enable-admin
Enable the admin API. The default value isfalse.
- Syntax
- Example
- Environment Variable
--rpc.enable-admin=<value>rpc.port
rpc listening port. The default value is8545.
- Syntax
- Example
- Environment Variable
--rpc.port=<value>network-timeout
Timeout for all network operations. The default value is10s.
- Syntax
- Example
- Environment Variable
--network-timeout=<value>Alt-DA mode (Beta feature)
altda.enabled
Enable Alt-DA mode, Alt-DA mode is a Beta feature of the OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues. The default value isfalse.
- Syntax
- Example
- Environment Variable
--altda.enabled=<value>altda.da-server
HTTP address of a DA Server.- Syntax
- Example
- Environment Variable
--altda.da-server=<value>altda.da-service
Use DA service type where commitments are generated by Alt-DA server. The default value isfalse.
- Syntax
- Example
- Environment Variable
--altda.da-service=<value>altda.get-timeout
Timeout for get requests. 0 means no timeout.- Syntax
- Example
- Environment Variable
--altda.get-timeout=<value>altda.put-timeout
Timeout for put requests. 0 means no timeout.- Syntax
- Example
- Environment Variable
--altda.put-timeout=<value>altda.max-concurrent-da-requests
Maximum number of concurrent requests to the DA server.- Syntax
- Example
- Environment Variable
--altda.max-concurrent-da-requests=<value>altda.verify-on-read
Verify input data matches the commitments from the DA storage service.- Syntax
- Example
- Environment Variable
--altda.verify-on-read=<value>Logging and monitoring
log.level
The lowest log level that will be output. The default value isINFO.
- Syntax
- Example
- Environment Variable
--log.level=<value>log.format
Format the log output. Supported formats: ‘text’, ‘terminal’, ‘logfmt’, ‘json’, ‘json-pretty’. The default value istext.
- Syntax
- Example
- Environment Variable
--log.format=<value>log.color
Color the log output if in terminal mode. The default value isfalse.
- Syntax
- Example
- Environment Variable
--log.color=<value>log.pid
Show PID in the log.- Syntax
- Example
- Environment Variable
--log.pid=<value>metrics.enabled
Enable the metrics server. The default value isfalse.
- Syntax
- Example
- Environment Variable
--version=<value>Miscellaneous
active-sequencer-check-duration
The duration between checks to determine the active sequencer endpoint. The default value is2m0s.
- Syntax
- Example
- Environment Variable
--active-sequencer-check-duration=<value>pprof.addr
pprof listening address. The default value is0.0.0.0.
- Syntax
- Example
- Environment Variable
--pprof.addr=<value>pprof.enabled
Enable the pprof server. The default value isfalse.
- Syntax
- Example
- Environment Variable
--pprof.enabled=<value>pprof.path
pprof file path. If it is a directory, the path is{dir}/{profileType}.prof.
- Syntax
- Example
- Environment Variable
--pprof.path=<value>pprof.port
pprof listening port. The default value is6060.
- Syntax
- Example
- Environment Variable
--pprof.port=<value>pprof.type
pprof profile type. One of cpu, heap, goroutine, threadcreate, block, mutex, allocs.- Syntax
- Example
- Environment Variable
--pprof.type=<value>help
Show help. The default value is false.- Syntax
- Example
- Environment Variable
--help=<value>version
Print the version. The default value is false.- Syntax
- Example
- Environment Variable
--version=<value>