Repository navigation
feat(tests): Increase coverage for EIP-7805 tests - #3804
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## eips/bogota/eip-7805 #3804 +/- ##
=======================================================
Coverage ? 95.01%
=======================================================
Files ? 673
Lines ? 40914
Branches ? 3774
=======================================================
Hits ? 38875
Misses ? 1423
Partials ? 616
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7bab68f to
89d970f
Compare
marioevz
left a comment
There was a problem hiding this comment.
LGTM. Great additions! A few comments to complete the PR, thanks!
| pytest.param("contract", marks=pytest.mark.pre_alloc_mutable), | ||
| ], | ||
| ) | ||
| def test_pending_il_appendability_by_sender_code( |
There was a problem hiding this comment.
Agreed. If SETCODEFROM an account could take on code mid-block, so we could add a case where a block tx makes a pending IL sender a contract or some tests in this way 🤔
670c09d to
b361a49
Compare
Entries reach the transition tool and the fixture as the same bytes, so the verdict is computed on what clients receive, including rlp_override. Block.inclusion_list_txs also accepts Bytes entries for malformed cases.
The inclusion list variant now reads fork.inclusion_list_counts_blob_entries() for a moved blob transaction, so a spec change on blob entries is a one-line flip in the EIP-7805 mixin.
Each malformed entry (empty, a 0x00 byte before a legacy transaction, type bytes 0x7f, 0xff and the first undefined type, a known type with another type's payload, a trailing byte, truncated legacy) leaves the payload satisfied alone and lets the check reach an appendable transaction after it; two well-formed controls show the reused payloads are appendable.
Covers every non-blob type through with_all_typed_transactions, the fee cap and value in the balance check, withdrawals funding a sender only from the next block, priority fees funding the fee recipient, a delegated sender drained without a nonce change, an entry past one member's byte limit, and entries that count as included only by their exact bytes (access list or authorization list changed); the blob test reads the fork's blob-entry predicate.
A set-code transaction whose authorizations all fail is still valid, so its inclusion list variant expects an omitted copy to leave the payload unsatisfied.
Add L2 type bytes 0x7d and 0x7e to the undecodable-entry cases, gas limits above the transaction cap at each block room's edge, and one-field pairs for chain id, base fee and sender code.
EIP-7805's author confirmed that a blob transaction in the inclusion list is ignored for satisfaction, so the check skips it and the fork's blob-entry predicate flips to false.
The consensus layer merges up to 16 committee members' lists into the one sent with a payload, so it carries at most 128 KiB; a test that writes a larger list fails to fill.
Adds a system call funding a pending sender before and after the block's transactions, non-canonical RLP entries, and a full 128 KiB merged list whose last entry still counts.
Re-signing can shorten r or s by a byte, which left the length search stuck one byte either side of the target for about 1 in 80 sender keys. A miss now also changes the calldata byte, which draws a new signature; all 400 probed keys converge within four tries.
Block.inclusion_list_txs takes Transactions again; a malformed entry is a transaction with rlp_override, the idiom malformed block transactions already use. The framework still passes each entry's rlp() bytes to the transition tool and the fixture, so the verdict is judged on exactly what clients receive.
EIP-7805's check now skips blob transactions outright (ethereum/EIPs#12470), so the fork method that hedged it was False on every fork. The inclusion list variant expects a satisfied payload when the moved transaction is a blob transaction, and its unit test no longer monkeypatches the predicate.
The merged inclusion list limit is now the committee size times the per-list limit, so 8 KiB has one source.
Blob and wrong-chain entries now also run before an appendable transaction, so a client that stops at a skipped entry fails. The blob test adds a control that includes the blob transaction in the block, and the chain id test adds type-2 and unprotected legacy entries.
The block now also creates an account, so the pending transaction's state room is the block gas limit minus state gas already used. A client that ignores block state gas used fails the one-over case.
type_2_entry keys its raw field overrides by RLP field name and reads chain id and to from the transaction instead of decoding its own encoding. Also trims the undecodable-entry docstring and sets the match-by-bytes expectation in each branch.
The new FOCIL tests now name the expected verdict in each branch and use match like the rest of the module. The base fee pair is named for its boundary, and the same_bytes case says it is the control. Fixtures are unchanged.
The inclusion list check docstring named only the blob skip; it now also names undecodable entries and entries signed for another chain.
The IL verdict unit test funds the sender the default key signs for, instead of a hard-coded address that would leave the entry unfunded if that default changed.
The bytes-matching test gains an entry that changes only the signature's s, and the drained-sender test takes one wei instead of the whole balance, so the pending tx misses being affordable by one wei. The sized transfer reads its nonce from the sender.
A pending legacy IL tx whose v encodes this chain's id plus 2**64 has an invalid v and is skipped, so a client that truncates the chain id to 64 bits, and counts the entry, fails it.
e577fc5 to
078fce1
Compare
|
Great changes. I also updated the |
* feat(test-specs): send inclusion list entries as raw bytes Entries reach the transition tool and the fixture as the same bytes, so the verdict is computed on what clients receive, including rlp_override. Block.inclusion_list_txs also accepts Bytes entries for malformed cases. * feat(test-forks): add the inclusion list blob-entry predicate The inclusion list variant now reads fork.inclusion_list_counts_blob_entries() for a moved blob transaction, so a spec change on blob entries is a one-line flip in the EIP-7805 mixin. * feat(tests): skip undecodable inclusion list entries Each malformed entry (empty, a 0x00 byte before a legacy transaction, type bytes 0x7f, 0xff and the first undefined type, a known type with another type's payload, a trailing byte, truncated legacy) leaves the payload satisfied alone and lets the check reach an appendable transaction after it; two well-formed controls show the reused payloads are appendable. * feat(tests): extend FOCIL appendability coverage Covers every non-blob type through with_all_typed_transactions, the fee cap and value in the balance check, withdrawals funding a sender only from the next block, priority fees funding the fee recipient, a delegated sender drained without a nonce change, an entry past one member's byte limit, and entries that count as included only by their exact bytes (access list or authorization list changed); the blob test reads the fork's blob-entry predicate. * feat(tests): mark invalid-authorization set-code txs as inclusion tests A set-code transaction whose authorizations all fail is still valid, so its inclusion list variant expects an omitted copy to leave the payload unsatisfied. * feat(tests): cover more FOCIL appendability checks Add L2 type bytes 0x7d and 0x7e to the undecodable-entry cases, gas limits above the transaction cap at each block room's edge, and one-field pairs for chain id, base fee and sender code. * feat(spec-specs,test-forks): skip blob entries in the IL check EIP-7805's author confirmed that a blob transaction in the inclusion list is ignored for satisfaction, so the check skips it and the fork's blob-entry predicate flips to false. * feat(test-forks): add the merged inclusion list size limit The consensus layer merges up to 16 committee members' lists into the one sent with a payload, so it carries at most 128 KiB; a test that writes a larger list fails to fill. * feat(tests): pin FOCIL ordering, encoding and merged list size Adds a system call funding a pending sender before and after the block's transactions, non-canonical RLP entries, and a full 128 KiB merged list whose last entry still counts. * fix(tests): stop the FOCIL transfer size search from looping Re-signing can shorten r or s by a byte, which left the length search stuck one byte either side of the target for about 1 in 80 sender keys. A miss now also changes the calldata byte, which draws a new signature; all 400 probed keys converge within four tries. * refactor(test-specs): send malformed IL entries through rlp_override Block.inclusion_list_txs takes Transactions again; a malformed entry is a transaction with rlp_override, the idiom malformed block transactions already use. The framework still passes each entry's rlp() bytes to the transition tool and the fixture, so the verdict is judged on exactly what clients receive. * refactor(test-forks): drop the inclusion list blob-entry predicate EIP-7805's check now skips blob transactions outright (ethereum/EIPs#12470), so the fork method that hedged it was False on every fork. The inclusion list variant expects a satisfied payload when the moved transaction is a blob transaction, and its unit test no longer monkeypatches the predicate. * refactor(test-forks): derive the merged IL size from the list limit The merged inclusion list limit is now the committee size times the per-list limit, so 8 KiB has one source. * feat(tests): pin FOCIL blob and chain id skips Blob and wrong-chain entries now also run before an appendable transaction, so a client that stops at a skipped entry fails. The blob test adds a control that includes the blob transaction in the block, and the chain id test adds type-2 and unprotected legacy entries. * feat(tests): spend state gas before the FOCIL gas-cap state edge The block now also creates an account, so the pending transaction's state room is the block gas limit minus state gas already used. A client that ignores block state gas used fails the one-over case. * refactor(tests): name FOCIL type-2 fields and trim docstrings type_2_entry keys its raw field overrides by RLP field name and reads chain id and to from the transaction instead of decoding its own encoding. Also trims the undecodable-entry docstring and sets the match-by-bytes expectation in each branch. * refactor(tests): set FOCIL expectations in each branch The new FOCIL tests now name the expected verdict in each branch and use match like the rest of the module. The base fee pair is named for its boundary, and the same_bytes case says it is the control. Fixtures are unchanged. * docs(spec-specs): name every skip in the IL check docstring The inclusion list check docstring named only the blob skip; it now also names undecodable entries and entries signed for another chain. * refactor(test-specs): fund the IL unit test's signing sender The IL verdict unit test funds the sender the default key signs for, instead of a hard-coded address that would leave the entry unfunded if that default changed. * feat(tests): tighten FOCIL entry matching and drain cases The bytes-matching test gains an entry that changes only the signature's s, and the drained-sender test takes one wei instead of the whole balance, so the pending tx misses being affordable by one wei. The sized transfer reads its nonce from the sender. * feat(tests): skip FOCIL legacy entries with over-64-bit chain ids A pending legacy IL tx whose v encodes this chain's id plus 2**64 has an invalid v and is skipped, so a client that truncates the chain id to 64 bits, and counts the entry, fails it.
* feat(test-specs): send inclusion list entries as raw bytes Entries reach the transition tool and the fixture as the same bytes, so the verdict is computed on what clients receive, including rlp_override. Block.inclusion_list_txs also accepts Bytes entries for malformed cases. * feat(test-forks): add the inclusion list blob-entry predicate The inclusion list variant now reads fork.inclusion_list_counts_blob_entries() for a moved blob transaction, so a spec change on blob entries is a one-line flip in the EIP-7805 mixin. * feat(tests): skip undecodable inclusion list entries Each malformed entry (empty, a 0x00 byte before a legacy transaction, type bytes 0x7f, 0xff and the first undefined type, a known type with another type's payload, a trailing byte, truncated legacy) leaves the payload satisfied alone and lets the check reach an appendable transaction after it; two well-formed controls show the reused payloads are appendable. * feat(tests): extend FOCIL appendability coverage Covers every non-blob type through with_all_typed_transactions, the fee cap and value in the balance check, withdrawals funding a sender only from the next block, priority fees funding the fee recipient, a delegated sender drained without a nonce change, an entry past one member's byte limit, and entries that count as included only by their exact bytes (access list or authorization list changed); the blob test reads the fork's blob-entry predicate. * feat(tests): mark invalid-authorization set-code txs as inclusion tests A set-code transaction whose authorizations all fail is still valid, so its inclusion list variant expects an omitted copy to leave the payload unsatisfied. * feat(tests): cover more FOCIL appendability checks Add L2 type bytes 0x7d and 0x7e to the undecodable-entry cases, gas limits above the transaction cap at each block room's edge, and one-field pairs for chain id, base fee and sender code. * feat(spec-specs,test-forks): skip blob entries in the IL check EIP-7805's author confirmed that a blob transaction in the inclusion list is ignored for satisfaction, so the check skips it and the fork's blob-entry predicate flips to false. * feat(test-forks): add the merged inclusion list size limit The consensus layer merges up to 16 committee members' lists into the one sent with a payload, so it carries at most 128 KiB; a test that writes a larger list fails to fill. * feat(tests): pin FOCIL ordering, encoding and merged list size Adds a system call funding a pending sender before and after the block's transactions, non-canonical RLP entries, and a full 128 KiB merged list whose last entry still counts. * fix(tests): stop the FOCIL transfer size search from looping Re-signing can shorten r or s by a byte, which left the length search stuck one byte either side of the target for about 1 in 80 sender keys. A miss now also changes the calldata byte, which draws a new signature; all 400 probed keys converge within four tries. * refactor(test-specs): send malformed IL entries through rlp_override Block.inclusion_list_txs takes Transactions again; a malformed entry is a transaction with rlp_override, the idiom malformed block transactions already use. The framework still passes each entry's rlp() bytes to the transition tool and the fixture, so the verdict is judged on exactly what clients receive. * refactor(test-forks): drop the inclusion list blob-entry predicate EIP-7805's check now skips blob transactions outright (ethereum/EIPs#12470), so the fork method that hedged it was False on every fork. The inclusion list variant expects a satisfied payload when the moved transaction is a blob transaction, and its unit test no longer monkeypatches the predicate. * refactor(test-forks): derive the merged IL size from the list limit The merged inclusion list limit is now the committee size times the per-list limit, so 8 KiB has one source. * feat(tests): pin FOCIL blob and chain id skips Blob and wrong-chain entries now also run before an appendable transaction, so a client that stops at a skipped entry fails. The blob test adds a control that includes the blob transaction in the block, and the chain id test adds type-2 and unprotected legacy entries. * feat(tests): spend state gas before the FOCIL gas-cap state edge The block now also creates an account, so the pending transaction's state room is the block gas limit minus state gas already used. A client that ignores block state gas used fails the one-over case. * refactor(tests): name FOCIL type-2 fields and trim docstrings type_2_entry keys its raw field overrides by RLP field name and reads chain id and to from the transaction instead of decoding its own encoding. Also trims the undecodable-entry docstring and sets the match-by-bytes expectation in each branch. * refactor(tests): set FOCIL expectations in each branch The new FOCIL tests now name the expected verdict in each branch and use match like the rest of the module. The base fee pair is named for its boundary, and the same_bytes case says it is the control. Fixtures are unchanged. * docs(spec-specs): name every skip in the IL check docstring The inclusion list check docstring named only the blob skip; it now also names undecodable entries and entries signed for another chain. * refactor(test-specs): fund the IL unit test's signing sender The IL verdict unit test funds the sender the default key signs for, instead of a hard-coded address that would leave the entry unfunded if that default changed. * feat(tests): tighten FOCIL entry matching and drain cases The bytes-matching test gains an entry that changes only the signature's s, and the drained-sender test takes one wei instead of the whole balance, so the pending tx misses being affordable by one wei. The sized transfer reads its nonce from the sender. * feat(tests): skip FOCIL legacy entries with over-64-bit chain ids A pending legacy IL tx whose v encodes this chain's id plus 2**64 has an invalid v and is skipped, so a client that truncates the chain id to 64 bits, and counts the entry, fails it.
* feat(test-specs): send inclusion list entries as raw bytes Entries reach the transition tool and the fixture as the same bytes, so the verdict is computed on what clients receive, including rlp_override. Block.inclusion_list_txs also accepts Bytes entries for malformed cases. * feat(test-forks): add the inclusion list blob-entry predicate The inclusion list variant now reads fork.inclusion_list_counts_blob_entries() for a moved blob transaction, so a spec change on blob entries is a one-line flip in the EIP-7805 mixin. * feat(tests): skip undecodable inclusion list entries Each malformed entry (empty, a 0x00 byte before a legacy transaction, type bytes 0x7f, 0xff and the first undefined type, a known type with another type's payload, a trailing byte, truncated legacy) leaves the payload satisfied alone and lets the check reach an appendable transaction after it; two well-formed controls show the reused payloads are appendable. * feat(tests): extend FOCIL appendability coverage Covers every non-blob type through with_all_typed_transactions, the fee cap and value in the balance check, withdrawals funding a sender only from the next block, priority fees funding the fee recipient, a delegated sender drained without a nonce change, an entry past one member's byte limit, and entries that count as included only by their exact bytes (access list or authorization list changed); the blob test reads the fork's blob-entry predicate. * feat(tests): mark invalid-authorization set-code txs as inclusion tests A set-code transaction whose authorizations all fail is still valid, so its inclusion list variant expects an omitted copy to leave the payload unsatisfied. * feat(tests): cover more FOCIL appendability checks Add L2 type bytes 0x7d and 0x7e to the undecodable-entry cases, gas limits above the transaction cap at each block room's edge, and one-field pairs for chain id, base fee and sender code. * feat(spec-specs,test-forks): skip blob entries in the IL check EIP-7805's author confirmed that a blob transaction in the inclusion list is ignored for satisfaction, so the check skips it and the fork's blob-entry predicate flips to false. * feat(test-forks): add the merged inclusion list size limit The consensus layer merges up to 16 committee members' lists into the one sent with a payload, so it carries at most 128 KiB; a test that writes a larger list fails to fill. * feat(tests): pin FOCIL ordering, encoding and merged list size Adds a system call funding a pending sender before and after the block's transactions, non-canonical RLP entries, and a full 128 KiB merged list whose last entry still counts. * fix(tests): stop the FOCIL transfer size search from looping Re-signing can shorten r or s by a byte, which left the length search stuck one byte either side of the target for about 1 in 80 sender keys. A miss now also changes the calldata byte, which draws a new signature; all 400 probed keys converge within four tries. * refactor(test-specs): send malformed IL entries through rlp_override Block.inclusion_list_txs takes Transactions again; a malformed entry is a transaction with rlp_override, the idiom malformed block transactions already use. The framework still passes each entry's rlp() bytes to the transition tool and the fixture, so the verdict is judged on exactly what clients receive. * refactor(test-forks): drop the inclusion list blob-entry predicate EIP-7805's check now skips blob transactions outright (ethereum/EIPs#12470), so the fork method that hedged it was False on every fork. The inclusion list variant expects a satisfied payload when the moved transaction is a blob transaction, and its unit test no longer monkeypatches the predicate. * refactor(test-forks): derive the merged IL size from the list limit The merged inclusion list limit is now the committee size times the per-list limit, so 8 KiB has one source. * feat(tests): pin FOCIL blob and chain id skips Blob and wrong-chain entries now also run before an appendable transaction, so a client that stops at a skipped entry fails. The blob test adds a control that includes the blob transaction in the block, and the chain id test adds type-2 and unprotected legacy entries. * feat(tests): spend state gas before the FOCIL gas-cap state edge The block now also creates an account, so the pending transaction's state room is the block gas limit minus state gas already used. A client that ignores block state gas used fails the one-over case. * refactor(tests): name FOCIL type-2 fields and trim docstrings type_2_entry keys its raw field overrides by RLP field name and reads chain id and to from the transaction instead of decoding its own encoding. Also trims the undecodable-entry docstring and sets the match-by-bytes expectation in each branch. * refactor(tests): set FOCIL expectations in each branch The new FOCIL tests now name the expected verdict in each branch and use match like the rest of the module. The base fee pair is named for its boundary, and the same_bytes case says it is the control. Fixtures are unchanged. * docs(spec-specs): name every skip in the IL check docstring The inclusion list check docstring named only the blob skip; it now also names undecodable entries and entries signed for another chain. * refactor(test-specs): fund the IL unit test's signing sender The IL verdict unit test funds the sender the default key signs for, instead of a hard-coded address that would leave the entry unfunded if that default changed. * feat(tests): tighten FOCIL entry matching and drain cases The bytes-matching test gains an entry that changes only the signature's s, and the drained-sender test takes one wei instead of the whole balance, so the pending tx misses being affordable by one wei. The sized transfer reads its nonce from the sender. * feat(tests): skip FOCIL legacy entries with over-64-bit chain ids A pending legacy IL tx whose v encodes this chain's id plus 2**64 has an invalid v and is skipped, so a client that truncates the chain id to 64 bits, and counts the entry, fails it.
Description
Adds FOCIL inclusion list tests for checks that clients on the heze (FOCIL) devnets get wrong, and aligns the inclusion list check with the EIP update in ethereum/EIPs#12470.
0x7dand0x7e, and non-canonical RLP (a chain id with a leading zero or written as a string, a long-form length onto, a padded list length).inclusion_list_merged_transactions_size_limit()makes a test that writes a larger list fail to fill.There are also pass/skip pairs for chain id (legacy, type 2 and unprotected legacy), base fee, sender code, fee-recipient earnings and a drained delegated sender. Malformed entries are transactions with
rlp_override, and the framework now passes each entry's exact bytes to the transition tool, so the verdict is judged on what the payload carries.Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <description>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture