Conversation
| static EVMVersion homestead() { return {Version::Homestead}; } | ||
| static EVMVersion byzantium() { return {Version::Byzantium}; } | ||
|
|
||
| static boost::optional<EVMVersion> fromString(std::string const& _version) |
There was a problem hiding this comment.
Are we moving over to boost::optional? A lot of places started to use it now.
There was a problem hiding this comment.
I just think it is very convenient in this situation.
|
Ready for review. |
72354bb to
8833711
Compare
|
@axic ready for review. |
|
Actually I just realized we have a third test combination to run: contracts compiled for homestead, running on a byzantium VM... |
| if (futureInstructions.count(_instr)) | ||
| // We assume that returndatacopy, returndatasize and staticcall are either all available | ||
| // or all not available. | ||
| solAssert(m_evmVersion.hasReturndatacopy() == m_evmVersion.hasStaticCall(), ""); |
There was a problem hiding this comment.
Does hasReturndatacopy also means hasReturndatasize?
There was a problem hiding this comment.
Yes, I can rename it to hasReturndatacopyAndReturndatasize or add a comment.
There was a problem hiding this comment.
I think a comment is enough. Maybe hasReturndata was the generic name of the feature?
There was a problem hiding this comment.
I will change it to supportsReturndata.
test/RPCSession.cpp
Outdated
| "allowFutureBlocks": true, | ||
| "homesteadForkBlock": "0x00", | ||
| )" + enableByzantium + R"( | ||
| "EIP150ForkBlock": "0x00", |
test/RPCSession.cpp
Outdated
| "homesteadForkBlock": "0x00", | ||
| )" + enableByzantium + R"( | ||
| "EIP150ForkBlock": "0x00", | ||
| "EIP158ForkBlock": "0x00" |
| m_compilerStack.reset(false); | ||
| m_compilerStack.addSource("", "pragma solidity >=0.0;\n" + _code); | ||
| m_compilerStack.setEVMVersion(dev::test::Options::get().evmVersion()); | ||
| m_compilerStack.setOptimiserSettings(dev::test::Options::get().optimize); |
There was a problem hiding this comment.
This was missed but shouldn't make any difference.
| CHECK_ALLOW_MULTI(text, (std::vector<std::pair<Error::Type, std::string>>{ | ||
| {Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"}, | ||
| {Error::Type::Warning, "only available after the Metropolis"}, | ||
| {Error::Type::Warning, "The \"create2\" instruction is not supported for the VM version"}, |
There was a problem hiding this comment.
"for the"? Shouldn't that be "in the"?
libsolidity/interface/EVMVersion.h
Outdated
| } | ||
|
|
||
| bool operator==(EVMVersion const& _other) const { return m_version == _other.m_version; } | ||
| bool operator!=(EVMVersion const& _other) const { return !this->operator==(_other); } |
There was a problem hiding this comment.
Should also have comparison operators if we introduce tangerine whistle now.
libsolidity/interface/EVMVersion.h
Outdated
| std::string name() const { return m_version == Version::Byzantium ? "byzantium" : "homestead"; } | ||
|
|
||
| bool hasReturndatacopy() const { return m_version == Version::Byzantium; } | ||
| bool hasStaticCall() const { return m_version == Version::Byzantium; } |
There was a problem hiding this comment.
I'm not sure if we should have such a granularity. One option is this, the other is comparison whether currently version >= byzantium, though that assumes features can't be removed.
libsolidity/interface/EVMVersion.h
Outdated
| /// or whether we can just forward easily all remaining gas (true). | ||
| bool canOverchargeGasForCall() const | ||
| { | ||
| // @TODO when exactly was this introduced? Was together with the call stack fix. |
There was a problem hiding this comment.
Tangerine Whistle, see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-608.md
| - run: | ||
| name: Init submodules | ||
| command: | | ||
| git submodule update --init |
There was a problem hiding this comment.
I think we don't have any submodules anymore, do we? I can remove it from this PR.
Probably the simplest way is adding another commandline option to the tests for Then we could have more combinations on the CI. |
|
Added the other versions. |
|
Updated. Will leave it at the current test combinations for now. |
|
Updated. |
|
I'll rebase this after #2541 and fix up the asm analyzer part. It is only in conflict with |
scripts/tests.sh
Outdated
| "$REPO_ROOT"/build/test/soltest --show-progress $log -- "$optimize" --evm-version "$vm" --ipcpath /tmp/test/geth.ipc | ||
| THIS_ERR=$? | ||
| set -e | ||
| if [ $? -ne 0 ]; then ERRO_CODE=$?; fi |
There was a problem hiding this comment.
Typo, the variable is called ERROR_CODE
2880ed4 to
e3de9ea
Compare
| } | ||
|
|
||
| Assembly& Assembly::optimise(bool _enable, bool _isCreation, size_t _runs) | ||
| Assembly& Assembly::optimise(bool _enable, EVMVersion _evmVersion, bool _isCreation, size_t _runs) |
There was a problem hiding this comment.
Woohoo, I should be using this for the bitwise shifting optimiser rules in #3580.
There was a problem hiding this comment.
Yes, it was a really painful process. This setting is needed literally everywhere...
| BOOST_CHECK(balanceAt(Address(0xdead)) == 42); | ||
| // "send" does not retain enough gas to be able to pay for account creation. | ||
| // Disabling for non-tangerineWhistle VMs. | ||
| if (dev::test::Options::get().evmVersion().canOverchargeGasForCall()) |
There was a problem hiding this comment.
Hm, can we output a boost message that these are skipped due to the vm?
Also, how about?
if (..)
return;
There was a problem hiding this comment.
I tried return, but the macro seems to create a function that returns something.
There was a problem hiding this comment.
I'll look into telling boost to skip a test, it seems to have such a feature.
There was a problem hiding this comment.
Changed it accordingly. This will probably show up in the xml test report.
| { | ||
| char const* sourceCode = R"( | ||
| (returnlll | ||
| (send 0xdead 42)) |
There was a problem hiding this comment.
Eventually send and msg should be updated I think.
@benjaminion @zigguratt what do you think?
axic
left a comment
There was a problem hiding this comment.
I think it looks good. I wouldn't have added evmVersion to LLL, but it can actually be useful (will address that separately).
|
It is failing: |
|
It seems there is a bug in boost which causes skipped tests to be treated as errors: https://svn.boost.org/trac10/ticket/12095 |
|
I will revert to the previous version for now (which just had a |
Fixes #3273.