1

I manually composed, signed, and serialized the following raw transaction:

02f87282053980018504a817c800825208940c512b60531e2440edbee50f48bafdc6d291d8dd890246ddf9797668000080c080a075488ef7d2d6192758545f0020dd3e381a610068e6e7539860461ca25a952d38a0377b07f01be37bc1ebb48eb1ec9fa62c8e4ebf5c6b03d31a113b964b8c9e37e9

It is a type-2 transaction consisting of the type-prefix byte and the RLP-encoded and signed transaction as per EIP-1559.

However, sending it to Geth gives me the following error:

eth.sendRawTransaction("0x02f87282053980018504a817c800825208940c512b60531e2440edbee50f48bafdc6d291d8dd890246ddf9797668000080c080a075488ef7d2d6192758545f0020dd3e381a610068e6e7539860461ca25a952d38a0377b07f01be37bc1ebb48eb1ec9fa62c8e4ebf5c6b03d31a113b964b8c9e37e9")
Error: rlp: expected input list for types.txdata
    at web3.js:6347:37(47)
    at web3.js:5081:62(37)
    at <eval>:1:23(4)

The transaction is a simple value transfer without any call data or any access list. However, it seems to expect some kind of list. My RLP-decoder manages to read the transaction as follows:

Eth::Tx.decode "02f87282053980018504a817c800825208940c512b60531e2440edbee50f48bafdc6d291d8dd890246ddf9797668000080c080a075488ef7d2d6192758545f0020dd3e381a610068e6e7539860461ca25a952d38a0377b07f01be37bc1ebb48eb1ec9fa62c8e4ebf5c6b03d31a113b964b8c9e37e9"
=> #<Eth::Tx::Eip1559:0x000056001ab1ab00
 @access_list=[],
 @amount=42000000000000000000,
 @chain_id=1337,
 @destination="0c512b60531e2440edbee50f48bafdc6d291d8dd",
 @gas_limit=21000,
 @max_fee_per_gas=20000000000,
 @max_priority_fee_per_gas=1,
 @payload="",
 @sender="61792A47cA5D231d0a8c165536586f83DC893C12",
 @signature_r="75488ef7d2d6192758545f0020dd3e381a610068e6e7539860461ca25a952d38",
 @signature_s="377b07f01be37bc1ebb48eb1ec9fa62c8e4ebf5c6b03d31a113b964b8c9e37e9",
 @signature_y_parity=0,
 @signer_nonce=0,
 @type=2>

But geth fails to decode the transaction. So I would assume there is a bug in my transaction composer or rlp-encoder. But I literally cannot see it. The following transaction decoders also fail:

This is what I manually decoded:

02                           # eip-1559 transaction tpye
f872                         # rlp-prefix (list of 12?)
     82 0539                 # chain id (1337)
     80                      # nonce (0)
        01                   # priority fee (1)
     85 04a817c800           # max fee (20 gwei)
     82 5208                 # gas limit (21_000)
     94 0c512b60531e2440edbee50f48bafdc6d291d8dd # destination
     89 0246ddf97976680000   # amount (42 ether)
     80                      # data (empty "")
     c0                      # access list (empty [])
     80                      # y-parity (0)
     a0 75488ef7d2d6192758545f0020dd3e381a610068e6e7539860461ca25a952d38 # r
     a0 377b07f01be37bc1ebb48eb1ec9fa62c8e4ebf5c6b03d31a113b964b8c9e37e9 # s

Where is the bug? Is an empty access list supposed to be 80 or c0?

Maybe related: How to encode empty transaction fields?

2 Answers 2

1

Ok, after manually debugging the RLP for an hour, it turned out that I was running a Geth version that did not support EIP-1559 yet. :facepalm:

INFO [01-18|16:50:33.830] Wrote custom genesis block OK            config="{ChainID: 1337 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 ConstantinopleFix: 0 Istanbul: 0 MuirGlacier: <nil> Engine: clique}"
INFO [01-18|16:50:33.830] Initialised chain configuration          config="{ChainID: 1337 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 ConstantinopleFix: 0 Istanbul: 0 MuirGlacier: <nil> Engine: clique}"
INFO [01-18|16:50:33.830] Initialising Ethereum protocol           versions="[65 64 63]" network=1337 dbversion=<nil>
WARN [01-18|16:50:33.830] Upgrade blockchain database version      from=<nil> to=8

Upgrading to v1.10.15 fixed it.

INFO [01-18|17:53:30.506] Initialised chain configuration          config="{ChainID: 1337 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: 0, Arrow Glacier: <nil>, MergeFork: <nil>, Engine: clique}"
INFO [01-18|17:53:30.506] Initialising Ethereum protocol           network=1337 dbversion=<nil>
1

The error rlp: expected input list for types.txdata happens when your signed raw tx is invalid. If you put the tx hex into an Ethereum tx decoder it will be invalid.

In this case, the EIP-1559 fee parameters maxFeePerGas and maxPriorityFeePerGas are not supported. Fix by replacing them with gas and gasPrice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.