Skip to content

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented Jul 10, 2025

๐Ÿ—’๏ธ Description

  • Add test case for RLP block size at limit with all transaction types, including blobs, access lists, and authorizations
  • Add test case for RLP block size at limit with logs emitted

๐Ÿ”— Related Issues or PRs

Related to ethereum/execution-specs#1562

TODO:

  • Refactor built transactions for with_all_tx_types into something that can be more useful across the board. I'm thinking default transactions that each fork can define if it includes a new tx type and tests can automatically use these transactions, override them as fixtures, or some other more useful flow than re-building every time.
    • This was done via with_all_typed_transactions indirect (new feature) marker

โœ… Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.

@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch 4 times, most recently from 6335dc3 to cd39587 Compare July 11, 2025 20:55
@fselmo fselmo marked this pull request as ready for review July 11, 2025 20:55
@fselmo fselmo added scope:pytest Scope: Changes EEST's pytest plugins scope:tests Scope: Changes EL client test cases in `./tests` type:feat type: Feature labels Jul 11, 2025
@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch 2 times, most recently from a2146f9 to eab5984 Compare July 11, 2025 22:48
@fselmo
Copy link
Collaborator Author

fselmo commented Jul 11, 2025

Hmm having a difficult time reproducing this CI error locally. I added the concept of a @with_all_typed_transactions as a fixture that uses the tx_type covariant with fork to build default transactions. I successfully implemented this in the test that I wanted for testing the rlp block size limit. Each default transaction can be overridden if desired with:

@pytest.fixture
def type_2_default_transaction(sender):
    return Transaction(...)

Something in the stdout is being changed and ironically I am on a macos and I pass this test locally but the CI does not. I will keep looking into this but it would be nice to get a review here on the implementation and if anyone has an idea of what's causing this error, lmk.

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for implementing this.

I wrote a couple of comments that might be worth considering.

fselmo added a commit to fselmo/execution-spec-tests that referenced this pull request Jul 15, 2025
- Move default transaction logic to a ``conftest.py`` setup.
- Add ``conftest.py`` files for each fork with the respective
  transaction pytest fixtures.
- Opt for `Type | None` over `Optional[Type]` to avoid an extra import.
fselmo added a commit to fselmo/execution-spec-tests that referenced this pull request Jul 15, 2025
- Move default transaction logic to a ``conftest.py`` setup.
- Add ``conftest.py`` files for each fork with the respective
  transaction pytest fixtures.
- Opt for `Type | None` over `Optional[Type]` to avoid an extra import.
@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch from 8451823 to d26c90b Compare July 15, 2025 16:55
@fselmo
Copy link
Collaborator Author

fselmo commented Jul 15, 2025

I'm just missing the documentation here which I can update but we should get consensus on the code first and then I can document the changes appropriately and add the release notes.

fselmo added a commit to fselmo/execution-spec-tests that referenced this pull request Jul 15, 2025
- Move default transaction logic to a ``conftest.py`` setup.
- Add ``conftest.py`` files for each fork with the respective
  transaction pytest fixtures.
- Opt for `Type | None` over `Optional[Type]` to avoid an extra import.
@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch from d26c90b to 39d2880 Compare July 15, 2025 18:35
fselmo added a commit to fselmo/execution-spec-tests that referenced this pull request Jul 16, 2025
  - Move transaction fixtures to a `shared` pytest plugin.
  - Opt for `Type | None` over `Optional[Type]` to avoid an extra import.

Bonus:
  - Refactor the `indirect` marker logic to be more generic for future use.
    If a marker uses `indirect`, it will take the values from the
    `fork_attribute_name` and run it through a fixture of name `argnames`
    which provides some added logic. In this case it builds default
    transactions from the `tx_types` values for each fork.
@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch 2 times, most recently from 3fc79fd to 619bbaa Compare July 16, 2025 22:26
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, it's a very nice solution and thanks for removing the sender from the tests, it's a nice code reduction in general :)

I pushed a small change to fix the imports in the pytest .ini files, basically, anything that imported pytest_plugins.shared.execute_fill should also have transaction_fixtures.

Will merge after CI passes!

@fselmo
Copy link
Collaborator Author

fselmo commented Jul 17, 2025

I pushed a small change to fix the imports in the pytest .ini files, basically, anything that imported pytest_plugins.shared.execute_fill should also have transaction_fixtures.

Ah, yeah, thanks for that cleanup! Do you want me to add any documentation around it? It was also missing a release note because we hadn't agreed yet on the path but I can add one before merge, lmk.

@marioevz
Copy link
Member

I pushed a small change to fix the imports in the pytest .ini files, basically, anything that imported pytest_plugins.shared.execute_fill should also have transaction_fixtures.

Ah, yeah, thanks for that cleanup! Do you want me to add any documentation around it? It was also missing a release note because we hadn't agreed yet on the path but I can add one before merge, lmk.

Yeah I guess it would be nice to have some docs in https://github.com/ethereum/execution-spec-tests/blob/main/docs/writing_tests/test_markers.md#pytestmarkwith_all_tx_types, thanks!

@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch 3 times, most recently from 6f13934 to e276ca6 Compare July 17, 2025 17:49
fselmo added 3 commits July 17, 2025 11:53
- Create global fixtures for default transactions that are covariant with ``fork``
- These should allow overriding particular default transactions by re-defining the
  fixture for the particular tx type e.g.:
  ```python
  @pytest.fixture
  def type_2_default_transaction(pre):
      return Transaction(...)
  ```
- Use these as part of the ``fork`` plugin
fselmo and others added 6 commits July 17, 2025 11:53
  - Move transaction fixtures to a `shared` pytest plugin.
  - Opt for `Type | None` over `Optional[Type]` to avoid an extra import.

Bonus:
  - Refactor the `indirect` marker logic to be more generic for future use.
    If a marker uses `indirect`, it will take the values from the
    `fork_attribute_name` and run it through a fixture of name `argnames`
    which provides some added logic. In this case it builds default
    transactions from the `tx_types` values for each fork.
@fselmo fselmo force-pushed the feat/additional-eip7934-tests branch from e276ca6 to 5604a7e Compare July 17, 2025 17:55
@fselmo
Copy link
Collaborator Author

fselmo commented Jul 17, 2025

Ok ready on my end @marioevz ๐Ÿ‘๐Ÿผ

  • added note to CHANGELOG
  • documented new marker
  • rebased with main to fix CHANGELOG conflicts

@marioevz marioevz merged commit 5064c1c into ethereum:main Jul 17, 2025
14 checks passed
@fselmo fselmo deleted the feat/additional-eip7934-tests branch July 17, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:pytest Scope: Changes EEST's pytest plugins scope:tests Scope: Changes EL client test cases in `./tests` type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants