Skip to content

Commit 5c6e6ed

Browse files
authored
Merge pull request #1215 from richardgreg/batcher-config-update
Batcher Configuration Page Update
2 parents 3cff469 + 003e8ab commit 5c6e6ed

File tree

1 file changed

+230
-36
lines changed
  • pages/builders/chain-operators/configuration

1 file changed

+230
-36
lines changed

pages/builders/chain-operators/configuration/batcher.mdx

+230-36
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,50 @@ import { Callout, Tabs } from 'nextra/components'
1010

1111
This page lists all configuration options for the op-batcher. The op-batcher posts
1212
L2 sequencer data to the L1, to make it available for verifiers. The following
13-
options are from the `--help` in [v1.7.6](https://github.com/ethereum-optimism/optimism/releases/tag/v1.7.6).
13+
options are from the `--help` in [v1.10.0](https://github.com/ethereum-optimism/optimism/releases/tag/op-batcher%2Fv1.10.0).
14+
15+
## Recommendations
16+
17+
### Set your `OP_BATCHER_MAX_CHANNEL_DURATION`
18+
19+
<Callout>
20+
The default value inside `op-batcher`, if not specified, is still `0`, which means channel duration tracking is disabled.
21+
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.
22+
</Callout>
23+
24+
To minimize costs, we recommend setting your `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.
25+
26+
* 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.
27+
* If your chain fills up full blobs of data before the `OP_BATCHER_MAX_CHANNEL_DURATION` elapses, a batch will be submitted anyways - (e.g. even if the OP Mainnet batcher sets an `OP_BATCHER_MAX_CHANNEL_DURATION` of 5 hours, it will still be submitting batches every few minutes)
28+
29+
<Callout type="warning">
30+
While setting an`OP_BATCHER_MAX_CHANNEL_DURATION` of `1500` results in the cheapest fees, it also means that your [safe head](https://github.com/ethereum-optimism/specs/blob/main/specs/glossary.md#safe-l2-head) can stall for up to 5 hours.
31+
32+
* 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.
33+
* Thus a larger gap between posting batches can result in significant delays in the operation of certain types of high-security applications.
34+
</Callout>
35+
36+
### Configure your batcher to use multiple blobs
37+
38+
The `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](https://specs.optimism.io/protocol/derivation.html#frame-format) for more technical details on channels and frames.
39+
40+
A minimal batcher configuration (with env vars) to enable 6-blob batcher transactions is:
41+
42+
```
43+
- OP_BATCHER_BATCH_TYPE=1 # span batches, optional
44+
- OP_BATCHER_DATA_AVAILABILITY_TYPE=blobs
45+
- OP_BATCHER_TARGET_NUM_FRAMES=6 # 6 blobs per tx
46+
- OP_BATCHER_TXMGR_MIN_BASEFEE=2.0 # 2 gwei, might need to tweak, depending on gas market
47+
- OP_BATCHER_TXMGR_MIN_TIP_CAP=2.0 # 2 gwei, might need to tweak, depending on gas market
48+
- OP_BATCHER_RESUBMISSION_TIMEOUT=240s # wait 4 min before bumping fees
49+
```
50+
51+
This enables blob transactions and sets the target number of frames to 6, which translates to 6 blobs per transaction.
52+
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.
53+
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.
54+
55+
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.
56+
You can use [this calculator](https://docs.google.com/spreadsheets/d/12VIiXHaVECG2RUunDSVJpn67IQp9NHFJqUsma2PndpE/edit) 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](/builders/chain-operators/management/blobs) for chain operators.
1457

1558
## Global options
1659

@@ -25,6 +68,81 @@ default value is `2m0s`.
2568
<Tabs.Tab>`OP_BATCHER_ACTIVE_SEQUENCER_CHECK_DURATION=2m0s`</Tabs.Tab>
2669
</Tabs>
2770

71+
### altda.da-server
72+
73+
HTTP address of a DA Server.
74+
75+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
76+
<Tabs.Tab>`--altda.da-server=<value>`</Tabs.Tab>
77+
<Tabs.Tab>`--altda.da-server=http://da.example.com:1234`</Tabs.Tab>
78+
<Tabs.Tab>`$OP_BATCHER_ALTDA_DA_SERVER=http://da.example.com:1234`</Tabs.Tab>
79+
</Tabs>
80+
81+
### altda.da-service
82+
83+
Use DA service type where commitments are generated by Alt-DA server. The default
84+
value is `false`.
85+
86+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
87+
<Tabs.Tab>`--altda.da-service=<value>`</Tabs.Tab>
88+
<Tabs.Tab>`--altda.da-service=true`</Tabs.Tab>
89+
<Tabs.Tab>`$OP_BATCHER_ALTDA_DA_SERVER=true`</Tabs.Tab>
90+
</Tabs>
91+
92+
### altda.enabled
93+
94+
Enable Alt-DA mode
95+
Alt-DA Mode is a Beta feature of the MIT licensed OP Stack.
96+
While it has received initial review from core contributors, it is still
97+
undergoing testing, and may have bugs or other issues.
98+
The default value is `false`.
99+
100+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
101+
<Tabs.Tab>`--altda.enabled=<value>`</Tabs.Tab>
102+
<Tabs.Tab>`--altda.enabled=false`</Tabs.Tab>
103+
<Tabs.Tab>`$OP_BATCHER_ALTDA_ENABLED=false`</Tabs.Tab>
104+
</Tabs>
105+
106+
### altda.get-timeout
107+
108+
Timeout for get requests. **0 means no timeout**.
109+
110+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
111+
<Tabs.Tab>`--altda.get-timeout=<value>`</Tabs.Tab>
112+
<Tabs.Tab>`--altda.get-timeout=5s`</Tabs.Tab>
113+
<Tabs.Tab>`OP_BATCHER_ALTDA_GET_TIMEOUT=5s`</Tabs.Tab>
114+
</Tabs>
115+
116+
### altda.max-concurrent-da-requests
117+
118+
Maximum number of concurrent requests to the DA server.
119+
120+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
121+
<Tabs.Tab>`--altda.max-concurrent-da-requests=<value>`</Tabs.Tab>
122+
<Tabs.Tab>`--altda.max-concurrent-da-requests=4`</Tabs.Tab>
123+
<Tabs.Tab>`OP_BATCHER_ALTDA_MAX_CONCURRENT_DA_REQUESTS=4`</Tabs.Tab>
124+
</Tabs>
125+
126+
### altda.put-timeout
127+
128+
Timeout for put requests. **0 means no timeout**.
129+
130+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
131+
<Tabs.Tab>`--altda.put-timeout=<value>`</Tabs.Tab>
132+
<Tabs.Tab>`--altda.put-timeout=10s`</Tabs.Tab>
133+
<Tabs.Tab>`OP_BATCHER_ALTDA_PUT_TIMEOUT=10s`</Tabs.Tab>
134+
</Tabs>
135+
136+
### altda.verify-on-read
137+
138+
Verify input data matches the commitments from the DA storage service.
139+
140+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
141+
<Tabs.Tab>`--altda.verify-on-read=<value>`</Tabs.Tab>
142+
<Tabs.Tab>`--altda.verify-on-read=true`</Tabs.Tab>
143+
<Tabs.Tab>`OP_BATCHER_ALTDA_VERIFY_ON_READ=true`</Tabs.Tab>
144+
</Tabs>
145+
28146
### approx-compr-ratio
29147

30148
The approximate compression ratio (`<=1.0`). Only relevant for ratio
@@ -168,6 +286,26 @@ The lowest log level that will be output. The default value is `INFO`.
168286
<Tabs.Tab>`OP_BATCHER_LOG_LEVEL=INFO`</Tabs.Tab>
169287
</Tabs>
170288

289+
### log.pid
290+
291+
Show PID in the log.
292+
293+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
294+
<Tabs.Tab>`--log.pid=<value>`</Tabs.Tab>
295+
<Tabs.Tab>`--log.pid=true`</Tabs.Tab>
296+
<Tabs.Tab>`OP_BATCHER_LOG_PID=true`</Tabs.Tab>
297+
</Tabs>
298+
299+
### max-blocks-per-span-batch
300+
301+
Maximum number of blocks to add to a span batch. **Default is 0 (no maximum)**.
302+
303+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
304+
<Tabs.Tab>`--max-blocks-per-span-batch=<value>`</Tabs.Tab>
305+
<Tabs.Tab>`--max-blocks-per-span-batch=100`</Tabs.Tab>
306+
<Tabs.Tab>`OP_BATCHER_MAX_BLOCKS_PER_SPAN_BATCH=100`</Tabs.Tab>
307+
</Tabs>
308+
171309
### max-channel-duration
172310

173311
The maximum duration of L1-blocks to keep a channel open. 0 to disable. The
@@ -470,6 +608,19 @@ Signer endpoint the client will connect to.
470608
<Tabs.Tab>`OP_BATCHER_SIGNER_ENDPOINT=`</Tabs.Tab>
471609
</Tabs>
472610

611+
### signer.header
612+
613+
Headers to pass to the remote signer. Format `key=value`.
614+
Value can contain any character allowed in an HTTP header.
615+
When using env vars, split multiple headers with commas.
616+
When using flags, provide one key-value pair per flag.
617+
618+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
619+
<Tabs.Tab>`--signer.header=<key=value>`</Tabs.Tab>
620+
<Tabs.Tab>`--signer.header="Authorization=Bearer 123abc"`</Tabs.Tab>
621+
<Tabs.Tab>`OP_BATCHER_SIGNER_HEADER=Authorization=Bearer 123abc`</Tabs.Tab>
622+
</Tabs>
623+
473624
### signer.tls.ca
474625

475626
tls ca cert path. The default value is `tls/ca.crt`.
@@ -534,6 +685,63 @@ blob tx, if using Blob DA. The default value is `1`.
534685
<Tabs.Tab>`OP_BATCHER_TARGET_NUM_FRAMES=1`</Tabs.Tab>
535686
</Tabs>
536687

688+
### throttle-always-block-size
689+
690+
The total DA limit to start imposing on block building **at all times**.
691+
692+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
693+
<Tabs.Tab>`--throttle-always-block-size=<value>`</Tabs.Tab>
694+
<Tabs.Tab>`--throttle-always-block-size=250000`</Tabs.Tab>
695+
<Tabs.Tab>`OP_BATCHER_THROTTLE_ALWAYS_BLOCK_SIZE=250000`</Tabs.Tab>
696+
</Tabs>
697+
698+
### throttle-block-size
699+
700+
The total DA limit to start imposing on block building **when we are over the throttle threshold**.
701+
702+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
703+
<Tabs.Tab>`--throttle-block-size=<value>`</Tabs.Tab>
704+
<Tabs.Tab>`--throttle-block-size=50000`</Tabs.Tab>
705+
<Tabs.Tab>`OP_BATCHER_THROTTLE_BLOCK_SIZE=50000`</Tabs.Tab>
706+
</Tabs>
707+
708+
---
709+
710+
### throttle-interval
711+
712+
Interval between potential DA throttling actions. **Zero disables throttling**.
713+
714+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
715+
<Tabs.Tab>`--throttle-interval=<value>`</Tabs.Tab>
716+
<Tabs.Tab>`--throttle-interval=5s`</Tabs.Tab>
717+
<Tabs.Tab>`OP_BATCHER_THROTTLE_INTERVAL=5s`</Tabs.Tab>
718+
</Tabs>
719+
720+
---
721+
722+
### throttle-threshold
723+
724+
Threshold on `pending-blocks-bytes-current` beyond which the batcher instructs the
725+
block builder to start throttling transactions with larger DA demands.
726+
727+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
728+
<Tabs.Tab>`--throttle-threshold=<value>`</Tabs.Tab>
729+
<Tabs.Tab>`--throttle-threshold=1500000`</Tabs.Tab>
730+
<Tabs.Tab>`OP_BATCHER_THROTTLE_THRESHOLD=1500000`</Tabs.Tab>
731+
</Tabs>
732+
733+
---
734+
735+
### throttle-tx-size
736+
737+
The DA size of transactions at which throttling begins **when we are over the throttle threshold**.
738+
739+
<Tabs items={['Syntax', 'Example', 'Environment Variable']}>
740+
<Tabs.Tab>`--throttle-tx-size=<value>`</Tabs.Tab>
741+
<Tabs.Tab>`--throttle-tx-size=10000`</Tabs.Tab>
742+
<Tabs.Tab>`OP_BATCHER_THROTTLE_TX_SIZE=10000`</Tabs.Tab>
743+
</Tabs>
744+
537745
### txmgr.fee-limit-threshold
538746

539747
The minimum threshold (in GWei) at which fee bumping starts to be capped.
@@ -631,45 +839,31 @@ Print the version. The default value is false.
631839
<Tabs.Tab>`--version=false`</Tabs.Tab>
632840
</Tabs>
633841

634-
## Recommendations
635-
636-
### Set your `OP_BATCHER_MAX_CHANNEL_DURATION`
637-
638-
<Callout>
639-
The default value inside `op-batcher`, if not specified, is still `0`, which means channel duration tracking is disabled.
640-
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.
641-
</Callout>
642-
643-
To minimize costs, we recommend setting your `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.
644-
645-
* 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.
646-
* If your chain fills up full blobs of data before the `OP_BATCHER_MAX_CHANNEL_DURATION` elapses, a batch will be submitted anyways - (e.g. even if the OP Mainnet batcher sets an `OP_BATCHER_MAX_CHANNEL_DURATION` of 5 hours, it will still be submitting batches every few minutes)
647-
648-
<Callout type="warning">
649-
While setting an`OP_BATCHER_MAX_CHANNEL_DURATION` of `1500` results in the cheapest fees, it also means that your [safe head](https://github.com/ethereum-optimism/specs/blob/main/specs/glossary.md#safe-l2-head) can stall for up to 5 hours.
842+
## Batcher Policy
650843

651-
* 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.
652-
* Thus a larger gap between posting batches can result in significant delays in the operation of certain types of high-security applications.
653-
</Callout>
844+
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.
654845

655-
### Configure your batcher to use multiple blobs
846+
| Parameter | Description | Administrator | Requirement | Notes |
847+
|-----------|------------|---------------|-------------|--------|
848+
| Data Availability Type | Specifies whether the batcher uses **blobs** or **calldata** 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.<br/>- The sequencer can switch at will between blob transactions and calldata, with no restrictions, because both are fully secured by L1. |
849+
| 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).<br/>- Leave a buffer for L1 network congestion and data size to ensure that each batch is fully committed in a timely manner. |
850+
| Output Frequency | Defines how frequently L2 output roots are submitted to L1 (via the output oracle). | L1 Proxy Admin | **43,200 L2 blocks** (24 hours at 2s block times) or lower | - Once fault proofs are implemented, this value may become deprecated.<br/>- It cannot be set to 0 (there must be some cadence for outputs). |
656851

657-
The `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](https://specs.optimism.io/protocol/derivation.html#frame-format) for more technical details on channels and frames.
852+
### Additional Guidance
658853

659-
A minimal batcher configuration (with env vars) to enable 6-blob batcher transactions is:
854+
* **Data Availability Types**:
855+
* **Calldata** is generally simpler but can be more expensive on mainnet Ethereum, depending on gas prices.
856+
* **Blobs** are typically lower cost when your chain has enough transaction volume to fill large chunks of data.
857+
* The `op-batcher` can toggle between these approaches by setting the `--data-availability-type=<blobs|calldata>` flag or with the `OP_BATCHER_DATA_AVAILABILITY_TYPE` env variable.
660858

661-
```
662-
- OP_BATCHER_BATCH_TYPE=1 # span batches, optional
663-
- OP_BATCHER_DATA_AVAILABILITY_TYPE=blobs
664-
- OP_BATCHER_TARGET_NUM_FRAMES=6 # 6 blobs per tx
665-
- OP_BATCHER_TXMGR_MIN_BASEFEE=2.0 # 2 gwei, might need to tweak, depending on gas market
666-
- OP_BATCHER_TXMGR_MIN_TIP_CAP=2.0 # 2 gwei, might need to tweak, depending on gas market
667-
- OP_BATCHER_RESUBMISSION_TIMEOUT=240s # wait 4 min before bumping fees
668-
```
859+
* **Batch Submission Frequency** (`OP_BATCHER_MAX_CHANNEL_DURATION` and related flags):
860+
* Standard OP Chains frequently target a maximum channel duration between 1–6 hours.
861+
* Your chain should never exceed your L2's sequencing window (commonly 12 hours).
862+
* If targeting a longer submission window (e.g., 5 or 6 hours), be aware that the [safe head](https://github.com/ethereum-optimism/specs/blob/main/specs/glossary.md#safe-l2-head) can stall up to that duration.
669863

670-
This enables blob transactions and sets the target number of frames to 6, which translates to 6 blobs per transaction.
671-
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.
672-
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.
864+
* **Output Frequency**:
865+
* Used to post output roots to L1 for verification.
866+
* The recommended maximum is 24 hours (43,200 blocks at 2s each), though many chains choose smaller intervals.
867+
* Will eventually be replaced or significantly changed by the introduction of fault proofs.
673868

674-
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.
675-
You can use [this calculator](https://docs.google.com/spreadsheets/d/12VIiXHaVECG2RUunDSVJpn67IQp9NHFJqUsma2PndpE/edit) 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](/builders/chain-operators/management/blobs) for chain operators.
869+
Include these high-level "policy" requirements when you set up or modify your `op-batcher` configuration. See the [Batcher Configuration](#global-options) reference, which explains each CLI flag and environment variable in depth.

0 commit comments

Comments
 (0)