rlp
rlp copied to clipboard
Issues with 0x00... prefixed addresses
Whe using to 0x00 prefixed addresses it'll return following error from GETH.
rlp: input string too short for common.Address, decoding into (types.DynamicFeeTx).To
I think that's the reason of recently introduced patch to remove leading 0's from strings. Seems that geth client can't decode addresses with 0's removed. So this seems to be in accordance with specification, but geth still can't read the data encoded according to specs when address is shorter than "normal".
patch to remove leading 0's from strings.
An address is not a string
, it's a fixed-length (20
) byte array.
So you say if the library im using is stripping 0-bytes from addresses it's not following the standard?
switch ($encoding) {
case 'hex':
if (strpos($input, '0x') === 0) {
$input = str_replace('0x', '', $input);
}
This code gets triggered for address
Actually found your other comment, thanks
Thanks @slawomir-pryczek, I'll fix this asap.
I am currently facing this issue as well and am hopeful for a resolution. Could the merging of the following PR potentially address this problem? If there is anything I can do to assist or expedite the process, I am more than willing to help. https://github.com/web3p/rlp/pull/28