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

EstimateGas endpoint - nonce should be automatically set the current nonce for the account #1819

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

igorcrevar
Copy link
Contributor

@igorcrevar igorcrevar commented Aug 16, 2023

Description

  • The DebugTransaction, EstimateGas, and Call endpoints should not depend on the nonce provided by the user. Instead, the nonce should be automatically set to the current value for the account.

  • I have left the optional parameter forceNonce in DecodeTxn because, in the future, certain endpoints might rely on the nonce provided by the user.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

  • Start cluster
  • Execute from the terminal:
cur_nonce=$(cast nonce --block pending --rpc-url http://127.0.0.1:10002/ 0x85da99c8a7c2c95964c8efd687e95e632fc533d6)
gap_nonce=$((cur_nonce + 1))
cast send --legacy --private-key 0x42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa --rpc-url http://127.0.0.1:10002/ --async --nonce $gap_nonce 0x03893a7c7463AE47D46bc7f091665f1893656003
  • There should be no error
  • Try sending tx with cur_nonce also and then both of those transactions should be included in some block

@igorcrevar igorcrevar added the bug fix Functionality that fixes a bug label Aug 16, 2023
@igorcrevar igorcrevar requested a review from a team August 16, 2023 10:23
@igorcrevar igorcrevar self-assigned this Aug 16, 2023
@Stefan-Ethernal Stefan-Ethernal changed the title EVM-780 EstimateGas endpoint - nonce should be automatically set to t… EstimateGas endpoint - nonce should be automatically set the current nonce for the account Aug 16, 2023
@igorcrevar igorcrevar merged commit 54d4a07 into develop Aug 18, 2023
6 checks passed
@igorcrevar igorcrevar deleted the feature/EVM-780_EstimateGas_nonce branch August 18, 2023 08:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants