Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reprocess full batch in parallel (sanity check) #2425

Merged
merged 3 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ MaxTxLifetime = "3h"
ForcedBatchesFinalityNumberOfBlocks = 64
TimestampResolution = "10s"
StopSequencerOnBatchNum = 0
SequentialReprocessFullBatch = false
[Sequencer.DBManager]
PoolRetrievalInterval = "500ms"
L2ReorgRetrievalInterval = "5s"
Expand Down
4 changes: 2 additions & 2 deletions docs/config-file/node-config-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</pre></div> </div><div id=Sequencer_FrequencyToCheckTxsForDelete_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxTxsPerBatch onclick="anchorLink('Sequencer.MaxTxsPerBatch')">Sequencer.MaxTxsPerBatch=</a> </div> <span class="badge badge-success default-value">Default: 300</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxTxsPerBatch is the maximum amount of transactions in the batch</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxBatchBytesSize onclick="anchorLink('Sequencer.MaxBatchBytesSize')">Sequencer.MaxBatchBytesSize=</a> </div> <span class="badge badge-success default-value">Default: 120000</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxBatchBytesSize is the maximum batch size in bytes<br> (subtracted bits of all types.Sequence fields excluding BatchL2Data from MaxTxSizeForL1)</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxCumulativeGasUsed onclick="anchorLink('Sequencer.MaxCumulativeGasUsed')">Sequencer.MaxCumulativeGasUsed=</a> </div> <span class="badge badge-success default-value">Default: 30000000</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxCumulativeGasUsed is max gas amount used by batch</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxKeccakHashes onclick="anchorLink('Sequencer.MaxKeccakHashes')">Sequencer.MaxKeccakHashes=</a> </div> <span class="badge badge-success default-value">Default: 2145</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxKeccakHashes is max keccak hashes used by batch</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxPoseidonHashes onclick="anchorLink('Sequencer.MaxPoseidonHashes')">Sequencer.MaxPoseidonHashes=</a> </div> <span class="badge badge-success default-value">Default: 252357</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxPoseidonHashes is max poseidon hashes batch can handle</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxPoseidonPaddings onclick="anchorLink('Sequencer.MaxPoseidonPaddings')">Sequencer.MaxPoseidonPaddings=</a> </div> <span class="badge badge-success default-value">Default: 135191</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxPoseidonPaddings is max poseidon paddings batch can handle</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxMemAligns onclick="anchorLink('Sequencer.MaxMemAligns')">Sequencer.MaxMemAligns=</a> </div> <span class="badge badge-success default-value">Default: 236585</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxMemAligns is max mem aligns batch can handle</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxArithmetics onclick="anchorLink('Sequencer.MaxArithmetics')">Sequencer.MaxArithmetics=</a> </div> <span class="badge badge-success default-value">Default: 236585</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxArithmetics is max arithmetics batch can handle</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxBinaries onclick="anchorLink('Sequencer.MaxBinaries')">Sequencer.MaxBinaries=</a> </div> <span class="badge badge-success default-value">Default: 473170</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxBinaries is max binaries batch can handle</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxSteps onclick="anchorLink('Sequencer.MaxSteps')">Sequencer.MaxSteps=</a> </div> <span class="badge badge-success default-value">Default: 7570538</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>MaxSteps is max steps batch can handle</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.TxLifetimeCheckTimeout onclick="anchorLink('Sequencer.TxLifetimeCheckTimeout')">Sequencer.TxLifetimeCheckTimeout=</a> </div> <span class="badge badge-success default-value">Default: "10m0s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>TxLifetimeCheckTimeout is the time the sequencer waits to check txs lifetime</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_TxLifetimeCheckTimeout_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_TxLifetimeCheckTimeout_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxTxLifetime onclick="anchorLink('Sequencer.MaxTxLifetime')">Sequencer.MaxTxLifetime=</a> </div> <span class="badge badge-success default-value">Default: "3h0m0s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>MaxTxLifetime is the time a tx can be in the sequencer memory</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_MaxTxLifetime_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#Sequencer.MaxTxLifetime onclick="anchorLink('Sequencer.MaxTxLifetime')">Sequencer.MaxTxLifetime=</a> </div> <span class="badge badge-success default-value">Default: "3h0m0s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>MaxTxLifetime is the time a tx can be in the sequencer/worker memory</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_MaxTxLifetime_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_MaxTxLifetime_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
</pre></div> </div> <hr> <div class=accordion id=accordionSequencer_Finalizer> <div class=card> <div class=card-header id=headingSequencer_Finalizer> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#Sequencer_Finalizer aria-expanded aria-controls=Sequencer_Finalizer onclick="setAnchor('#Sequencer_Finalizer')"><span class=property-name> <div class=breadcrumbs>[<a href=#Sequencer onclick="anchorLink('Sequencer')">Sequencer</a> . <a href=#Sequencer_Finalizer onclick="anchorLink('Sequencer_Finalizer')">Finalizer</a>] </div></span></button> </h2> Finalizer&#39;s specific config properties </div> <div id=Sequencer_Finalizer class="collapse property-definition-div" aria-labelledby=headingSequencer_Finalizer data-parent=#accordionSequencer_Finalizer> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.GERDeadlineTimeout onclick="anchorLink('Sequencer.Finalizer.GERDeadlineTimeout')">Sequencer.Finalizer.GERDeadlineTimeout=</a> </div> <span class="badge badge-success default-value">Default: "5s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>GERDeadlineTimeout is the time the finalizer waits after receiving closing signal to update Global Exit Root</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_Finalizer_GERDeadlineTimeout_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_Finalizer_GERDeadlineTimeout_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
Expand All @@ -38,7 +38,7 @@
</pre></div> </div><div id=Sequencer_Finalizer_ClosingSignalsManagerWaitForCheckingForcedBatches_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.ForcedBatchesFinalityNumberOfBlocks onclick="anchorLink('Sequencer.Finalizer.ForcedBatchesFinalityNumberOfBlocks')">Sequencer.Finalizer.ForcedBatchesFinalityNumberOfBlocks=</a> </div> <span class="badge badge-success default-value">Default: 64</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>ForcedBatchesFinalityNumberOfBlocks is number of blocks to consider GER final</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.TimestampResolution onclick="anchorLink('Sequencer.Finalizer.TimestampResolution')">Sequencer.Finalizer.TimestampResolution=</a> </div> <span class="badge badge-success default-value">Default: "10s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>TimestampResolution is the resolution of the timestamp used to close a batch</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_Finalizer_TimestampResolution_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_Finalizer_TimestampResolution_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.StopSequencerOnBatchNum onclick="anchorLink('Sequencer.Finalizer.StopSequencerOnBatchNum')">Sequencer.Finalizer.StopSequencerOnBatchNum=</a> </div> <span class="badge badge-success default-value">Default: 0</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>StopSequencerOnBatchNum specifies the batch number where the Sequencer will stop to process more transactions and generate new batches. The Sequencer will halt after it closes the batch equal to this number</p> </span> <hr> </div> </div> </div> </div> <div class=accordion id=accordionSequencer_DBManager> <div class=card> <div class=card-header id=headingSequencer_DBManager> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#Sequencer_DBManager aria-expanded aria-controls=Sequencer_DBManager onclick="setAnchor('#Sequencer_DBManager')"><span class=property-name> <div class=breadcrumbs>[<a href=#Sequencer onclick="anchorLink('Sequencer')">Sequencer</a> . <a href=#Sequencer_DBManager onclick="anchorLink('Sequencer_DBManager')">DBManager</a>] </div></span></button> </h2> DBManager&#39;s specific config properties </div> <div id=Sequencer_DBManager class="collapse property-definition-div" aria-labelledby=headingSequencer_DBManager data-parent=#accordionSequencer_DBManager> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.DBManager.PoolRetrievalInterval onclick="anchorLink('Sequencer.DBManager.PoolRetrievalInterval')">Sequencer.DBManager.PoolRetrievalInterval=</a> </div> <span class="badge badge-success default-value">Default: "500ms"</span><span class="badge badge-dark value-type">Type: string</span><br> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_DBManager_PoolRetrievalInterval_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.StopSequencerOnBatchNum onclick="anchorLink('Sequencer.Finalizer.StopSequencerOnBatchNum')">Sequencer.Finalizer.StopSequencerOnBatchNum=</a> </div> <span class="badge badge-success default-value">Default: 0</span><span class="badge badge-dark value-type">Type: integer</span><br> <span class=description><p>StopSequencerOnBatchNum specifies the batch number where the Sequencer will stop to process more transactions and generate new batches. The Sequencer will halt after it closes the batch equal to this number</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.SequentialReprocessFullBatch onclick="anchorLink('Sequencer.Finalizer.SequentialReprocessFullBatch')">Sequencer.Finalizer.SequentialReprocessFullBatch=</a> </div> <span class="badge badge-success default-value">Default: false</span><span class="badge badge-dark value-type">Type: boolean</span><br> <span class=description><p>SequentialReprocessFullBatch indicates if the reprocess of a closed batch (sanity check) must be done in a<br> sequential way (instead than in parallel)</p> </span> <hr> </div> </div> </div> </div> <div class=accordion id=accordionSequencer_DBManager> <div class=card> <div class=card-header id=headingSequencer_DBManager> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#Sequencer_DBManager aria-expanded aria-controls=Sequencer_DBManager onclick="setAnchor('#Sequencer_DBManager')"><span class=property-name> <div class=breadcrumbs>[<a href=#Sequencer onclick="anchorLink('Sequencer')">Sequencer</a> . <a href=#Sequencer_DBManager onclick="anchorLink('Sequencer_DBManager')">DBManager</a>] </div></span></button> </h2> DBManager&#39;s specific config properties </div> <div id=Sequencer_DBManager class="collapse property-definition-div" aria-labelledby=headingSequencer_DBManager data-parent=#accordionSequencer_DBManager> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.DBManager.PoolRetrievalInterval onclick="anchorLink('Sequencer.DBManager.PoolRetrievalInterval')">Sequencer.DBManager.PoolRetrievalInterval=</a> </div> <span class="badge badge-success default-value">Default: "500ms"</span><span class="badge badge-dark value-type">Type: string</span><br> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_DBManager_PoolRetrievalInterval_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_DBManager_PoolRetrievalInterval_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
</pre></div> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.DBManager.L2ReorgRetrievalInterval onclick="anchorLink('Sequencer.DBManager.L2ReorgRetrievalInterval')">Sequencer.DBManager.L2ReorgRetrievalInterval=</a> </div> <span class="badge badge-success default-value">Default: "5s"</span><span class="badge badge-dark value-type">Type: string</span><br> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_DBManager_L2ReorgRetrievalInterval_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_DBManager_L2ReorgRetrievalInterval_ex2 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;300ms&quot;</span>
Expand Down
18 changes: 17 additions & 1 deletion docs/config-file/node-config-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ TxLifetimeCheckTimeout="10m0s"

**Default:** `"3h0m0s"`

**Description:** MaxTxLifetime is the time a tx can be in the sequencer memory
**Description:** MaxTxLifetime is the time a tx can be in the sequencer/worker memory

**Examples:**

Expand Down Expand Up @@ -1294,6 +1294,7 @@ MaxTxLifetime="3h0m0s"
| - [ForcedBatchesFinalityNumberOfBlocks](#Sequencer_Finalizer_ForcedBatchesFinalityNumberOfBlocks ) | No | integer | No | - | ForcedBatchesFinalityNumberOfBlocks is number of blocks to consider GER final |
| - [TimestampResolution](#Sequencer_Finalizer_TimestampResolution ) | No | string | No | - | Duration |
| - [StopSequencerOnBatchNum](#Sequencer_Finalizer_StopSequencerOnBatchNum ) | No | integer | No | - | StopSequencerOnBatchNum specifies the batch number where the Sequencer will stop to process more transactions and generate new batches. The Sequencer will halt after it closes the batch equal to this number |
| - [SequentialReprocessFullBatch](#Sequencer_Finalizer_SequentialReprocessFullBatch ) | No | boolean | No | - | SequentialReprocessFullBatch indicates if the reprocess of a closed batch (sanity check) must be done in a<br />sequential way (instead than in parallel) |

#### <a name="Sequencer_Finalizer_GERDeadlineTimeout"></a>10.16.1. `Sequencer.Finalizer.GERDeadlineTimeout`

Expand Down Expand Up @@ -1533,6 +1534,21 @@ TimestampResolution="10s"
StopSequencerOnBatchNum=0
```

#### <a name="Sequencer_Finalizer_SequentialReprocessFullBatch"></a>10.16.12. `Sequencer.Finalizer.SequentialReprocessFullBatch`

**Type:** : `boolean`

**Default:** `false`

**Description:** SequentialReprocessFullBatch indicates if the reprocess of a closed batch (sanity check) must be done in a
sequential way (instead than in parallel)

**Example setting the default value** (false):
```
[Sequencer.Finalizer]
SequentialReprocessFullBatch=false
```

### <a name="Sequencer_DBManager"></a>10.17. `[Sequencer.DBManager]`

**Type:** : `object`
Expand Down
7 changes: 6 additions & 1 deletion docs/config-file/node-config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
"MaxTxLifetime": {
"type": "string",
"title": "Duration",
"description": "MaxTxLifetime is the time a tx can be in the sequencer memory",
"description": "MaxTxLifetime is the time a tx can be in the sequencer/worker memory",
"default": "3h0m0s",
"examples": [
"1m",
Expand Down Expand Up @@ -565,6 +565,11 @@
"type": "integer",
"description": "StopSequencerOnBatchNum specifies the batch number where the Sequencer will stop to process more transactions and generate new batches. The Sequencer will halt after it closes the batch equal to this number",
"default": 0
},
"SequentialReprocessFullBatch": {
"type": "boolean",
"description": "SequentialReprocessFullBatch indicates if the reprocess of a closed batch (sanity check) must be done in a\nsequential way (instead than in parallel)",
"default": false
}
},
"additionalProperties": false,
Expand Down
Loading
Loading