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

fix: eth: decode as actor creation iff "to" is the EAM #11520

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

Stebalien
Copy link
Member

Proposed Changes

Decode messages as contract deployments if and only if the "to" address is the EAM.

Previously, we weren't checking the "to" address. I've also re-ordered the operations in this function to make it easier to reason about them. It'll have a slight runtime cost (we always ABI-encode the parameters, then throw away the result if it turns out we're actually dealing with an Ethereum transaction), but it's much simpler.

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@Stebalien Stebalien requested a review from a team as a code owner December 13, 2023 04:42
Previously, we weren't checking the "to" address. I've also re-ordered
the operations in this function to make it easier to reason about them.
It'll have a slight runtime cost (we _always_ ABI-encode the parameters,
then throw away the result if it turns out we're actually dealing with
an Ethereum transaction), but it's _much_ simpler.
Copy link
Contributor

@fridrik01 fridrik01 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines -552 to -553
// Yeah, we're going to ignore errors here because the user can send whatever they
// want and may send garbage.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this comment was somewhat useful as to why we are ignoring decodePayload errors

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair. I've expanded the replacement comment to explain that the user can send garbage.

@Stebalien Stebalien enabled auto-merge (squash) December 14, 2023 18:01
@Stebalien Stebalien merged commit 17f6f4c into master Dec 14, 2023
82 of 89 checks passed
@Stebalien Stebalien deleted the steb/fix-eth-native-tx branch December 14, 2023 18:12
rjan90 pushed a commit that referenced this pull request Dec 15, 2023
Previously, we weren't checking the "to" address. I've also re-ordered
the operations in this function to make it easier to reason about them.
It'll have a slight runtime cost (we _always_ ABI-encode the parameters,
then throw away the result if it turns out we're actually dealing with
an Ethereum transaction), but it's _much_ simpler.
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.

None yet

2 participants