I use this repo (as well as this one) to generate raw transaction and send it to the Polygon network through JSON-RPC in C++, but I get the error code -32000 (rlp: value size exceeds available input length).

TX tx;
tx.chainId = "0x25";
tx.to = "0x72a56b...";
tx.data = "0x310edb4d000000...";// around 600 bytes of data
tx.value = "0x00";
tx.gasLimit = "0xffff";
tx.gasPrice = "0x10";
tx.nonce = "0x361";

What can cause this problem?

  • I suggest implement the same in golang and check which field produces different values. Looks like this library is outdated but there was some change in RLP module recently
    – Nulik
    Aug 19 at 15:50
  • @Nulik I checked it with Ethereum specs, there was a bug in the repo code which I fixed, but I now get "Invalid sender" error from ` eth_sendRawTransaction`. Do you have any idea about this one? Aug 20 at 7:54
  • most likely wrong chain ID when signing
    – Nulik
    Aug 20 at 16:14
  • if you are sending legacy transactions then it must be EIP155 signer type
    – Nulik
    Aug 20 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.