Skip to content

Commit

Permalink
Merge pull request #1597 from ethereum-optimism/fix/batch-submitter-e…
Browse files Browse the repository at this point in the history
…rr-msg

batch-submitter: handle error case explicitly
  • Loading branch information
tynes committed Oct 18, 2021
2 parents 7c05692 + ce03037 commit 7bd42d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-buckets-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/batch-submitter': patch
---

Handle error case more explicity when creating invalid batch
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
return
}

const [batchParams, wasBatchTruncated] =
await this._generateSequencerBatchParams(startBlock, endBlock)
const params = await this._generateSequencerBatchParams(startBlock, endBlock)
if (!params) {
throw new Error(`Cannot create sequencer batch with params start ${startBlock} and end ${endBlock}`)
}

const [batchParams, wasBatchTruncated] = params
const batchSizeInBytes = encodeAppendSequencerBatch(batchParams).length / 2
this.logger.debug('Sequencer batch generated', {
batchSizeInBytes,
Expand Down

0 comments on commit 7bd42d9

Please sign in to comment.