Closed poplexity closed 2 weeks ago
Where is the raw rlp from? this looks like invalid rlp, as the value is entirely zeros
For example this is the tx "decoded":
list header: f7
82
nonce: 12aa
85
gas_price: 75a1c379a2
83
gas_limit: 07a120
94
to: 7282835cf78a5e88a52fc701f09d1614635be4b8
90
value: 00000000000000000000000000000000
input: 80
v: 80
r: 80
s: 80
Our EVM is implemented as C++ >> WASM smart contract, and our RLP implementation is adapted from bloq/rlpvalue, we allow interoperability between the WASM network and the EVM which is why there is no signature (it was signed/authorized on the WASM network). This RLP implementation accepted the trx, similarly the tools listed above decode it to the same values that we currently have in our explorer which seems to differ after value
:
["0x12aa","0x75a1c379a2","0x07a120","0x7282835cf78a5e88a52fc701f09d1614635be4b8","0x00000000000000000000000000000000","0x","0x","0x","0x"]
Currently we are building our new RPC version that uses alloy/reth and so the goal is to decode into the TxLegacy
type from this RLP format that is in our block history.
how are you encoding the value field? this doesn't look like an integer
Our EVM is implemented as C++ >> WASM smart contract, and our RLP implementation is adapted from bloq/rlpvalue, we allow interoperability between the WASM network and the EVM which is why there is no signature (it was signed/authorized on the WASM network). This RLP implementation accepted the trx, similarly the tools listed above decode it to the same values that we currently have in our explorer which seems to differ after
value
:
["0x12aa","0x75a1c379a2","0x07a120","0x7282835cf78a5e88a52fc701f09d1614635be4b8","0x00000000000000000000000000000000","0x","0x","0x","0x"]
Currently we are building our new RPC version that uses alloy/reth and so the goal is to decode into the
TxLegacy
type from this RLP format that is in our block history.
yeah, the rlp implementation you are using is incorrect, and should output 0x80
for zero value. the online decoders should note that it's not valid tx rlp
this looks wrong
this uses a padded u8 vec for the amount when encoding the tx body, which would explain this issue
this should be uint256_t
The below test hits the
LeadingZero
error from hereVarious online tools like this and this seem happy to decode, but assuming that this
LeadingZero
error is properly enforcing the spec, would there be a way to opt-in to bypass that enforcement?