From 3a8d8178b9544afae7c8c9ad169777dcf6055637 Mon Sep 17 00:00:00 2001 From: Shijiang Guo Date: Tue, 13 Jun 2023 14:18:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?hotfix:=20fix=20da=20dtl=20get=20queue=20is?= =?UTF-8?q?=20null=20from=20l1=20data,=20that=20may=20cause=20ver=E2=80=A6?= =?UTF-8?q?=20(#985)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hotfix: fix da dtl get queue is null from l1 data, that may cause verfier invalid siger error --- .../src/services/da-ingestion/service.ts | 73 +++++++++++-------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/packages/data-transport-layer/src/services/da-ingestion/service.ts b/packages/data-transport-layer/src/services/da-ingestion/service.ts index d2a5032d7..7da6d3ff3 100644 --- a/packages/data-transport-layer/src/services/da-ingestion/service.ts +++ b/packages/data-transport-layer/src/services/da-ingestion/service.ts @@ -187,12 +187,17 @@ export class DaIngestionService extends BaseService { ) // batch transaction list - await this._storeBatchTransactionsByDSId( + const execOk = await this._storeBatchTransactionsByDSId( dataStoreRollupId['data_store_id'], index, this.options.mantleDaUpgradeDataStoreId ) - + this.logger.info('store batch transactions by store id', { + execOk, + }) + if (!execOk) { + return + } // put rollup store info to db await this.state.db.putRollupStoreByBatchIndex( { @@ -320,7 +325,7 @@ export class DaIngestionService extends BaseService { ) { const transactionEntries: TransactionEntry[] = [] if (storeId <= 0) { - return [] + return false } const batchTxs = await this.GetBatchTransactionByDataStoreId(storeId) .then((rst) => { @@ -332,7 +337,7 @@ export class DaIngestionService extends BaseService { }) try { if (batchTxs.length === 0) { - return + return false } for (const batchTx of batchTxs) { const queueOrigin = @@ -371,34 +376,43 @@ export class DaIngestionService extends BaseService { s: '0x'.concat(sigS), }, } - let gasLimit = BigNumber.from(0).toString() - let target = constants.AddressZero - let origin = null if (batchTx['TxMeta']['queueIndex'] != null) { - const enqueue = await this.state.db.getEnqueueByIndex( - BigNumber.from(batchTx['TxMeta']['queueIndex']).toNumber() - ) - if (enqueue != null) { - gasLimit = enqueue.gasLimit - target = enqueue.target - origin = enqueue.origin + const lastestEnqueue = await this.state.db.getLatestEnqueue() + if (lastestEnqueue.index > batchTx['TxMeta']['queueIndex']) { + this.logger.info('get queue index from da and l1(EigenLayer)', { + lastestEnqueue: lastestEnqueue.index, + queueIndex: batchTx['TxMeta']['queueIndex'], + }) + const enqueue = await this.state.db.getEnqueueByIndex( + BigNumber.from(batchTx['TxMeta']['queueIndex']).toNumber() + ) + let gasLimit = BigNumber.from(0).toString() + let target = constants.AddressZero + let origin = null + if (enqueue != null) { + gasLimit = enqueue.gasLimit + target = enqueue.target + origin = enqueue.origin + } + transactionEntries.push({ + index: batchTx['TxMeta']['index'], + batchIndex: daBatchIndex, + blockNumber: batchTx['TxMeta']['l1BlockNumber'], + timestamp: batchTx['TxMeta']['l1Timestamp'], + gasLimit, + target, + origin, + data: txData, + queueOrigin, + value: batchTx['TxDetail']['value'], + queueIndex: batchTx['TxMeta']['queueIndex'], + decoded, + confirmed: true, + }) + } else { + return false } } - transactionEntries.push({ - index: batchTx['TxMeta']['index'], - batchIndex: daBatchIndex, - blockNumber: batchTx['TxMeta']['l1BlockNumber'], - timestamp: batchTx['TxMeta']['l1Timestamp'], - gasLimit, - target, - origin, - data: txData, - queueOrigin, - value: batchTx['TxDetail']['value'], - queueIndex: batchTx['TxMeta']['queueIndex'], - decoded, - confirmed: true, - }) this.daIngestionMetrics.currentL2TransactionIndex.set( batchTx['TxMeta']['index'] ) @@ -409,6 +423,7 @@ export class DaIngestionService extends BaseService { storeId + upgradeBatchIndex ) this.daIngestionMetrics.syncDataStoreId.set(upgradeBatchIndex + storeId) + return true } catch (error) { throw new Error(`eigen layer sync finish, error is: ${error}`) } From c78b0f208079e49676a0e94d91efb8e02665a482 Mon Sep 17 00:00:00 2001 From: Yoda Date: Tue, 13 Jun 2023 14:07:28 +0800 Subject: [PATCH 2/3] Update CODEOWNERS --- .github/CODEOWNERS | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a1c16b36a..268c1c2a2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,6 @@ /**/Dockerfile* @shidaxi /.github @shidaxi /ops @shidaxi @bradyjoestar -/tss @byteflyfunny -/subsidy @curryxbo -/mt-batcher @guoshijiang -/* @wukongcheng @bradyjoestar @silmaj @HaoyangLiu +/tss @byteflyfunny @Sha3nS @agnarsong +/mt-batcher @guoshijiang @agnarsong +/* @wukongcheng @bradyjoestar @Sha3nS @HaoyangLiu @agnarsong From 1ad10db6cb9a0728de8a1319a04c5a31aa9ea86a Mon Sep 17 00:00:00 2001 From: Yoda Date: Tue, 13 Jun 2023 14:18:57 +0800 Subject: [PATCH 3/3] update --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 268c1c2a2..0815cab87 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,6 @@ /**/Dockerfile* @shidaxi /.github @shidaxi /ops @shidaxi @bradyjoestar -/tss @byteflyfunny @Sha3nS @agnarsong +/tss @byteflyfunny @agnarsong /mt-batcher @guoshijiang @agnarsong /* @wukongcheng @bradyjoestar @Sha3nS @HaoyangLiu @agnarsong