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: return the correct nonce from EthGetTransactionCount #10300

Merged
merged 3 commits into from
Feb 17, 2023

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Feb 17, 2023

Related Issues

fixes #10255

Proposed Changes

In EthGetTransactionCount, get the "correct" nonce for EVM contracts in case someone is using this method to, e.g., predict CREATE addresses.

EVM contracts track this number internally.

Additional Info

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
  • Tests exist for new functionality or change in behavior
  • CI is green

EVM contracts track this number internally.

fixes #10255
@Stebalien Stebalien marked this pull request as ready for review February 17, 2023 18:52
@Stebalien Stebalien requested a review from a team as a code owner February 17, 2023 18:52
@@ -367,6 +368,29 @@ func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes.
return ethtypes.EthUint64(0), xerrors.Errorf("cannot parse block param: %s", blkParam)
}

// First, handle the case where the "sender" is an EVM actor.
Copy link
Contributor

Choose a reason for hiding this comment

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

this comment should be on line 380?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's the entire section. I've put it into a block to make that clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

Eh, I switched it to an if chain.

@arajasek arajasek merged commit efcdec6 into release/v1.20.0 Feb 17, 2023
@arajasek arajasek deleted the steb/fix-eth-nonce branch February 17, 2023 19:45
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.

3 participants