Skip to content

Commit

Permalink
feat(batch-submitter): Ensure empty batches are not submitted
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian authored and smartcontracts committed Oct 14, 2021
1 parent 04b220c commit 948a530
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-lizards-change.md
@@ -0,0 +1,5 @@
---
'@eth-optimism/batch-submitter': patch
---

Ensure empty batches are not submitted
2 changes: 1 addition & 1 deletion ops/envs/batches.env
Expand Up @@ -3,7 +3,7 @@ ADDRESS_MANAGER_ADDRESS=
DEBUG=info*,error*,warn*,debug*

MAX_L1_TX_SIZE=90000
MIN_L1_TX_SIZE=0
MIN_L1_TX_SIZE=32
MAX_TX_BATCH_COUNT=50
MAX_STATE_BATCH_COUNT=50

Expand Down
2 changes: 1 addition & 1 deletion packages/batch-submitter/.env.example
Expand Up @@ -16,7 +16,7 @@ L1_NODE_WEB3_URL=http://localhost:9545
L2_NODE_WEB3_URL=http://localhost:8545

MAX_L1_TX_SIZE=90000
MIN_L1_TX_SIZE=0
MIN_L1_TX_SIZE=32
MAX_TX_BATCH_SIZE=50
MAX_STATE_BATCH_COUNT=2000
MAX_TX_BATCH_COUNT=250
Expand Down
5 changes: 5 additions & 0 deletions packages/batch-submitter/src/exec/run-batch-submitter.ts
Expand Up @@ -334,6 +334,11 @@ export const run = async () => {
}
}

if (requiredEnvVars.MIN_L1_TX_SIZE === 0) {
logger.error('Must configure a MIN_L1_TX_SIZE greater than 0')
process.exit(1)
}

const clearPendingTxs = requiredEnvVars.CLEAR_PENDING_TXS

const l2Provider = injectL2Context(
Expand Down

0 comments on commit 948a530

Please sign in to comment.