Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Commit

Permalink
[Fix] Transaction size calculation bug (#70)
Browse files Browse the repository at this point in the history
* [Fix] Transaction size calculation bug

* remove console log
  • Loading branch information
annieke authored Mar 31, 2021
1 parent e0b1128 commit 8411431
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/batch-submitter/state-batch-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class StateBatchSubmitter extends BatchSubmitter {
'appendStateBatch',
[batch, startBlock]
)
if (!this._shouldSubmitBatch(tx.length * 2)) {
if (!this._shouldSubmitBatch(tx.length / 2)) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/batch-submitter/tx-batch-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
batchParams,
wasBatchTruncated,
] = await this._generateSequencerBatchParams(startBlock, endBlock)
const batchSizeInBytes = encodeAppendSequencerBatch(batchParams).length * 2
const batchSizeInBytes = encodeAppendSequencerBatch(batchParams).length / 2

// Only submit batch if one of the following is true:
// 1. it was truncated
Expand Down

0 comments on commit 8411431

Please sign in to comment.