feat: spec tests for prague for gas consumption#836
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory PR Review: Prague EIP-7623 Spec TestsSummaryThis PR adds Ethereum execution spec tests for EIP-7623 (Increase Calldata Cost) for the Prague hardfork. The PR adds 80,078 lines of test fixtures and Zig test wrappers. ✅ Strengths
|
Pull Request Review: Prague EIP-7623 Spec TestsNote: This action was performed by Claude AI assistant, not @roninjin10 or @fucory SummaryThis PR adds comprehensive Ethereum execution spec tests for EIP-7623 (Increase Calldata Cost) for the Prague hard fork. The implementation adds 80,078 lines across 15 files, consisting of large JSON test fixtures and corresponding Zig test runners. ✅ Strengths1. Comprehensive Test Coverage
2. Proper Memory ManagementAll test files correctly follow Zig memory management patterns: const json_content = try std.fs.cwd().readFileAlloc(allocator, json_path, 100 * 1024 * 1024);
defer allocator.free(json_content);
const parsed = try std.json.parseFromSlice(std.json.Value, allocator, json_content, .{});
defer parsed.deinit();
3. Consistent Code Style
4. Proper Integration
|
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory Code Review Summary: Prague EIP-7623 Gas Spec TestsI have completed a comprehensive review of this PR. Here are the key findings: ✅ Strengths
|
Code Review - PR #836: Prague EIP-7623 Gas Consumption Spec TestsNote: This action was performed by Claude AI assistant, not @roninjin10 or @fucory SummaryThis PR adds comprehensive Ethereum execution spec tests for EIP-7623 (Increase calldata cost) targeting the Prague hardfork. The changes include 80K+ lines of test fixture data and minimal runtime code changes. What ChangedFiles Added
Core Changesspecs/runner.zig (Lines 315-327)
Code Quality AssessmentStrengths
Issues and Concerns1. Code Repetition Violation (High Priority)Every test file has 10+ identical copies of the same setup code with only test names changing. This violates DRY principle and makes maintenance harder. Recommendation: Create a helper function per test file to eliminate repetition. 2. Hardcoded Hardfork Name (Medium Priority)Line 322: const prague = post.object.get("Prague") orelse break :blk null; Issues:
Recommendation: Detect hardfork from test metadata or pass as parameter. 3. Missing Error Handling (Low Priority)Tests use .? which crashes on null instead of providing clear error messages. Better: Use orelse return error.TestCaseNotFound 4. Magic Number (Low Priority)100MB buffer size is undocumented. Should be named constant. Security AssessmentNo security concerns identified. Read-only test files with proper memory management. Performance Considerations
RecommendationsHigh Priority
Medium Priority
Low Priority
PR Checklist Review
Action Required: Please complete the PR checklist before merging. VerdictConditionally Approve with Changes Requested The test infrastructure is sound, but code repetition and hardcoded hardfork need addressing. Before Merging
Great work on comprehensive EIP-7623 test coverage! |
PR Review - EIP-7623 Prague Spec TestsNote: This review was performed by Claude AI assistant, not @roninjin10 or @fucory SummaryThis PR adds comprehensive Ethereum execution spec tests for EIP-7623 (Increase calldata cost) for the Prague hardfork covering gas consumption scenarios across different transaction types. Main FindingsStrengths:
Issues to Address:
Security Analysis: Required Before MergePer CLAUDE.md build verification protocol:
Changes to runner.zig: +17/-3 lines - please verify these changes are necessary for EIP-7623 support and don't break existing tests. Overall AssessmentStrong, comprehensive test addition that follows project conventions. Recommend APPROVE after:
The code duplication (80k+ lines) is intentional per testing philosophy and acceptable. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory PR Review: Prague EIP-7623 Gas Spec TestsSummaryThis PR adds comprehensive Ethereum execution spec tests for EIP-7623 (Increase calldata cost) targeting the Prague hardfork. The changes include ~80K lines of JSON test fixtures and corresponding Zig test wrappers. Strengths
Code Quality Issues1. Repetitive Code - Violates DRY PrincipleEach test file repeats the exact same pattern 10+ times with nearly identical code for reading and parsing JSON files. Issue: Reading and parsing the same 100MB JSON file multiple times per test file is wasteful Recommendation: Create a helper function that caches the parsed JSON or reads it once per file 2. Missing Error Handling for Missing Test CasesUsing .? operator will crash tests if test keys don't exist in JSON. Issue: If test key doesn't exist, test will crash with null pointer dereference 3. Magic NumbersThe 100 * 1024 * 1024 limit appears multiple times without explanation Recommendation: Define as a named constant like MAX_TEST_FILE_SIZE Potential Issues1. Memory Performance
Recommendation:
2. Test File SizeThe JSON files are massive (1312+ lines each). While expected for comprehensive spec tests:
3. Runner Changes Not Fully ReviewedThe PR modifies specs/runner.zig but the changes need verification for:
Security Considerations
Compliance with CLAUDE.mdCompliant:
Needs Verification:
Test Coverage Questions
RecommendationsHigh Priority:
Medium Priority: Low Priority: Approval ConditionsBefore merging, please confirm:
Overall Assessment: This is solid foundational work for EIP-7623 spec compliance. The main concerns are code duplication and potential memory performance issues, but the test coverage itself is excellent. With the recommended refactoring, this will be a valuable addition to the test suite. |
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory Code Review: Prague EIP-7623 Spec TestsSummaryThis PR adds comprehensive Ethereum execution spec tests for EIP-7623: Increase calldata cost in the Prague hardfork. The implementation adds 483+ test cases covering gas consumption scenarios. Overall, the tests follow the repository's patterns correctly, but there are several critical issues that need addressing. Critical Issues🚨 1. Massive Code Duplication (BLOCKER)Issue: All test files contain extreme code duplication. Each test function re-parses the same JSON file from scratch: test "full gas consumption: exact gas, type 0 protected" {
const allocator = testing.allocator;
const json_path = "specs/cases/eest/prague/eip7623_increase_calldata_cost/test_full_gas_consumption.json";
const json_content = try std.fs.cwd().readFileAlloc(allocator, json_path, 100 * 1024 * 1024);
defer allocator.free(json_content);
const parsed = try std.json.parseFromSlice(std.json.Value, allocator, json_content, .{});
defer parsed.deinit();
const test_case = parsed.value.object.get("tests/prague/eip7623_increase_calldata_cost/...").?;
try runner.runJsonTest(allocator, test_case);
}This pattern is repeated 483 times across the test suite! Problems:
Solution: Parse JSON once per file, cache the parsed data or use a test helper pattern that the repository may already employ for other spec tests. 🚨 2. Unchecked Unwrap with
|
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory Pull Request Review: Prague EIP-7623 Spec TestsSummaryThis PR adds comprehensive test coverage for EIP-7623 (Increase Calldata Cost) targeting the Prague hardfork. The changes include ~80k lines of JSON test fixtures and corresponding Zig test wrappers. ✅ Strengths
|
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory Pull Request Review: EIP-7623 Prague Spec TestsSummaryThis PR adds Ethereum execution specification tests for EIP-7623 (Increase calldata cost) for the Prague hardfork. The PR includes 80K+ lines of JSON test fixtures and corresponding Zig test wrappers, plus minor infrastructure updates to support blob-related fields. Strengths
Issues and ConcernsCRITICAL: Memory Leak Risk in blob_versioned_hashesLine 84-89 in specs/runner.zig allocates memory via hex_to_bytes but there is no defer to free it. The bytes allocation persists throughout test execution. Recommendation: Since BlockInfo holds a slice, the memory must live as long as the BlockInfo. For test fixtures, this may be acceptable (freed with test arena allocator), but should be explicitly documented or use an arena allocator pattern. TODO Comments Identify Architectural DebtThe PR correctly identifies two design issues:
Recommendation: File a follow-up issue to refactor properly - move blob_versioned_hashes to TransactionContext and remove blob_base_fee from TransactionContext. Missing max_fee_per_blob_gas ParsingThe runner parses gasPrice but doesn't parse maxFeePerBlobGas from transaction JSON (hardcoded to 0). If EIP-7623 tests involve blob transactions, this may cause incorrect results. Test File Size Concernstest_transaction_validity_type_1_type_2.zig is 3,784 lines - extremely long. Each test allocates 100MB for JSON reading and parses the entire file to extract a single test case. Consider future refactoring to improve CI performance. RecommendationAPPROVE with minor comments The PR adds valuable test coverage for EIP-7623 and makes an important correctness fix (get_blob_base_fee). The memory management in blob_versioned_hashes is likely acceptable for test code but deserves documentation. Key positive: The fix to read blob_base_fee from block_info instead of context is a genuine bug fix that improves correctness! Testing RecommendationBefore merging, run: zig build test-integration -Dtest-filter=eip7623 And verify all tests pass, CI completes in reasonable time, and no unexpected memory growth. Overall: Strong test coverage addition with good infrastructure improvements. The blob_base_fee bug fix is valuable. Minor documentation needed for memory management patterns. |
Pull Request Review: Prague Gas Spec Tests (EIP-7623)Note: This review was performed by Claude AI assistant, not @roninjin10 or @fucory OverviewThis PR adds comprehensive spec tests for EIP-7623 (Increase calldata cost) for the Prague hardfork. The implementation includes ~77k lines of JSON test fixtures and corresponding Zig test wrappers. Strengths1. Comprehensive Test Coverage
2. Proper Test Structure
3. Code Quality
4. Integration Quality
Issues and Concerns1. CRITICAL: Missing Build VerificationPer CLAUDE.md requirements: The PR description is incomplete:
Required action: Please update the PR description with build/test results. 2. Performance Concerns
Potential optimization: Consider caching the parsed JSON at comptime or test suite level. However, this may not be a blocker since these are spec tests (not run frequently). 3. Code DuplicationAll test files follow an identical pattern (read file, parse JSON, extract test case, run test). Per CLAUDE.md: NO abstractions - copy/paste setup - this is actually correct! However, the copy-paste is so mechanical that a helper function would not violate the self-contained tests principle. But this is not required - the current approach is valid per project standards. 4. Minor: Spec Runner Changes Not ExplainedThe diff shows changes to specs/runner.zig (43 additions, 5 deletions) but these are not described in the PR description. Recommendation: Add a brief note about runner.zig changes in the PR description. 5. Missing: AI DisclosureThe PR template requires AI disclosure if AI tools were used. The PR description is empty except for the template. Please fill this out. Code-Specific Observationsrunner.zig Changes
Request: Please ensure runner.zig changes follow all CLAUDE.md requirements. Test Pattern CorrectnessThe tests use .? for optional unwrapping which will panic if the test name is not found. This is acceptable for tests, but consider whether error messages would be clearer with explicit error handling. Checklist ReviewBased on the PR template:
RecommendationsRequired Before Merge:
Nice to Have:
Security Check:
Final VerdictStatus: Needs Work (but close to ready) The code quality is excellent and follows project standards well. The main blocker is missing build/test verification which is a hard requirement per CLAUDE.md. Once build verification is confirmed and the PR description is completed, this should be ready to merge. Estimated Effort to Address Issues:
Great work on comprehensive test coverage for EIP-7623! This will significantly improve Prague hardfork compliance. |
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory Code Review: Prague Spec Tests for EIP-7623 Gas ConsumptionThis PR adds comprehensive Ethereum spec tests for the Prague hardfork, specifically testing EIP-7623 (increased calldata cost). The PR includes ~80K lines of test data and test runners, plus important fixes to the test infrastructure. StrengthsTest Coverage: 483 test cases across 7 files covering multiple transaction types (0, 1, 2, 3, 4) Code Quality: Proper memory management with defer patterns, correct error handling with try, no forbidden patterns (no std.debug.assert, no catch {}, no stubs) Implementation Fixes:
Critical Issues1. MASSIVE CODE DUPLICATION: All 7 test files follow identical pattern. File test_transaction_validity_type_1_type_2.zig has 252 tests, each reading the same 34MB+ JSON file. Estimated memory waste: 252 tests × 34MB = ~8.5GB redundant allocations. This violates CLAUDE.md testing philosophy. Recommend creating helper functions to eliminate boilerplate. 2. CONTRADICTORY TODOs: src/block/block_info.zig:52 says blob_versioned_hashes should be in TransactionContext. src/block/transaction_context.zig:23 says blob_base_fee should be in BlockInfo. These contradict each other and violate Zero Tolerance policy on ambiguous placeholders. Recommend resolving or removing these TODOs. 3. MISSING DOCUMENTATION: PR description template completely unfilled. Critical for mission-critical financial infrastructure. SecurityNo security issues found. Proper error handling, no unsafe operations, correct memory management. RecommendationsHigh Priority:
Medium Priority: VerdictAPPROVE with requested changes. Core implementation is solid but code duplication is a significant maintainability issue that should be addressed. |
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory PR Review: Prague EIP-7623 Gas Consumption Spec TestsSummaryThis PR adds comprehensive spec tests for EIP-7623 (Increase calldata cost) for the Prague hardfork with ~80k lines of test fixtures and supporting code changes. Critical Issues Found1. Missing max_fee_per_blob_gas Assignment (specs/runner.zig:285)
2. Memory Leak: blob_versioned_hashes (specs/runner.zig:84)
3. Type Mismatch (specs/runner.zig:280)
Missing Build VerificationPer CLAUDE.md, EVERY code change requires: zig build && zig build test-opcodes PR checklist shows all test items UNCHECKED. Action Required: Run builds and tests to verify no compilation errors or test failures. Additional Issues
Overall AssessmentCode Quality: Recommendation: Request Changes - Fix critical bugs and verify tests pass before merging. Required Before Merge
|
|
Note: This review was performed by Claude AI assistant, not @roninjin10 or @fucory Pull Request Review: EIP-7623 Prague Spec Tests Overview: This PR adds comprehensive Ethereum execution spec tests for EIP-7623 (Increase calldata cost) targeting the Prague hardfork. The PR adds approximately 80K lines (primarily test data) across 14 files. STRENGTHS:
CRITICAL ISSUES:
REQUIRED ACTIONS BEFORE MERGE:
VERDICT: Needs Work - Address commented tests and verify test passage before merging. Great work on comprehensive test coverage! Just needs activation and verification. |
Code Review - PR #836: Prague Gas Spec TestsNote: This review was performed by Claude AI assistant, not @roninjin10 or @fucory SummaryThis PR adds comprehensive Ethereum execution spec tests for EIP-7623 (increased calldata cost) for the Prague hardfork. It includes ~80K lines primarily of JSON test fixtures and supporting Zig test files. Critical Issues Found
Positive Aspects
RecommendationsBLOCKING:
REQUIRED:
RECOMMENDED:
Once these issues are addressed, this will be a solid test suite addition! |
|
Note: This action was performed by Claude AI assistant, not roninjin10 or fucory Code Review: PR 836 - feat: spec tests for prague for gas consumption OVERVIEW STRENGTHS
CRITICAL ISSUES Memory Leak in runner.zig:84-90 Fix: Track ownership via:
This violates CLAUDE.md zero tolerance for memory leaks - BLOCKING issue. OTHER RECOMMENDATIONS
SECURITY CHECKLIST
VERDICT Priority:
After fixes: Great addition for Prague validation! |
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory PR Review: EIP-7623 Spec Tests for PragueOverviewThis PR adds comprehensive Ethereum execution spec tests for EIP-7623 (Increase calldata cost) for the Prague hardfork. The PR includes ~80k lines of test fixtures and supporting code changes. Code Quality & Best PracticesStrengths:
Issues Found:1. Massive Code Duplication (CRITICAL) Violation: CLAUDE.md states NO abstractions for tests, BUT this level of duplication is excessive and error-prone. Consider a helper macro or comptime function. 2. Tests Are Commented Out (CRITICAL) 3. Architecture Concern: Misplaced Fields Security Concerns1. Blob Base Fee Source Changed - src/evm.zig:1979 changes from self.context.blob_base_fee to self.block_info.blob_base_fee. Are both fields always synchronized? Could this cause silent bugs? 2. No Validation on Gas Price Parsing - specs/runner.zig:270-273 falls back to hardcoded 10 if gasPrice is missing. Is this correct? Performance Considerations1. Inefficient File I/O - Each test reads the same JSON file from disk. With 12 tests per file × 6 files = 72 redundant file reads. Cache parsed JSON at comptime or test suite setup. 2. 100MB Buffer Allocation - Each test allocates up to 100MB for JSON parsing. The actual files are much smaller. RecommendationsBefore Merge - MUST:
Before Merge - SHOULD: Verdict: CHANGES REQUESTEDThis PR cannot be merged until: (1) Commented-out tests are addressed, (2) Build verification is confirmed, (3) PR template is completed. The implementation looks solid, but process requirements per CLAUDE.md must be met. Questions:
|
|
Note: This action was performed by Claude AI assistant, not @roninjin10 or @fucory PR Review: Prague EIP-7623 Gas Consumption Tests Summary: CRITICAL ISSUES FOUND:
POTENTIAL BUGS:
PERFORMANCE CONCERNS:
SECURITY: No issues detected ✓ TEST COVERAGE: VERDICT: NOT READY FOR MERGE ❌ The PR violates project standards with commented-out tests and extreme code duplication. Next Steps:
Overall Assessment:
Happy to re-review once tests are enabled and passing! |
| blob_versioned_hashes: []const [32]u8 = &.{}, | ||
| /// Blob base fee for EIP-4844 | ||
| /// Set to 0 for non-Cancun hardforks | ||
| /// TODO: this is a block-level setting (and already present in BlockInfo), should be removed |
There was a problem hiding this comment.
@claude can you do a pr to main implementing this TODO?
There was a problem hiding this comment.
Claude finished @roninjin10's task —— View job • claude/pr-836-20251005-1803 • Create PR ➔
✅ TODO Implemented: Remove blob_base_fee duplication
I've successfully implemented the TODO to remove blob_base_fee from TransactionContext since it's already in BlockInfo.
Summary of Changes
Modified Files:
src/block/transaction_context.zig(-15, +3): Removedblob_base_feefield and updated all teststest/evm/eip_integration_test.zig(-14, +14): Movedblob_base_feefrom TransactionContext to BlockInfo in 4 tests
Key Changes:
- ✅ Removed duplicated
blob_base_feefield fromTransactionContextstruct - ✅ Removed TODO comment (now implemented)
- ✅ Updated all unit tests in
transaction_context.zig - ✅ Updated 4 integration tests to set
blob_base_feeinBlockInfoinstead - ✅ Changed all assertions to compare against
block_info.blob_base_fee
Why This Change is Correct:
blob_base_feeis block-level data (set per block, not per transaction)- The EVM already uses
self.block_info.blob_base_fee(fixed in feat: spec tests for prague for gas consumption #836) - This eliminates architectural duplication and confusion
Next Steps
Remove duplicated blob_base_fee field from TransactionContext since it's already present in BlockInfo (the correct location for block-level data). The EVM already uses block_info.blob_base_fee (fixed in #836), so this change eliminates architectural duplication without breaking functionality. Changes: - Remove blob_base_fee field from TransactionContext struct - Remove TODO comment (now implemented) - Update all unit tests in transaction_context.zig - Update integration tests to use block_info.blob_base_fee Fixes TODO in src/block/transaction_context.zig:23 Co-authored-by: Will Cory <roninjin10@users.noreply.github.com>

Description
AI Disclosure
AI Tools Used
Prompts Used
Human Explanation
Related Issues
Fixes #
Type of Change
Testing
zig build testpasseszig buildcompletes successfullyChecklist