Skip to content

Commit 7113933

Browse files
Simplify checks in the derivation pipeline (#296)
* Remove the superfluous check about the batcher address as now the Batch Inbox contract verifies the sender is legitimate.
1 parent d1b64b2 commit 7113933

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

op-node/rollup/derive/data_source.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ type DataSourceConfig struct {
9494
// isValidBatchTx returns true if:
9595
// 1. the transaction is not reverted
9696
// 2. the transaction type is any of Legacy, ACL, DynamicFee, Blob, or Deposit (for L3s).
97-
// 3. the transaction has a To() address that matches the batch inbox address, and
98-
// 4. the transaction has a valid signature from the batcher address
99-
func isValidBatchTx(tx *types.Transaction, receipt *types.Receipt, l1Signer types.Signer, batchInboxAddr, batcherAddr common.Address, logger log.Logger) bool {
97+
// 3. the transaction has a To() address that matches the batch inbox address
98+
func isValidBatchTx(tx *types.Transaction, receipt *types.Receipt, _ types.Signer, batchInboxAddr, batcherAddr common.Address, logger log.Logger) bool {
10099
if receipt.Status != types.ReceiptStatusSuccessful {
100+
logger.Warn("tx in inbox with invalid status", "hash", tx.Hash(), "status", receipt.Status)
101101
return false
102102
}
103103

@@ -110,15 +110,12 @@ func isValidBatchTx(tx *types.Transaction, receipt *types.Receipt, l1Signer type
110110
if to == nil || *to != batchInboxAddr {
111111
return false
112112
}
113-
seqDataSubmitter, err := l1Signer.Sender(tx) // optimization: only derive sender if To is correct
114-
if err != nil {
115-
logger.Warn("tx in inbox with invalid signature", "hash", tx.Hash(), "err", err)
116-
return false
117-
}
118-
// some random L1 user might have sent a transaction to our batch inbox, ignore them
119-
if seqDataSubmitter != batcherAddr {
120-
logger.Warn("tx in inbox with unauthorized submitter", "addr", seqDataSubmitter, "hash", tx.Hash(), "err", err)
121-
return false
122-
}
113+
114+
// NOTE: contrary to a standard OP batcher, we can safely skip any verification related
115+
// to the sender of the transaction. Indeed the Batch Inbox contract takes care of
116+
// ensuring the sender of the batch information is a legitimate batcher.
117+
// Thus the parameters l1Signer is not used anymore.
118+
// However, it is kept for compatibility with upstream code.
119+
123120
return true
124121
}

0 commit comments

Comments
 (0)