Content-Length: 283555 | pFad | http://github.com/ethereum/execution-spec-tests/pull/1714

31 Enforce keyword-only arguments in calldata_gas_calculator methods by akafle01 · Pull Request #1714 · ethereum/execution-spec-tests · GitHub
Skip to content

Enforce keyword-only arguments in calldata_gas_calculator methods #1714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akafle01
Copy link

@akafle01 akafle01 commented Jun 4, 2025

🗒️ Description

This PR modifies the calldata_gas_calculator method in the base and derived fork classes to enforce keyword-only arguments for block_number and timestamp using *.

All method calls across the codebase have been updated to explicitly use keyword arguments.

I wasn't able to run the test suite locally due to a missing plugin error (pytest_plugins.concurrency), but the changes were made carefully and consistently. Please let me know if you'd like help resolving test setup.

🔗 Related Issues

Fixes #1709

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests/tests/static have been assigned @ported_from marker.
  • Tests: A PR with removal of converted JSON/YML blockchain tests from ethereum/tests have been opened.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • 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.

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.

Thanks for taking this.

My main concern is that this code could break if we convert only one of the fork methods at a time:

def transition_method(
cls,
block_number: int = ALWAYS_TRANSITIONED_BLOCK_NUMBER,
timestamp: int = ALWAYS_TRANSITIONED_BLOCK_TIMESTAMP,
):
kwargs = {}
if "block_number" in base_method_parameters:
kwargs["block_number"] = block_number
if "timestamp" in base_method_parameters:
kwargs["timestamp"] = timestamp
if getattr(base_method, "__prefer_transition_to_method__", False):
return to_fork_method(**kwargs)
return (
to_fork_method(**kwargs)
if block_number >= at_block and timestamp >= at_timestamp
else from_fork_method(**kwargs)
)

I think we need to transform all the abstract method in BaseFork at the same time, which could be a major chore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force fork methods to use keyword arguments
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ethereum/execution-spec-tests/pull/1714

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy