Skip to content

Commit

Permalink
Add delay when getting storedFlushId from the executor/hashdb (#3625)
Browse files Browse the repository at this point in the history
* Add sleep delay when getting storedFlushId from the executor/hashdb

* update config doc
  • Loading branch information
agnusmor committed Jun 6, 2024
1 parent e6864e5 commit 9cd04ca
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 18 deletions.
4 changes: 4 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func Test_Defaults(t *testing.T) {
path: "Sequencer.Finalizer.BatchMaxDeltaTimestamp",
expectedValue: types.NewDuration(1800 * time.Second),
},
{
path: "Sequencer.Finalizer.FlushIdCheckInterval",
expectedValue: types.NewDuration(50 * time.Millisecond),
},
{
path: "Sequencer.Finalizer.Metrics.Interval",
expectedValue: types.NewDuration(60 * time.Minute),
Expand Down
1 change: 1 addition & 0 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ StateConsistencyCheckInterval = "5s"
L2BlockMaxDeltaTimestamp = "3s"
ResourceExhaustedMarginPct = 10
StateRootSyncInterval = "3600s"
FlushIdCheckInterval = "50ms"
HaltOnBatchNumber = 0
SequentialBatchSanityCheck = false
SequentialProcessL2Block = false
Expand Down
1 change: 1 addition & 0 deletions config/environments/local/local.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ StateConsistencyCheckInterval = "5s"
L2BlockMaxDeltaTimestamp = "3s"
ResourceExhaustedMarginPct = 10
StateRootSyncInterval = "360s"
FlushIdCheckInterval = "50ms"
HaltOnBatchNumber = 0
SequentialBatchSanityCheck = false
SequentialProcessL2Block = false
Expand Down
2 changes: 2 additions & 0 deletions docs/config-file/node-config-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
</pre></div> </div><div id=Sequencer_Finalizer_L2BlockMaxDeltaTimestamp_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.StateRootSyncInterval onclick="anchorLink('Sequencer.Finalizer.StateRootSyncInterval')">Sequencer.Finalizer.StateRootSyncInterval=</a> </div> <span class="badge badge-success default-value">Default: "1h0m0s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>StateRootSyncInterval indicates how often the stateroot generated by the L2 block process will be synchronized with<br> the stateroot used in the tx-by-tx execution</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_Finalizer_StateRootSyncInterval_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_Finalizer_StateRootSyncInterval_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.FlushIdCheckInterval onclick="anchorLink('Sequencer.Finalizer.FlushIdCheckInterval')">Sequencer.Finalizer.FlushIdCheckInterval=</a> </div> <span class="badge badge-success default-value">Default: "50ms"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>FlushIdCheckInterval is the time interval to get storedFlushID value from the executor/hashdb</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_Finalizer_FlushIdCheckInterval_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_Finalizer_FlushIdCheckInterval_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.HaltOnBatchNumber onclick="anchorLink('Sequencer.Finalizer.HaltOnBatchNumber')">Sequencer.Finalizer.HaltOnBatchNumber=</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>HaltOnBatchNumber specifies the batch number where the Sequencer will stop to process more transactions and generate new batches.<br> 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.SequentialBatchSanityCheck onclick="anchorLink('Sequencer.Finalizer.SequentialBatchSanityCheck')">Sequencer.Finalizer.SequentialBatchSanityCheck=</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>SequentialBatchSanityCheck 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 class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.SequentialProcessL2Block onclick="anchorLink('Sequencer.Finalizer.SequentialProcessL2Block')">Sequencer.Finalizer.SequentialProcessL2Block=</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>SequentialProcessL2Block indicates if the processing of a L2 Block must be done in the same finalizer go func instead<br> in the processPendingL2Blocks go func</p> </span> <hr> <div class=accordion id=accordionSequencer_Finalizer_Metrics> <div class=card> <div class=card-header id=headingSequencer_Finalizer_Metrics> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#Sequencer_Finalizer_Metrics aria-expanded aria-controls=Sequencer_Finalizer_Metrics onclick="setAnchor('#Sequencer_Finalizer_Metrics')"><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> . <a href=#Sequencer_Finalizer_Metrics onclick="anchorLink('Sequencer_Finalizer_Metrics')">Metrics</a>] </div></span></button> </h2> Metrics is the config for the sequencer metrics </div> <div id=Sequencer_Finalizer_Metrics class="collapse property-definition-div" aria-labelledby=headingSequencer_Finalizer_Metrics data-parent=#accordionSequencer_Finalizer_Metrics> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><!-- None --><a href=#Sequencer.Finalizer.Metrics.Interval onclick="anchorLink('Sequencer.Finalizer.Metrics.Interval')">Sequencer.Finalizer.Metrics.Interval=</a> </div> <span class="badge badge-success default-value">Default: "1h0m0s"</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>Interval is the interval of time to calculate sequencer metrics</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=Sequencer_Finalizer_Metrics_Interval_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
</pre></div> </div><div id=Sequencer_Finalizer_Metrics_Interval_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 --><!-- None --><a href=#Sequencer.Finalizer.Metrics.EnableLog onclick="anchorLink('Sequencer.Finalizer.Metrics.EnableLog')">Sequencer.Finalizer.Metrics.EnableLog=</a> </div> <span class="badge badge-success default-value">Default: true</span><span class="badge badge-dark value-type">Type: boolean</span><br> <span class=description><p>EnableLog is a flag to enable/disable metrics logs</p> </span> <hr> </div> </div> </div> </div> </div> </div> </div> </div> <div class=accordion id=accordionSequencer_StreamServer> <div class=card> <div class=card-header id=headingSequencer_StreamServer> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#Sequencer_StreamServer aria-expanded aria-controls=Sequencer_StreamServer onclick="setAnchor('#Sequencer_StreamServer')"><span class=property-name> <div class=breadcrumbs>[<a href=#Sequencer onclick="anchorLink('Sequencer')">Sequencer</a> . <a href=#Sequencer_StreamServer onclick="anchorLink('Sequencer_StreamServer')">StreamServer</a>] </div></span></button> </h2> StreamServerCfg is the config for the stream server </div> <div id=Sequencer_StreamServer class="collapse property-definition-div" aria-labelledby=headingSequencer_StreamServer data-parent=#accordionSequencer_StreamServer> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Port onclick="anchorLink('Sequencer.StreamServer.Port')">Sequencer.StreamServer.Port=</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>Port to listen on</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Filename onclick="anchorLink('Sequencer.StreamServer.Filename')">Sequencer.StreamServer.Filename=</a> </div> <span class="badge badge-success default-value">Default: ""</span><span class="badge badge-dark value-type">Type: string</span><br> <span class=description><p>Filename of the binary data file</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Version onclick="anchorLink('Sequencer.StreamServer.Version')">Sequencer.StreamServer.Version=</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>Version of the binary data file</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.ChainID onclick="anchorLink('Sequencer.StreamServer.ChainID')">Sequencer.StreamServer.ChainID=</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>ChainID is the chain ID</p> </span> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Enabled onclick="anchorLink('Sequencer.StreamServer.Enabled')">Sequencer.StreamServer.Enabled=</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>Enabled is a flag to enable/disable the data streamer</p> </span> <hr> <div class=accordion id=accordionSequencer_StreamServer_Log> <div class=card> <div class=card-header id=headingSequencer_StreamServer_Log> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#Sequencer_StreamServer_Log aria-expanded aria-controls=Sequencer_StreamServer_Log onclick="setAnchor('#Sequencer_StreamServer_Log')"><span class=property-name> <div class=breadcrumbs>[<a href=#Sequencer onclick="anchorLink('Sequencer')">Sequencer</a> . <a href=#Sequencer_StreamServer onclick="anchorLink('Sequencer_StreamServer')">StreamServer</a> . <a href=#Sequencer_StreamServer_Log onclick="anchorLink('Sequencer_StreamServer_Log')">Log</a>] </div></span></button> </h2> Log is the log configuration </div> <div id=Sequencer_StreamServer_Log class="collapse property-definition-div" aria-labelledby=headingSequencer_StreamServer_Log data-parent=#accordionSequencer_StreamServer_Log> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Log.Environment onclick="anchorLink('Sequencer.StreamServer.Log.Environment')">Sequencer.StreamServer.Log.Environment=</a> </div> <span class="badge badge-success default-value">Default: ""</span><span class="badge badge-dark value-type">Type: enum (of string)</span><br> <div class=enum-value id=Sequencer_StreamServer_Log_Environment_enum> <h4>Must be one of:</h4> <ul class=list-group><li class="list-group-item enum-item">"production"</li><li class="list-group-item enum-item">"development"</li></ul> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Log.Level onclick="anchorLink('Sequencer.StreamServer.Log.Level')">Sequencer.StreamServer.Log.Level=</a> </div> <span class="badge badge-success default-value">Default: ""</span><span class="badge badge-dark value-type">Type: enum (of string)</span><br> <div class=enum-value id=Sequencer_StreamServer_Log_Level_enum> <h4>Must be one of:</h4> <ul class=list-group><li class="list-group-item enum-item">"debug"</li><li class="list-group-item enum-item">"info"</li><li class="list-group-item enum-item">"warn"</li><li class="list-group-item enum-item">"error"</li><li class="list-group-item enum-item">"dpanic"</li><li class="list-group-item enum-item">"panic"</li><li class="list-group-item enum-item">"fatal"</li></ul> </div> <hr> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.Log.Outputs onclick="anchorLink('Sequencer.StreamServer.Log.Outputs')">Sequencer.StreamServer.Log.Outputs=</a> </div><span class="badge badge-dark value-type">Type: array of string</span><br> <h4>Each item of this array must be:</h4> <div class=card> <div class="card-body items-definition" id=Sequencer_StreamServer_Log_Outputs_items> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><!-- None --><!-- None --><a href="#Sequencer.StreamServer.Log.Outputs.Outputs items" onclick="anchorLink('Sequencer.StreamServer.Log.Outputs.Outputs items')">Sequencer.StreamServer.Log.Outputs.Outputs items=</a> </div><span class="badge badge-dark value-type">Type: string</span><br> </div> </div> <hr> </div> </div> </div> </div> <div class=breadcrumbs> <!-- None --><!-- None --><!-- None --><a href=#Sequencer.StreamServer.UpgradeEtrogBatchNumber onclick="anchorLink('Sequencer.StreamServer.UpgradeEtrogBatchNumber')">Sequencer.StreamServer.UpgradeEtrogBatchNumber=</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>UpgradeEtrogBatchNumber is the batch number of the upgrade etrog</p> </span> <hr> </div> </div> </div> </div> </div> </div> </div> </div> <div class=accordion id=accordionSequenceSender> <div class=card> <div class=card-header id=headingSequenceSender> <h2 class=mb-0> <button class="btn btn-link property-name-button" type=button data-toggle=collapse data-target=#SequenceSender aria-expanded aria-controls=SequenceSender onclick="setAnchor('#SequenceSender')"><span class=property-name> <div class=breadcrumbs>[<a href=#SequenceSender onclick="anchorLink('SequenceSender')">SequenceSender</a>] </div></span></button> </h2> Configuration of the sequence sender service </div> <div id=SequenceSender class="collapse property-definition-div" aria-labelledby=headingSequenceSender data-parent=#accordionSequenceSender> <div class="card-body pl-5"> <div class=breadcrumbs> <!-- None --><!-- None --><a href=#SequenceSender.WaitPeriodSendSequence onclick="anchorLink('SequenceSender.WaitPeriodSendSequence')">SequenceSender.WaitPeriodSendSequence=</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>WaitPeriodSendSequence is the time the sequencer waits until<br> trying to send a sequence to L1</p> </span> <br> <div class="badge badge-secondary">Examples:</div> <br><div id=SequenceSender_WaitPeriodSendSequence_ex1 class="jumbotron examples"><div class=highlight><pre><span></span><span class=s2>&quot;1m&quot;</span>
Expand Down
Loading

0 comments on commit 9cd04ca

Please sign in to comment.