-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regenerate all state tests #511
Conversation
"filledwith" : "cpp-1.3.0+commit.619a6438.Linux.g++", | ||
"lllcversion" : "Version: 0.4.20-develop.2018.1.8+commit.2548228b.Linux.g++", | ||
"filledwith" : "testeth 1.5.0.dev2-48+commit.413e4077.dirty", | ||
"lllcversion" : "Version: 0.4.25-develop.2018.8.9+commit.63d071d6.mod.Linux.g++", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please not use an unstable nightly version of solidity/lll? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use custom version because it had wrong opcode for create2 I had to fix it manually. Need to check what current release version is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axic, sorry, I cant use solidity develop. it has incorrect create2 being translated into 0xfb
the create2 should be translated into 0xf5 https://eips.ethereum.org/EIPS/eip-1014
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ethereum/solidity#5013.
However using a random nightly version can cause a variety of problems. I'd to either hold off refilling or take the release 0.4.25 and changing that single line in libevmasm/Instruction.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smth changed. this lll translated into smth that cpp now dont understand.
{ (seq (CREATE2 0 0 (lll (seq (mstore 0 0x112233) (revert 0 32)) 0) 0) (SSTORE 0 (RETURNDATASIZE)) )}
it was working before. Now I get invalid instruction
The main change affecting lots of tests is sstore change. Other then that it should be possible to refill tests without issues very fast |
Yes, currently the implementation of sstore change causes a lot of tests to start failing. Would be good to get that sorted out. Not sure what's the best way -- is it even possible to regenerate some tests without recompiling the solidity code? At some point we should change the way we create tests. IMO, only the manually written tests should be versioned, along with scripts that produce the executable (filled) tests. And then we should have build servers that generate stateTests, blockchainTests etc. And clients could download test-bundles, and the build servers could display info about which tests have been changed in a particular bundle etc. |
In current Just checked, it's still wrong on this PR.
The |
I have even worse feeling about generating tests with unknown commit of aleth.
@winsvega Can you clarify what is this commit? I can't find it in the repo. |
it is origin/fixtesthash rebased on develop |
|
test.py
Outdated
# fillerSource = jsonTest[test]["_info"]["source"] | ||
# fillerHash = jsonTest[test]["_info"]["sourceHash"] | ||
# if fillerHash != hashFile(fillerSource): | ||
# _logerror("Filler hash is different:", jsonFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not fix broken test cases? Disabling the validator script seems to be a very bad idea. @ehildenb has put in a lot of effort to do validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to write json_spirit::write_string(jsdata, true) in python.
Jared did not respond to my mail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does json_spirit::write_string(jsdata, true)
do, I'll give you a python equivalent. (assuming this is still an issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this issue is fixed. now the issue is how to calculate hash of json object of .yml test in python.
in cpp this function is used to construct json out of .yml
json_spirit::mValue convertYamlNodeToJson(YAML::Node _node)
{
if (_node.IsNull())
return json_spirit::mValue();
if (_node.IsScalar())
{
if (_node.Tag() == "tag:yaml.org,2002:int")
return _node.as<int>();
else
return _node.as<string>();
}
if (_node.IsMap())
{
json_spirit::mObject jObject;
for (auto const& i : _node)
jObject.emplace(i.first.as<string>(), convertYamlNodeToJson(i.second));
return jObject;
}
if (_node.IsSequence())
{
json_spirit::mArray jArray;
for (size_t i = 0; i < _node.size(); i++)
jArray.emplace_back(convertYamlNodeToJson(_node[i]));
return jArray;
}
BOOST_ERROR("Error parsing YAML node. Element type not defined!");
return json_spirit::mValue();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
however when I use this in python, the hash is different:
fparsed = json.dump(yaml.load(f), sys.stdout, indent=4)
s = json.dumps(fparsed, separators=(',', ':'))
k.update(s.encode('utf-8'))
return k.hexdigest()
s = json.dumps(fparsed, separators=(',', ':'))
is equivalent to json_spirit::write_string(jsdata, false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok the current issue is that json.dumps when converting yml to json
thread indexes in a different way:
'0x01': '0x00' -> '1': '0x00'
instead of putting it as is 0x01
it converts the index into 1
@pipermerriam if you could help with this. it should fix filler hash check in travis
@axic
I am ready to merge this PR. |
f44d452
to
1ef50cf
Compare
uh, how is anyone supposed to review that? |
try running Constantinople enabled client using tests from this branch |
c9bfc8e
to
2db5438
Compare
No description provided.