From 5d616c14812c11e6f1e5fdefbdbde0ba9fca7213 Mon Sep 17 00:00:00 2001 From: protolambda Date: Wed, 7 Jun 2023 14:37:36 +0200 Subject: [PATCH] optimism: set chain-ID of pre-bedrock relayed txs --- internal/ethapi/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 0ccbc48aeb..fea76fed78 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1473,6 +1473,10 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber result.Nonce = hexutil.Uint64(*receipt.DepositNonce) } case types.LegacyTxType: + if v.Sign() == 0 && r.Sign() == 0 && s.Sign() == 0 { // pre-bedrock relayed tx does not have a signature + result.ChainID = (*hexutil.Big)(new(big.Int).Set(config.ChainID)) + break + } // if a legacy transaction has an EIP-155 chain id, include it explicitly if id := tx.ChainId(); id.Sign() != 0 { result.ChainID = (*hexutil.Big)(id)