You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,6 +265,12 @@ The application can be configured using the following flags at runtime:
265
265
|`profiler-host`|`localhost`| Host for the pprof profiler |
266
266
|`profiler-port`|`6060`| Port for the pprof profiler |
267
267
|`tx-state-validation`|`""`| When set to `local-index` will validate EVM transaction state locally |
268
+
|`tx-mempool-mode`|`false`| Enable the nonce-aware transaction mempool: expected-nonce transactions are submitted immediately, out-of-order transactions are held per-EOA until their nonce gap fills. Mutually exclusive with `tx-batch-mode` and requires `tx-state-validation=local-index`. |
269
+
|`tx-collection-window`|`300ms`| Per-EOA sliding collection window for the transaction mempool. Resets on each arrival from the same EOA. Only applies when `tx-mempool-mode=true`. |
270
+
|`tx-submission-spacing`|`1200ms`| Minimum gap between consecutive Cadence submissions for the same EOA in the transaction mempool; also serves as the flush deadline for a continuously-fed collection window. Recommended ~1.5x the block production rate. Must be >= `tx-collection-window`. Only applies when `tx-mempool-mode=true`. |
271
+
|`tx-pool-ttl`|`30s`| How long the transaction mempool holds an out-of-order transaction waiting for its nonce gap to fill, before submitting it anyway. Only applies when `tx-mempool-mode=true`. |
272
+
|`tx-max-batch-size`|`5`| Maximum number of EVM transactions per `EVM.batchRun` Cadence transaction in the transaction mempool. Only applies when `tx-mempool-mode=true`. |
273
+
|`tx-max-nonce-gap`|`500`| How far ahead of an EOA's on-chain nonce the transaction mempool accepts a nonce; nonces beyond `indexedNonce + gap` are rejected as nonce-too-high. `0` disables the upper bound. A nonce below the indexed nonce is always rejected as nonce-too-low. Only applies when `tx-mempool-mode=true`. |
"tx-collection-window (%s) must not exceed tx-submission-spacing (%s)",
249
+
cfg.TxCollectionWindow, cfg.TxSubmissionSpacing,
250
+
)
251
+
}
252
+
ifcfg.TxPoolTTL<=0 {
253
+
returnfmt.Errorf("tx-pool-ttl must be > 0 when tx-mempool-mode is enabled")
254
+
}
255
+
ifcfg.TxMaxBatchSize<1 {
256
+
returnfmt.Errorf("tx-max-batch-size must be >= 1 when tx-mempool-mode is enabled")
257
+
}
258
+
}
259
+
233
260
returnnil
234
261
}
235
262
@@ -299,6 +326,12 @@ func init() {
299
326
Cmd.Flags().BoolVar(&experimentalSoftFinalityEnabled, "experimental-soft-finality-enabled", false, "Sets whether the gateway should use the experimental soft finality feature. WARNING: This may result in incorrect results being returned in certain circumstances. Use only if you know what you are doing.")
300
327
Cmd.Flags().BoolVar(&experimentalSealingVerificationEnabled, "experimental-sealing-verification-enabled", true, "Sets whether the gateway should use the experimental soft finality sealing verification feature. WARNING: This may result in indexing halts if events do not match. Use only if you know what you are doing.")
301
328
Cmd.Flags().DurationVar(&cfg.EOAActivityCacheTTL, "eoa-activity-cache-ttl", time.Second*10, "[DEPRECATED] No longer has any effect. BatchTxPool now always pools every transaction before submission.")
329
+
Cmd.Flags().BoolVar(&cfg.TxMemPoolMode, "tx-mempool-mode", false, "Enable the transaction mempool: expected-nonce transactions are submitted immediately, out-of-order transactions are held until their nonce gap fills. Mutually exclusive with --tx-batch-mode and requires --tx-state-validation=local-index.")
330
+
Cmd.Flags().DurationVar(&cfg.TxCollectionWindow, "tx-collection-window", 300*time.Millisecond, "Per-EOA sliding collection window for the transaction mempool. Resets on each arrival from the same EOA.")
331
+
Cmd.Flags().DurationVar(&cfg.TxSubmissionSpacing, "tx-submission-spacing", 1200*time.Millisecond, "Minimum gap between consecutive Cadence submissions for the same EOA in the transaction mempool; also serves as the flush deadline for a continuously-fed collection window. Recommended ~1.5x the block production rate.")
332
+
Cmd.Flags().DurationVar(&cfg.TxPoolTTL, "tx-pool-ttl", 30*time.Second, "How long the transaction mempool holds an out-of-order transaction waiting for its nonce gap to fill, before submitting it anyway.")
333
+
Cmd.Flags().IntVar(&cfg.TxMaxBatchSize, "tx-max-batch-size", 5, "Maximum number of EVM transactions per EVM.batchRun Cadence transaction in the transaction mempool.")
334
+
Cmd.Flags().Uint64Var(&cfg.TxMaxNonceGap, "tx-max-nonce-gap", 500, "How far ahead of an EOA's on-chain nonce the transaction mempool accepts a nonce; nonces beyond indexedNonce+gap are rejected as nonce-too-high. 0 means no upper bound. A nonce below the indexed nonce is always rejected as nonce-too-low regardless of this setting.")
302
335
Cmd.Flags().DurationVar(&cfg.RpcRequestTimeout, "rpc-request-timeout", time.Second*120, "Sets the maximum duration at which JSON-RPC requests should generate a response, before they timeout. The default is 120 seconds.")
303
336
304
337
err:=Cmd.Flags().MarkDeprecated("init-cadence-height", "This flag is no longer necessary and will be removed in future version. The initial Cadence height is known for testnet/mainnet and this was only required for fresh deployments of EVM Gateway. Once the DB has been initialized, the latest index Cadence height will be used upon start-up.")
0 commit comments