Skip to content
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

Exclude empty requests data in commitment (EIP-7685) #1094

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,13 @@ jobs:
- run:
name: "Execution spec tests (develop, blockchain_tests)"
# Tests for in-development EVM revision currently passing.
# TODO: Just a single example that happens to work.
working_directory: ~/spec-tests/fixtures/blockchain_tests
command: >
~/build/bin/evmone-blockchaintest
prague/eip2537_bls_12_381_precompiles/bls12_precompiles_before_fork
--gtest_filter='-*block_hashes.block_hashes_history'
prague/eip2537_bls_12_381_precompiles
prague/eip2935_historical_block_hashes_from_state
prague/eip6110_deposits
- collect_coverage_gcc
- upload_coverage:
flags: execution_spec_tests
Expand Down
6 changes: 3 additions & 3 deletions test/integration/t8n/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ add_test(
)
string(
JOIN ".*" EXPECTED_OUT
# empty requests list of exactly 3 elements (withdrawals, deposits, consolidations)
[=["requests": \[[^],]*"0x",[^],]*"0x",[^],]*"0x"[^,]*\]]=]
# empty requests list
[=["requests": \[\]]=]
# requests hash should be present
[=["requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f"]=]
[=["requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"]=]
)
set_tests_properties(
${PREFIX}/${TEST_CASE}/out.json PROPERTIES
Expand Down
5 changes: 2 additions & 3 deletions test/state/requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ hash256 calculate_requests_hash(std::span<const Requests> block_requests_list)

for (const auto& requests : block_requests_list)
{
// TODO recent change in the spec, uncomment for devnet-5
// if (requests.data.empty())
// continue;
if (requests.data().empty())
continue; // Skip empty requests.

hash256 requests_hash;
crypto::sha256(reinterpret_cast<std::byte*>(requests_hash.bytes),
Expand Down
8 changes: 6 additions & 2 deletions test/t8n/t8n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@
{
// EIP-7685: General purpose execution layer requests
j_result["requests"] = json::json::array();
for (size_t i = 0; i < requests.size(); ++i)
j_result["requests"][i] = hex0x(requests[i].data());
for (const auto& r : requests)
{
if (!r.data().empty())
// Only report non-empty requests. Include the leading type byte.
j_result["requests"].emplace_back(hex0x(r.raw_data));

Check warning on line 262 in test/t8n/t8n.cpp

View check run for this annotation

Codecov / codecov/patch

test/t8n/t8n.cpp#L262

Added line #L262 was not covered by tests
}

auto requests_hash = calculate_requests_hash(requests);

Expand Down