3

Trying to submit a transaction using remix on local javascript vm and it succeeds.

When I submit it on my real private network it fails with "invalid opcode 0x3d".. I can't seem to find 0x3d online... any idea what this error means? Is it gas related?

6

That's the instruction RETURNDATASIZE, which is specified in EIP-211. Your private network is probably out of date, if it doesn't support this. It was introduced in the mainnet during the Byzantium hard fork at block 4,370,000 in October 2017.

  • thanks for replying! Is there a way to fix this? workaround this error? Assuming my private network is out of date (which I'm not so sure about) how to go about fixing this?... So its weird because basically I have 2 contracts. one that does some transfer of coins (which works when I execute the transfer function), and the other one which is a wrapper that internally calls the contract which does the actual transfer... the call from the outer contract fails with 0x3d – Kevco26 Apr 26 '18 at 1:35
  • What software do you use for the private chain? I know that ganache has been upgraded months ago, if you want to give it a try. If nothing else works, you could use an old compiler version from before the hard fork. – mafrasi2 Apr 26 '18 at 1:41
  • So just to update, I am running geth 1.7.3 which it has RETURNDATASIZE in its core implementation and I'm using an Azure private ethereum network – Kevco26 Apr 26 '18 at 1:42
  • Ah, I see. Azure probably doesn't have the Byzantium update. I just noticed that you can set the EVM-cersion in the current solidity compiler. Just call solc with --evm-version spuriousDragon and these new instructions will be gone. – mafrasi2 Apr 26 '18 at 1:54
2

Thanks @mafrasi2.

I was able to solve this by doing the following:

  1. Upgrade geth: How to upgrade geth and mist in Ubuntu?
  2. Updated my genesis.json file to includue the byzantium block. Added the following line to the end of the config: "byzantiumBlock": 0
  3. Deleted chaindata located on .ethereum probably.
  4. Restarted geth by first running the new genesis block: geth init genesis.json
  5. Ran geth with the mining parameters, rpc, datadir, etc.
  6. You can verify you are running byzantium by checking a transaction receipt (eth.getTransactionReceipt(<tx hash>). if you see "status" as a column, then you are running byzantium.
  • nice, good to know that one has to set the hard fork block manually! – mafrasi2 Apr 26 '18 at 20:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.