Open benorgera opened 2 years ago
It appears using INT_MAX as the gas limit did cause the bad RLP. Same issue using INT_MAX - 1. The intention here was to have transactions gas only limited by the network.
To get this behavior, I am able to specify some sufficiently large number, ie. 300000000000 works (10000 times the current ethereum block gas limit). I don't know what is the first number large enough to cause this RLP bug, but there is probably an overflowing type conversion somewhere. AFAIK you should be able to specify INT_MAX without error
cc @Rjected
maybe this has something to do with geth gaslimit type which is perhaps an u64?
in any case, even it would be rlp deserialized correctly it would be rejected right away
yeah, the gaslimit in geth seems to be a u64, we can probably safely change that (as well as nonce) from a Option<U256>
to a Option<U64>
. The only thing that I'm wondering is why 300000000000
would cause an issue, since that's not over 64 bits.
should check this out more and make sure the tx types are consistent with geth
Is it OK for us to change the gas limit to U64? If it doesn't break any RPC decoding stuff it might be fine. I think revm also uses u64.
Version
Platform
Linux 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Description When signing an EIP1559 TypedTransaction via
tx.rlp_signed(...)
and submitting it to mainnet usingsend_raw_transaction(...)
, my RPC replies withJsonRpcClientError(JsonRpcError(JsonRpcError { code: -32600, message: \"reading transaction object failed
.Upon closer inspection, the rawTx payload is not well-formed RLP.
I used this code to generate, sign, and send the transaction:
A sample rawTx I got from this code is
0x02f8ec010c8080a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9423706b3d3a6667fafa53fcbf54f4933e5f912471872276193e524000b8645bebdaf60000000000000000000000000000000000000000000000000000000000000045000000000000000000000000000000000000000000000000002276193e5240000000000000000000000000000000000000000000000000000000000000000000c001a03cd81a267232917ebe4b9320ee12160157106da4630e71ed47b61617deadeb99a0388707564882939ad16d0a0675ffcab0a1a214d533f0880d9c285f9554a94dd1
.Plugging this rawTx into a few RLP decoders (ie. https://gist.github.com/miguelmota/9099b705cf433336036065ab748c8404) I see that this is a bad payload and failing assertions that a remainder must be zero.
I'm not an RLP expert but I believe I should be getting well formed RLP for my rawTx regardless of the fields I set in my Eip1559TransactionRequest. But maybe this has something to do with the specific data in my tx (ie. gas limit int max). Here is a sample tx which I got from the above code which produces a bad payload (addresses changed for anonymity):