Skip to content

feat: re-use tx validation rules from go-ethereum #286

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

Merged
merged 16 commits into from
Aug 18, 2025

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Jul 15, 2025

Description

there are a few rules in go-ethereum tx validation function seems not covered, we can reuse it directly, some validations rules are overlapped, we can optimize later.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

@@ -126,6 +151,7 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
// 5. signature verification
if err := SignatureVerification(
ethMsg,
ethTx,
Copy link
Contributor Author

@yihuang yihuang Jul 15, 2025

Choose a reason for hiding this comment

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

the reason for this, is ethTx caches the sender recovery result, so we avoid duplicate signature verification efforts by reuse the object.

@aljo242
Copy link
Contributor

aljo242 commented Jul 21, 2025

@yihuang can you please link an existing github issue for this? If one does not exist, feel free to create one. We want to ensure that all PRs have an associated issue for context.

@vladjdk vladjdk requested review from a team as code owners August 11, 2025 13:10
@vladjdk
Copy link
Member

vladjdk commented Aug 11, 2025

@yihuang this is good to go - just needs some test + lint fixes

@aljo242
Copy link
Contributor

aljo242 commented Aug 14, 2025

@yihuang conflicts

@aljo242 aljo242 added the v0.5.x targeting v0.5.x label Aug 14, 2025
@aljo242 aljo242 added this pull request to the merge queue Aug 18, 2025
Merged via the queue into cosmos:main with commit 6492ef5 Aug 18, 2025
@yihuang yihuang deleted the reuse-tx-validation branch August 18, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.5.x targeting v0.5.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants