Skip to content

Commit 5d5ed72

Browse files
committed
Revert "blockchaintest: Only check state root for 5 first/last blocks"
This reverts commit e7384ed.
1 parent d8a314b commit 5d5ed72

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

test/blockchaintest/blockchaintest_runner.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ void run_blockchain_tests(std::span<const BlockchainTest> tests, evmc::VM& vm)
142142
std::unordered_map<int64_t, hash256> known_block_hashes{
143143
{c.genesis_block_header.block_number, c.genesis_block_header.hash}};
144144

145-
for (size_t i = 0; i != c.test_blocks.size(); ++i)
145+
for (const auto& test_block : c.test_blocks)
146146
{
147-
const auto& test_block = c.test_blocks[i];
148147
auto bi = test_block.block_info;
149148
bi.known_block_hashes = known_block_hashes;
150149

@@ -159,16 +158,8 @@ void run_blockchain_tests(std::span<const BlockchainTest> tests, evmc::VM& vm)
159158
SCOPED_TRACE(std::string{evmc::to_string(rev)} + '/' + std::to_string(case_index) +
160159
'/' + c.name + '/' + std::to_string(test_block.block_info.number));
161160

162-
if (i < 5 || i >= c.test_blocks.size() - 5)
163-
{
164-
// Only check state hashes for first (early problems)
165-
// and last (final check of all blocks) 5 blocks.
166-
// Otherwise, for very long blockchain test we spend a lot of time in MPT hashing
167-
// because the implementation of it is very simplistic: the trie is not updated
168-
// along the state changes but a new trie is build from scratch for every block.
169-
EXPECT_EQ(
170-
state::mpt_hash(TestState{state}), test_block.expected_block_header.state_root);
171-
}
161+
EXPECT_EQ(
162+
state::mpt_hash(TestState{state}), test_block.expected_block_header.state_root);
172163

173164
if (rev >= EVMC_SHANGHAI)
174165
{

0 commit comments

Comments
 (0)