celo-org / op-geth

GNU Lesser General Public License v3.0
0 stars 0 forks source link

Remove json transaction unmarshaling support for celo transactions legacy transactions retrieved from a celo node. #237

Open piersy opened 2 months ago

piersy commented 2 months ago

We should do this some time after we have migrated all celo chains to be L2s.

In celo_transaction_marshaling.go the function celoTransactionUnmarshal has the following code, we simply need to replace if dec.EthCompatible == nil || *dec.EthCompatible == true { with if dec.EthCompatible == nil {

func celoTransactionUnmarshal(dec txJSON, inner *TxData) (bool, error) {
    switch dec.Type {
    case LegacyTxType:
        // EthCompatible is only set to false for celo legacy transactions in the op-geth codebase, otherwise its not
        // set. So not set means it is ethCompatible. However in order to support correct unmarshaling of a celo legacy
        // transaction, retrieved from a celo node (for the purposes of running our api compatibility test) we also need to
        // handle the case where EthCompatible is set to true. 
        if dec.EthCompatible == nil || *dec.EthCompatible == true {
            return false, nil
        }