Commit c891827e authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #1346 from ethereum-optimism/fix/remove-append-queuebatch

batch-submitter: remove call to `appendQueueBatch`
parents d75395f5 39cea8fd
---
'@eth-optimism/batch-submitter': patch
---
Removes the call to `appendQueueBatch` from the batch submitter
...@@ -34,7 +34,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -34,7 +34,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
protected chainContract: CanonicalTransactionChainContract protected chainContract: CanonicalTransactionChainContract
protected l2ChainId: number protected l2ChainId: number
protected syncing: boolean protected syncing: boolean
private disableQueueBatchAppend: boolean
private autoFixBatchOptions: AutoFixBatchOptions private autoFixBatchOptions: AutoFixBatchOptions
private transactionSubmitter: TransactionSubmitter private transactionSubmitter: TransactionSubmitter
private gasThresholdInGwei: number private gasThresholdInGwei: number
...@@ -55,7 +54,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -55,7 +54,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
blockOffset: number, blockOffset: number,
logger: Logger, logger: Logger,
metrics: Metrics, metrics: Metrics,
disableQueueBatchAppend: boolean,
autoFixBatchOptions: AutoFixBatchOptions = { autoFixBatchOptions: AutoFixBatchOptions = {
fixDoublePlayedDeposits: false, fixDoublePlayedDeposits: false,
fixMonotonicity: false, fixMonotonicity: false,
...@@ -78,7 +76,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -78,7 +76,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
logger, logger,
metrics metrics
) )
this.disableQueueBatchAppend = disableQueueBatchAppend
this.autoFixBatchOptions = autoFixBatchOptions this.autoFixBatchOptions = autoFixBatchOptions
this.gasThresholdInGwei = gasThresholdInGwei this.gasThresholdInGwei = gasThresholdInGwei
this.transactionSubmitter = transactionSubmitter this.transactionSubmitter = transactionSubmitter
...@@ -137,11 +134,8 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -137,11 +134,8 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
'Syncing mode enabled! Skipping batch submission and clearing queue elements', 'Syncing mode enabled! Skipping batch submission and clearing queue elements',
{ pendingQueueElements } { pendingQueueElements }
) )
if (!this.disableQueueBatchAppend) {
return this.submitAppendQueueBatch()
}
} }
this.logger.info('Syncing mode enabled but queue is empty. Skipping...') this.logger.info('Syncing mode enabled but queue is empty. Skipping...')
return return
} }
...@@ -229,20 +223,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -229,20 +223,6 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
* Private Functions * * Private Functions *
********************/ ********************/
private async submitAppendQueueBatch(): Promise<TransactionReceipt> {
const tx = await this.chainContract.populateTransaction.appendQueueBatch(
ethers.constants.MaxUint256 // Completely empty the queue by appending (up to) an enormous number of queue elements.
)
const submitTransaction = (): Promise<TransactionReceipt> => {
return this.transactionSubmitter.submitTransaction(
tx,
this._makeHooks('appendQueueBatch')
)
}
// Empty the queue with a huge `appendQueueBatch(..)` call
return this._submitAndLogTx(submitTransaction, 'Cleared queue!')
}
private async submitAppendSequencerBatch( private async submitAppendSequencerBatch(
batchParams: AppendSequencerBatchParams batchParams: AppendSequencerBatchParams
): Promise<TransactionReceipt> { ): Promise<TransactionReceipt> {
......
...@@ -64,7 +64,6 @@ interface RequiredEnvVars { ...@@ -64,7 +64,6 @@ interface RequiredEnvVars {
/* Optional Env Vars /* Optional Env Vars
* FRAUD_SUBMISSION_ADDRESS * FRAUD_SUBMISSION_ADDRESS
* DISABLE_QUEUE_BATCH_APPEND
* SEQUENCER_PRIVATE_KEY * SEQUENCER_PRIVATE_KEY
* PROPOSER_PRIVATE_KEY * PROPOSER_PRIVATE_KEY
* MNEMONIC * MNEMONIC
...@@ -201,10 +200,6 @@ export const run = async () => { ...@@ -201,10 +200,6 @@ export const run = async () => {
'fraud-submisison-address', 'fraud-submisison-address',
env.FRAUD_SUBMISSION_ADDRESS || 'no fraud' env.FRAUD_SUBMISSION_ADDRESS || 'no fraud'
) )
const DISABLE_QUEUE_BATCH_APPEND = config.bool(
'disable-queue-batch-append',
!!env.DISABLE_QUEUE_BATCH_APPEND
)
const MIN_GAS_PRICE_IN_GWEI = config.uint( const MIN_GAS_PRICE_IN_GWEI = config.uint(
'min-gas-price-in-gwei', 'min-gas-price-in-gwei',
parseInt(env.MIN_GAS_PRICE_IN_GWEI, 10) || 0 parseInt(env.MIN_GAS_PRICE_IN_GWEI, 10) || 0
...@@ -389,7 +384,6 @@ export const run = async () => { ...@@ -389,7 +384,6 @@ export const run = async () => {
BLOCK_OFFSET, BLOCK_OFFSET,
logger.child({ name: TX_BATCH_SUBMITTER_LOG_TAG }), logger.child({ name: TX_BATCH_SUBMITTER_LOG_TAG }),
metrics, metrics,
DISABLE_QUEUE_BATCH_APPEND,
autoFixBatchOptions autoFixBatchOptions
) )
......
...@@ -230,7 +230,6 @@ describe('BatchSubmitter', () => { ...@@ -230,7 +230,6 @@ describe('BatchSubmitter', () => {
1, 1,
new Logger({ name: TX_BATCH_SUBMITTER_LOG_TAG }), new Logger({ name: TX_BATCH_SUBMITTER_LOG_TAG }),
testMetrics, testMetrics,
false
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment