Strange EVM failure not reproducable in other environment
We have a Quorum network setup with the latest master branch and Istanbul consensus.
After updating our contracts to Solidity version 0.4.22, we noticed contracts stopped working, while they were working in Remix with the JS VM. After some "debugging" uhum, we managed to create a snippet that fails in Quorum, but not in the JS VM.
The failure is an old-fashioned throw, meaning it uses the maximum gas provided and has no result. The place where it fails (according to the limited tracing Remix provides, is on the .what() getter.
pragma solidity ^0.4.22;
contract Tested {
bytes14 public what;
constructor(bytes14 _w) public {
what = _w;
}
}
contract Testing {
bytes14 public guessWhat;
function doIt(address _tested) public {
guessWhat = Tested(_tested).what();
}
}
Hey, @stevenroose so I just ran this in quorum-examples 7nodes and this executes. Could you specify what exactly you mean by stopped working and your quorum config? solc version I tested with
vagrant@ubuntu-xenial:~$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++
You think it's a solc bug? I have the same version, Version: 0.4.24+commit.e67f0147.Linux.g++.
I meant with stopped working that we redeployed and ran into unexpected problems.
This has to do with the EVM version. From 0.4.24 on, Solidity by default uses the Byzantium version of the EVM. The solution is to either set quorum to use byzantium or tell Solidity to use an old version of the EVM using solc --evm-version homestead. This of course removes some security features.
@chriseth Thanks for your answer! I had updated the reference genesis block to enable Byzantium on block 1. The above can help for anyone that doesn't want to enable it.
Wonderful, thanks!
The default chainspecs of Parity have the same problem. They enable none of the hardforks aka EVM upgrades.
Thank you so much, @chriseth, for ending almost a 2-week streak of desperately trying to resolve this!