|
| 1 | +# Configuration |
| 2 | + |
| 3 | +## Block Time |
| 4 | + |
| 5 | +Block times define how fast your application will produce blocks for the application. |
| 6 | + |
| 7 | +### How to change speed of block production |
| 8 | + |
| 9 | +If you have gone through both the [quick start tutorial](../tutorials/quick-start.md) and the |
| 10 | +[Full and sequencer node rollup setup](./full-and-sequencer-node) |
| 11 | +already, you're now ready to experiment with faster block times. |
| 12 | + |
| 13 | +In your `rollkit start [args...]` command, you will need to add a flag |
| 14 | +and then the argument for block time. |
| 15 | + |
| 16 | +The flag is: |
| 17 | + |
| 18 | +```bash |
| 19 | +--rollkit.node.block_time 1s |
| 20 | +``` |
| 21 | + |
| 22 | +Where `1s` can be adjusted to the speed of your choosing. |
| 23 | + |
| 24 | +Here is an example: |
| 25 | + |
| 26 | +```bash |
| 27 | +# start the chain |
| 28 | +rollkit start [existing flags...] // [!code --] |
| 29 | +rollkit start [existing flags...] --rollkit.node.block_time 1s // [!code ++] |
| 30 | +``` |
| 31 | + |
| 32 | +In the above example, we've changed it to one second blocks. |
| 33 | +Alternatively, you could slow your rollup down to 30 seconds: |
| 34 | + |
| 35 | +```bash |
| 36 | +--rollkit.node.block_time 30s |
| 37 | +``` |
| 38 | + |
| 39 | +Or speed it up even more, to sub-second block times (100 milliseconds): |
| 40 | + |
| 41 | +```bash |
| 42 | +--rollkit.node.block_time 100ms |
| 43 | +``` |
| 44 | + |
| 45 | +## DA Block Time |
| 46 | + |
| 47 | +DA Blocktime defines how fast the DA layer is moving. The default value will be the block speed of Celestia Mainnet. |
| 48 | + |
| 49 | +## How to configure DA chain block syncing time |
| 50 | + |
| 51 | +The `--rollkit.da.block_time` flag is used to configure the time in seconds that the rollup will wait for a block to be synced from the DA chain. |
| 52 | + |
| 53 | +```bash |
| 54 | +--rollkit.da.block_time duration |
| 55 | +``` |
| 56 | + |
| 57 | +An example command would look like this: |
| 58 | + |
| 59 | +```bash |
| 60 | +rollkit start [existing flags...] // [!code --] |
| 61 | +rollkit start [existing flags...] --rollkit.da.block_time=30s // [!code ++] |
| 62 | +``` |
| 63 | + |
| 64 | +## Lazy Mode |
| 65 | + |
| 66 | +Lazy mode will produces blocks when transactions arrive to the node, if there are no transactions for a period of time it will produce an empty block. |
| 67 | + |
| 68 | +There is a small delay when a transaction comes in to wait for other transactions, this delay is the block time. The block time setting must be smaller than the lazy block interval time. |
| 69 | + |
| 70 | +### How to Use Lazy Sequencing (Aggregation) |
| 71 | + |
| 72 | +In this guide, we'll go over how to use lazy sequencing. |
| 73 | + |
| 74 | +This feature allows rollup operators to wait for transactions before building blocks. This prevents the rollup from building empty blocks. |
| 75 | + |
| 76 | +To turn on lazy sequencing, add the following flag to your start command: |
| 77 | + |
| 78 | +```bash |
| 79 | +--rollkit.node.lazy_mode |
| 80 | +``` |
| 81 | + |
| 82 | +Additionally, if you want to specify the time interval used for block production even if there are no transactions, use: |
| 83 | + |
| 84 | +```bash |
| 85 | +--rollkit.lazy_block_interval <duration> |
| 86 | +``` |
| 87 | + |
| 88 | +An example command with a custom block time of 1 minute: |
| 89 | + |
| 90 | +```bash |
| 91 | +# start the chain |
| 92 | +rollkit start [existing flags...] // [!code --] |
| 93 | +rollkit start [existing flags...] --rollkit.node.lazy_mode --rollkit.lazy_block_interval=1m0s ----rollkit.node.block_time 500ms // [!code ++] |
| 94 | +``` |
| 95 | + |
| 96 | +## Max Pending Blocks |
| 97 | + |
| 98 | +Max Pending Blocks is a limit that will pause block production when too many blocks are waiting for DA confirmation |
| 99 | + |
| 100 | +### How to configure the maximum number of blocks pending DA submission |
| 101 | + |
| 102 | +The `--rollkit.node.max_pending_blocks` flag is used to configure the maximum limit of blocks pending DA submission (0 for no limit) |
| 103 | + |
| 104 | +:::Note |
| 105 | +If the `max_pending_blocks` is set to 0 the system will not wait for DA inclusion for block production. |
| 106 | +::: |
| 107 | + |
| 108 | +```bash |
| 109 | +--rollkit.node.max_pending_blocks uint |
| 110 | +``` |
| 111 | + |
| 112 | +An example command would look like this: |
| 113 | + |
| 114 | +```bash |
| 115 | +rollkit start [existing flags...] // [!code --] |
| 116 | +rollkit start [existing flags...] --rollkit.node.max_pending_blocks=100 // [!code ++] |
| 117 | +``` |
0 commit comments