feat(node-tests): add proptest fuzzing support for transactions and blocks#81
Open
init4samwise wants to merge 1 commit intomainfrom
Open
feat(node-tests): add proptest fuzzing support for transactions and blocks#81init4samwise wants to merge 1 commit intomainfrom
init4samwise wants to merge 1 commit intomainfrom
Conversation
…locks Add structurally aware fuzzing infrastructure using proptest crate: ## Fuzzing Strategies (src/fuzz.rs) - Primitive strategies: arb_address, arb_b256, arb_u256, arb_tx_kind - Transaction strategies for all types: Legacy, EIP-1559, EIP-2930, EIP-4844 - Block strategies: arb_header, arb_block_body, arb_block - Configurable via PROPTEST_CASES env var (default: 64) ## Property-Based Tests (tests/fuzz.rs) - RLP encoding roundtrip tests for all transaction types - Transaction type preservation verification - Block header sealing/unsealing roundtrips - Block body transaction count validation - Complete block construction tests - Zenith coder compatibility tests - RLP encoding roundtrips for headers This enables structurally aware fuzzing for integration tests, catching edge cases and invariant violations through randomized inputs. Closes ENG-301
prestwich
requested changes
Feb 16, 2026
| // ── Primitive strategies ──────────────────────────────────────────── | ||
|
|
||
| /// Strategy for an arbitrary [`Address`]. | ||
| pub fn arb_address() -> impl Strategy<Value = Address> { |
Member
There was a problem hiding this comment.
this already exists in alloy with the arbitrary feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add structurally aware fuzzing infrastructure using proptest crate for use in integration tests.
What Changed
Fuzzing Strategies (
src/fuzz.rs)arb_address,arb_b256,arb_u256,arb_tx_kind,arb_input_bytes,arb_access_listarb_tx_legacy- Legacy (pre-EIP-2718) transactionsarb_tx_eip1559- EIP-1559 fee market transactionsarb_tx_eip2930- EIP-2930 access list transactionsarb_tx_eip4844- EIP-4844 blob transactionsarb_transaction- Any supported transaction variantarb_header- Block headersarb_block_body- Block bodies (with 0-8 transactions)arb_block- Complete blocks (header + body)PROPTEST_CASESenv var (default: 64)Property-Based Tests (
tests/fuzz.rs)Why
Enables structurally aware fuzzing for integration tests, catching edge cases and invariant violations through randomized inputs. This satisfies the requirements for ENG-301.
Testing
Run fuzz tests with:
Closes ENG-301