Skip to content

Commit

Permalink
Merge pull request ethereum#99 from ethereum-optimism/relayed-tx-chai…
Browse files Browse the repository at this point in the history
…n-id-api-fix

optimism: set chain-ID of pre-bedrock relayed txs
  • Loading branch information
ajsutton authored Jun 7, 2023
2 parents a22cadc + 5d616c1 commit 09ade3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 09ade3d

Please sign in to comment.