Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5755 from ethereum/poststatehash
Browse files Browse the repository at this point in the history
Pull Istanbul consensus tests and support postStateHash field in new tests
  • Loading branch information
winsvega authored Sep 25, 2019
2 parents c084e6b + 86bb406 commit 32a5c98
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Added: [#5707](https://github.com/ethereum/aleth/pull/5707) Aleth waits for 2 seconds after sending disconnect to peer before closing socket.
- Added: [#5709](https://github.com/ethereum/aleth/pull/5709) [#5728](https://github.com/ethereum/aleth/pull/5728) Istanbul support: EIP-2200 Structured Definitions for Net Gas Metering.
- Added: [#5751](https://github.com/ethereum/aleth/pull/5751) Istanbul support: EIP-152 Add BLAKE2 compression function `F` precompile.
- Added: [#5755](https://github.com/ethereum/aleth/pull/5755) testeth now runs `stChainId`, `stSLoadTest`, `stSelfBalance` tests for Istanbul.
- Added: [#5758](https://github.com/ethereum/aleth/pull/5758) Istanbul support: activation in Ropsten config.
- Changed: [#5532](https://github.com/ethereum/aleth/pull/5532) The leveldb is upgraded to 1.22. This is breaking change on Windows and the old databases are not compatible.
- Changed: [#5559](https://github.com/ethereum/aleth/pull/5559) Update peer validation error messages.
Expand Down
2 changes: 1 addition & 1 deletion test/jsontests
Submodule jsontests updated 7228 files
15 changes: 10 additions & 5 deletions test/tools/jsontests/BlockChainTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ json_spirit::mObject fillBCTest(json_spirit::mObject const& _input, bool _allowI
if (Options::get().fullstate || isSmallState(testChain.topBlock().state()))
output["postState"] = fillJsonWithState(testChain.topBlock().state());
else
output["postState"] = toHexPrefixed(testChain.topBlock().blockHeader().stateRoot());
output["postStateHash"] = toHexPrefixed(testChain.topBlock().blockHeader().stateRoot());
output["lastblockhash"] = toHexPrefixed(testChain.topBlock().blockHeader().hash(WithSeal));

//make all values hex in pre section
Expand Down Expand Up @@ -625,18 +625,20 @@ void testBCTest(json_spirit::mObject const& _o)
testName + "State root in chain from RLP blocks != State root in chain from Field blocks!");

State postState(State::Null); //Compare post states
BOOST_REQUIRE((_o.count("postState") > 0));
if (_o.at("postState").type() == json_spirit::Value_type::obj_type)

if (_o.count("postState") > 0)
{
BOOST_REQUIRE(_o.at("postState").type() == json_spirit::Value_type::obj_type);
ImportTest::importState(_o.at("postState").get_obj(), postState);
ImportTest::compareStates(postState, testChain.topBlock().state());
ImportTest::compareStates(postState, blockchain.topBlock().state());
}
else
{
// Attempt to read hash instead of the full state
BOOST_REQUIRE(_o.at("postState").type() == json_spirit::Value_type::str_type);
auto postHash = h256{_o.at("postState").get_str()};
BOOST_REQUIRE(_o.count("postStateHash") > 0);
BOOST_REQUIRE(_o.at("postStateHash").type() == json_spirit::Value_type::str_type);
auto postHash = h256{_o.at("postStateHash").get_str()};
string message = testName +
"Final StateRoot is different! (Look at expect section in the test /src "
"Filler file, or run the test generation with --fullstate flag to get the "
Expand Down Expand Up @@ -1203,5 +1205,8 @@ BOOST_AUTO_TEST_CASE(stBadOpcode){}
BOOST_AUTO_TEST_CASE(stArgsZeroOneBalance){}
BOOST_AUTO_TEST_CASE(stCodeCopyTest){}
BOOST_AUTO_TEST_CASE(stTimeConsuming){}
BOOST_AUTO_TEST_CASE(stChainId) {}
BOOST_AUTO_TEST_CASE(stSLoadTest) {}
BOOST_AUTO_TEST_CASE(stSelfBalance) {}
BOOST_AUTO_TEST_SUITE_END()

3 changes: 3 additions & 0 deletions test/tools/jsontests/StateTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,7 @@ BOOST_AUTO_TEST_CASE(stBadOpcode){}
BOOST_AUTO_TEST_CASE(stArgsZeroOneBalance){}
BOOST_AUTO_TEST_CASE(stEWASMTests){}
BOOST_AUTO_TEST_CASE(stTimeConsuming) {}
BOOST_AUTO_TEST_CASE(stChainId) {}
BOOST_AUTO_TEST_CASE(stSLoadTest) {}
BOOST_AUTO_TEST_CASE(stSelfBalance) {}
BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 32a5c98

Please sign in to comment.