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

optimism: syncing dtl with correct contracts (#881)

* optimism: syncing dtl with correct contracts

* chore: add changeset
parent 7dd2f720
---
'@eth-optimism/l2geth': patch
'@eth-optimism/data-transport-layer': patch
---
Fix bug with replica syncing where contract creations would fail in replicas but pass in the sequencer. This was due to the change from a custom batched tx serialization to the batch serialzation for txs being regular RLP encoding
......@@ -18,8 +18,6 @@ import (
const (
sequencer = "sequencer"
l1 = "l1"
EIP155 = "EIP155"
ETH_SIGN = "ETH_SIGN"
)
// errElementNotFound represents the error case of the remote element not being
......@@ -109,7 +107,7 @@ type decoded struct {
GasLimit uint64 `json:"gasLimit"`
GasPrice uint64 `json:"gasPrice"`
Nonce uint64 `json:"nonce"`
Target common.Address `json:"target"`
Target *common.Address `json:"target"`
Data hexutil.Bytes `json:"data"`
}
......@@ -304,10 +302,10 @@ func batchedTransactionToTransaction(res *transaction, signer *types.EIP155Signe
data := res.Decoded.Data
var tx *types.Transaction
if to == (common.Address{}) {
if to == nil {
tx = types.NewContractCreation(nonce, value, gasLimit, gasPrice, data)
} else {
tx = types.NewTransaction(nonce, to, value, gasLimit, gasPrice, data)
tx = types.NewTransaction(nonce, *to, value, gasLimit, gasPrice, data)
}
txMeta := types.NewTransactionMeta(
......
......@@ -51,7 +51,7 @@ export const handleSequencerBlock = {
gasLimit: BigNumber.from(transaction.gas).toNumber(),
gasPrice: BigNumber.from(transaction.gasPrice).toNumber(), // ?
nonce: BigNumber.from(transaction.nonce).toNumber(),
target: transaction.to || constants.AddressZero, // ?
target: transaction.to,
data: transaction.input,
}
......@@ -66,7 +66,7 @@ export const handleSequencerBlock = {
gasLimit: transaction.gas,
gasPrice: transaction.gasPrice,
nonce: transaction.nonce,
to: transaction.to || constants.AddressZero,
to: transaction.to,
data: transaction.input,
chainId,
},
......
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