Closed tonystatic closed 2 years ago
Hi @tonystatic ,
It seems there's issue in rlp, I'll look into this after update eip1559.
@sc0Vu note, that this PR really helps with it: https://github.com/web3p/rlp/pull/24
@sc0Vu, @olegabr thanks for your replies!
Can I do anything for now to try to avoid this problem?
UPD1: I tried to apply fixes from olegabr/rlp fork myself (on 83 line of RLP.php and on 53 line of Str.php) but it didn't fix the "Invalid RLP" error.
UPD2: I tried signing transaction with these exact params via web3 JS library and it produces valid transaction.
Hi @tonystatic, I think the issue might be wrong comparing in first byte, and it was fixed: https://github.com/web3p/rlp/commit/1653af23142863b490bdf22c6d0335bdb588c983
Would you like to test with the newest ethereum-tx or rlp library?
@sc0Vu, I tried it with the new version — and unfortunately it's still the same error. 😔 So I guess something else is a problem...
@tonystatic lol, I saw the nonce was set to 0x0: "nonce" => "0x00"
, would you like to use 0x1?
similar issue after sigining
$sign = new Transaction([
'nonce' => $nonce,
'from' => '0x4544d03F07136dc3D41E7ee9AdA3a062853b4Ab6',
'to' => $to,
'gas' => '0x76c0',
'gasPrice' => $gasPrice,
'value' => $value,
'data' => ''
]);
$raw = '0x' . $sign->sign($privateKey);
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "invalid sender" } }
$transaction = new Transaction([ 'nonce' => '0x1', 'from' => '0x56FE0F2335777d219aA67A4e66Bf48e2c4052553', 'to' => '0xc56eea61da347f9df11a3fc1cb9afce1f4dee126', 'gasPrice' => '0x178411b200', 'gas' => '0x5208', 'value' => '0x15a3d2bbca9800', 'chainId' => 1, ]);
i have "error":{"code":-32000,"message":"insufficient funds for gas * price + value"}
my balance in wei = 8212100000000000 gas = 21000 gasPrice = 101000000000 value = 6091100000000000
gas price + value = 21000 101000000000 + 6091100000000000 = 8212100000000000
I think @tonystatic issue was encoding the appending '00' bytes incorrectly. The encoded string was different with the other library.
About @dimonikus issue, I didn't see any difference between php/js library. Which transaction version did you use?
Already push some fix in rlp repo, that would be great if you can review it.
I'm using Infura for Kovan network and trying to call "transfer" method of an ERC20 contract. When I send it I get an Invalid RLP error.
My code:
Can it be caused by this package or something in my transaction data is wrong? Thanks in advance!