quorum icon indicating copy to clipboard operation
quorum copied to clipboard

Strange EVM failure not reproducable in other environment

Open stevenroose opened this issue 8 years ago • 6 comments

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();
    }
}

stevenroose avatar Jun 06 '18 14:06 stevenroose

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++

fixanoid avatar Jun 08 '18 21:06 fixanoid

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.

stevenroose avatar Jun 08 '18 22:06 stevenroose

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 avatar Jun 11 '18 13:06 chriseth

@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.

jpmsam avatar Jun 11 '18 14:06 jpmsam

Wonderful, thanks!

chriseth avatar Jun 11 '18 14:06 chriseth

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!

stevenroose avatar Jun 12 '18 09:06 stevenroose