Skip to content

Commit e410362

Browse files
Merge branch 'develop' into regenesis/0.4.0
2 parents c4c7bea + 5e3c5d1 commit e410362

File tree

23 files changed

+1085
-21
lines changed

23 files changed

+1085
-21
lines changed

.changeset/cool-baboons-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@eth-optimism/smock': patch
3+
---
4+
5+
Fixes a bug that would break call assertions for overloaded smocked functions

.changeset/nasty-dots-grow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@eth-optimism/l2geth': patch
3+
'@eth-optimism/data-transport-layer': patch
4+
---
5+
6+
Fix gasLimit overflow

.changeset/sharp-files-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@eth-optimism/message-relayer': patch
3+
---
4+
5+
Adds a new set of tools for generating messages to be relayed and their proofs

l2geth/rollup/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type transaction struct {
6969
BlockNumber uint64 `json:"blockNumber"`
7070
Timestamp uint64 `json:"timestamp"`
7171
Value hexutil.Uint64 `json:"value"`
72-
GasLimit uint64 `json:"gasLimit"`
72+
GasLimit uint64 `json:"gasLimit,string"`
7373
Target common.Address `json:"target"`
7474
Origin *common.Address `json:"origin"`
7575
Data hexutil.Bytes `json:"data"`
@@ -83,7 +83,7 @@ type Enqueue struct {
8383
Index *uint64 `json:"ctcIndex"`
8484
Target *common.Address `json:"target"`
8585
Data *hexutil.Bytes `json:"data"`
86-
GasLimit *uint64 `json:"gasLimit"`
86+
GasLimit *uint64 `json:"gasLimit,string"`
8787
Origin *common.Address `json:"origin"`
8888
BlockNumber *uint64 `json:"blockNumber"`
8989
Timestamp *uint64 `json:"timestamp"`

packages/data-transport-layer/src/db/transport-db.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,38 @@ export class TransportDB {
379379
if (index === null) {
380380
return null
381381
}
382-
383-
return this.db.get<TEntry>(`${key}:index`, index)
382+
let entry = await this.db.get<TEntry>(`${key}:index`, index)
383+
entry = stringify(entry)
384+
return entry
384385
}
385386

386387
private async _getEntries<TEntry extends Indexed>(
387388
key: string,
388389
startIndex: number,
389390
endIndex: number
390391
): Promise<TEntry[] | []> {
391-
return this.db.range<TEntry>(`${key}:index`, startIndex, endIndex)
392+
const entries = await this.db.range<TEntry>(
393+
`${key}:index`,
394+
startIndex,
395+
endIndex
396+
)
397+
const results = []
398+
for (const entry of entries) {
399+
results.push(stringify(entry))
400+
}
401+
return results
402+
}
403+
}
404+
405+
function stringify(entry) {
406+
if (entry === null || entry === undefined) {
407+
return entry
408+
}
409+
if (entry.gasLimit) {
410+
entry.gasLimit = BigNumber.from(entry.gasLimit).toString()
411+
}
412+
if (entry.decoded) {
413+
entry.decoded.gasLimit = BigNumber.from(entry.decoded.gasLimit).toString()
392414
}
415+
return entry
393416
}

packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const handleEventsSequencerBatchAppended: EventHandlerSet<
6969
submitter: l1Transaction.from,
7070
l1TransactionHash: l1Transaction.hash,
7171
l1TransactionData: l1Transaction.data,
72-
gasLimit: SEQUENCER_GAS_LIMIT,
72+
gasLimit: `${SEQUENCER_GAS_LIMIT}`,
7373

7474
prevTotalElements: batchSubmissionEvent.args._prevTotalElements,
7575
batchIndex: batchSubmissionEvent.args._batchIndex,
@@ -115,7 +115,7 @@ export const handleEventsSequencerBatchAppended: EventHandlerSet<
115115
batchIndex: extraData.batchIndex.toNumber(),
116116
blockNumber: BigNumber.from(context.blockNumber).toNumber(),
117117
timestamp: BigNumber.from(context.timestamp).toNumber(),
118-
gasLimit: BigNumber.from(extraData.gasLimit).toNumber(),
118+
gasLimit: BigNumber.from(extraData.gasLimit).toString(),
119119
target: SEQUENCER_ENTRYPOINT_ADDRESS,
120120
origin: null,
121121
data: toHexString(sequencerTransaction),
@@ -147,7 +147,7 @@ export const handleEventsSequencerBatchAppended: EventHandlerSet<
147147
batchIndex: extraData.batchIndex.toNumber(),
148148
blockNumber: BigNumber.from(0).toNumber(),
149149
timestamp: BigNumber.from(0).toNumber(),
150-
gasLimit: BigNumber.from(0).toNumber(),
150+
gasLimit: BigNumber.from(0).toString(),
151151
target: constants.AddressZero,
152152
origin: constants.AddressZero,
153153
data: '0x',

packages/data-transport-layer/src/services/l1-ingestion/handlers/transaction-enqueued.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const handleEventsTransactionEnqueued: EventHandlerSet<
1717
index: event.args._queueIndex.toNumber(),
1818
target: event.args._target,
1919
data: event.args._data,
20-
gasLimit: event.args._gasLimit.toNumber(),
20+
gasLimit: event.args._gasLimit.toString(),
2121
origin: event.args._l1TxOrigin,
2222
blockNumber: BigNumber.from(event.blockNumber).toNumber(),
2323
timestamp: event.args._timestamp.toNumber(),

packages/data-transport-layer/src/services/l2-ingestion/handlers/transaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const handleSequencerBlock = {
5757

5858
transactionEntry = {
5959
...transactionEntry,
60-
gasLimit: SEQUENCER_GAS_LIMIT, // ?
60+
gasLimit: `${SEQUENCER_GAS_LIMIT}`, // ?
6161
target: SEQUENCER_ENTRYPOINT_ADDRESS,
6262
origin: null,
6363
data: serialize(
@@ -82,7 +82,7 @@ export const handleSequencerBlock = {
8282
} else {
8383
transactionEntry = {
8484
...transactionEntry,
85-
gasLimit: BigNumber.from(transaction.gas).toNumber(),
85+
gasLimit: BigNumber.from(transaction.gas).toString(),
8686
target: ethers.utils.getAddress(transaction.to),
8787
origin: ethers.utils.getAddress(transaction.l1TxOrigin),
8888
data: transaction.input,

packages/data-transport-layer/src/types/database-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface EnqueueEntry {
1616
index: number
1717
target: string
1818
data: string
19-
gasLimit: number
19+
gasLimit: string
2020
origin: string
2121
blockNumber: number
2222
timestamp: number
@@ -28,7 +28,7 @@ export interface TransactionEntry {
2828
data: string
2929
blockNumber: number
3030
timestamp: number
31-
gasLimit: number
31+
gasLimit: string
3232
target: string
3333
origin: string
3434
value: string

packages/data-transport-layer/src/types/event-handler-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export interface SequencerBatchAppendedExtraData {
4040
submitter: string
4141
l1TransactionData: string
4242
l1TransactionHash: string
43-
gasLimit: number
43+
gasLimit: string
4444

4545
// Stuff from TransactionBatchAppended.
4646
prevTotalElements: BigNumber

0 commit comments

Comments
 (0)