Commit f1b27318 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix[dtl]: represent gas limit as a string to avoid issues with large gas limits (#969)

* fix[dtl]: represent gas limit as a string to avoid issues with large gas limits

* chore: add changeset

* l2geth: rollup client type decode string

* chore: add changeset
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
parent 77108d37
---
'@eth-optimism/l2geth': patch
---
Fixes incorrect type parsing in the RollupClient. The gasLimit became greater than the largest safe JS number so it needs to be represented as a string
---
'@eth-optimism/data-transport-layer': patch
---
Represent gaslimit as a string to avoid an overflow
......@@ -104,7 +104,7 @@ type signature struct {
type decoded struct {
Signature signature `json:"sig"`
Value hexutil.Uint64 `json:"value"`
GasLimit uint64 `json:"gasLimit"`
GasLimit uint64 `json:"gasLimit,string"`
GasPrice uint64 `json:"gasPrice"`
Nonce uint64 `json:"nonce"`
Target *common.Address `json:"target"`
......
......@@ -244,7 +244,7 @@ const maybeDecodeSequencerBatchTransaction = (
return {
nonce: BigNumber.from(decodedTx.nonce).toNumber(),
gasPrice: BigNumber.from(decodedTx.gasPrice).toNumber(),
gasLimit: BigNumber.from(decodedTx.gasLimit).toNumber(),
gasLimit: BigNumber.from(decodedTx.gasLimit).toString(),
value: toRpcHexString(decodedTx.value),
target: toHexString(decodedTx.to), // Maybe null this out for creations?
data: toHexString(decodedTx.data),
......
......@@ -48,7 +48,7 @@ export const handleSequencerBlock = {
s: padHexString(transaction.s, 32),
},
value: transaction.value,
gasLimit: BigNumber.from(transaction.gas).toNumber(),
gasLimit: BigNumber.from(transaction.gas).toString(),
gasPrice: BigNumber.from(transaction.gasPrice).toNumber(), // ?
nonce: BigNumber.from(transaction.nonce).toNumber(),
target: transaction.to,
......
......@@ -5,7 +5,7 @@ export interface DecodedSequencerBatchTransaction {
v: number
}
value: string
gasLimit: number
gasLimit: string
gasPrice: number
nonce: number
target: string
......
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