Skip to content

Conversation

acuarica
Copy link
Contributor

@acuarica acuarica commented Oct 4, 2025

πŸ—’οΈ Description

This PR avoids float conversion when parsing CLI arguments of type Wei if the value is not a float number.

Using float conversion leads to conversion errors due to loss of precision when parsing large ints.

For example, if we set the CLI argument --seed-account-sweep-amount='70000 ether', we get the incorrect value 70000000000000004194304, where the expected value is 70000000000000000000000.

πŸ”— Related Issues or PRs

Fixes #2240.

βœ… 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.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Signed-off-by: Luis Mastrangelo <luis@swirldslabs.com>
Signed-off-by: Luis Mastrangelo <luis@swirldslabs.com>
Copy link
Collaborator

@LouisTsai-Csie LouisTsai-Csie 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 this fix, i've tested it locally and the CI is passing.

@LouisTsai-Csie LouisTsai-Csie merged commit 68489a2 into ethereum:main Oct 6, 2025
15 checks passed
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.

Class Wei used in CLI arguments can differ from original input
2 participants