Skip to content

Commit 1b0cb62

Browse files
authored
feat(checklist): Add Modified Transaction Validity Constraint (#1988)
* feat(checklist): Add `Modified Transaction Validity Constraint` * fix: tox * fix: review comments
1 parent 42a8a07 commit 1b0cb62

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

docs/writing_tests/checklist_templates/eip_testing_checklist_template.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,3 +1165,42 @@ Verify tests in `tests/cancun/eip4844_blobs` were correctly and automatically up
11651165
### Framework Changes
11661166

11671167
- Increment `max_request_type` in the fork where the EIP is introduced in `src/ethereum_test_forks/forks/forks.py` to the new maximum request type number after the EIP is activated.
1168+
1169+
## New Transaction-Validity Constraint
1170+
1171+
### Test Vectors
1172+
1173+
#### Fork transition
1174+
1175+
| ID | Description | Status | Tests |
1176+
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------ | ----- |
1177+
| `new_transaction_validity_constraint/test/fork_transition/accepted_before_fork` | Verify that a block before the activation fork is accepted even when the new constraint is not met. | | |
1178+
| `new_transaction_validity_constraint/test/fork_transition/accepted_after_fork` | Verify that a block after the activation fork is accepted when the new validity constraint is met. | | |
1179+
| `new_transaction_validity_constraint/test/fork_transition/rejected_after_fork` | Verify that a block after the activation fork is rejected when the new validity constraint is not met. | | |
1180+
1181+
Note: All test cases must use off-by-one values to ensure proper boundary condition verification.
1182+
1183+
### Framework Changes
1184+
1185+
- Introduce the validity constraint as a fork method that returns:
1186+
- `None` for forks before its activation.
1187+
- A non-`None` value starting from the fork where the constraint becomes active.
1188+
1189+
## Modified Transaction-Validity Constraint
1190+
1191+
### Test Vectors
1192+
1193+
#### Fork transition
1194+
1195+
| ID | Description | Status | Tests |
1196+
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------ | ----- |
1197+
| `modified_transaction_validity_constraint/test/fork_transition/accepted_before_fork` | Verify that a block before the activation fork is accepted when the existing constraint is met and, ideally, the new constraint is not met. | | |
1198+
| `modified_transaction_validity_constraint/test/fork_transition/rejected_before_fork` | Verify that a block before the activation fork is rejected when the existing constraint is not met and, ideally, the new constraint is met. | | |
1199+
| `modified_transaction_validity_constraint/test/fork_transition/accepted_after_fork` | Verify that a block after the activation fork is accepted when the new validity constraint is met. | | |
1200+
| `modified_transaction_validity_constraint/test/fork_transition/rejected_after_fork` | Verify that a block after the activation fork is rejected when the new validity constraint is not met. | | |
1201+
1202+
Note: All test cases must use off-by-one values to ensure proper boundary condition verification.
1203+
1204+
### Framework Changes
1205+
1206+
- Update the validity constraint as a fork method that returns the updated value starting from the fork where the constraint changes.

src/ethereum_test_checklists/eip_checklist.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,3 +1675,77 @@ class Update(ChecklistItem):
16751675
"""Update cross-request tests."""
16761676

16771677
pass
1678+
1679+
class NewTransactionValidityConstraint(ChecklistItem):
1680+
"""New transaction validity constraint checklist items."""
1681+
1682+
class Test(ChecklistItem):
1683+
"""Test vectors for the new validity constraint."""
1684+
1685+
class ForkTransition(ChecklistItem):
1686+
"""Tests for the new transaction validity constraint on fork boundary."""
1687+
1688+
class AcceptedBeforeFork(ChecklistItem):
1689+
"""
1690+
Verify that a block before the activation fork is accepted even when the new
1691+
constraint is not met.
1692+
"""
1693+
1694+
pass
1695+
1696+
class AcceptedAfterFork(ChecklistItem):
1697+
"""
1698+
Verify that a block after the activation fork is accepted when the new
1699+
validity constraint is met.
1700+
"""
1701+
1702+
pass
1703+
1704+
class RejectedAfterFork(ChecklistItem):
1705+
"""
1706+
Verify that a block after the activation fork is rejected when the new
1707+
validity constraint is not met.
1708+
"""
1709+
1710+
pass
1711+
1712+
class ModifiedTransactionValidityConstraint(ChecklistItem):
1713+
"""Modified transaction validity constraint checklist items."""
1714+
1715+
class Test(ChecklistItem):
1716+
"""Test vectors for the modified validity constraint."""
1717+
1718+
class ForkTransition(ChecklistItem):
1719+
"""Tests for the modified transaction validity constraint on fork boundary."""
1720+
1721+
class AcceptedBeforeFork(ChecklistItem):
1722+
"""
1723+
Verify that a block before the activation fork is accepted when the existing
1724+
constraint is met and, ideally, the new constraint is not met.
1725+
"""
1726+
1727+
pass
1728+
1729+
class RejectedBeforeFork(ChecklistItem):
1730+
"""
1731+
Verify that a block before the activation fork is rejected when the existing
1732+
constraint is not met and, ideally, the new constraint is met.
1733+
"""
1734+
1735+
pass
1736+
1737+
class AcceptedAfterFork(ChecklistItem):
1738+
"""
1739+
Verify that a block after the activation fork is accepted when the new
1740+
validity constraint is met.
1741+
"""
1742+
1743+
pass
1744+
1745+
class RejectedAfterFork(ChecklistItem):
1746+
"""
1747+
Verify that a block after the activation fork is rejected when the new
1748+
validity constraint is not met.
1749+
"""
1750+
1751+
pass

0 commit comments

Comments
 (0)