Skip to content
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

Problem: repeated tx sender recovery is wastful #227

Merged
merged 5 commits into from
Mar 15, 2023

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Mar 14, 2023

Solution:

  • only do once in ante handler, reuse the result

Closes: #XXX

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Solution:
- only do once in ante handler, reuse the result
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: yihuang <huang@crypto.com>
x/evm/types/msg.go Outdated Show resolved Hide resolved
x/evm/types/msg.go Outdated Show resolved Hide resolved
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Signed-off-by: yihuang <huang@crypto.com>
@yihuang yihuang marked this pull request as draft March 14, 2023 13:31
@yihuang yihuang marked this pull request as ready for review March 15, 2023 02:48
@yihuang yihuang merged commit cb741e1 into crypto-org-chain:release/v0.20.x-cronos Mar 15, 2023
@yihuang yihuang deleted the sender-cache branch March 15, 2023 03:23
}
var from common.Address
if len(msg.From) > 0 {
from = common.HexToAddress(msg.From)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

// user can't set arbitrary value in From field in transaction, the SigVerify ante handler will verify the signature and recover the sender address and populate the From field, so the other code can use it directly when available.

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.

2 participants