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

reject tx with too large gas limit #12

Merged
merged 2 commits into from
Nov 17, 2021

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Nov 17, 2021

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)

Copy link

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

where is that 10000000 gas from? is it the max block gas network parameter? is it possible to fetch the network parameter directly instead?

@yihuang
Copy link
Collaborator Author

yihuang commented Nov 17, 2021

where is that 10000000 gas from? is it the max block gas network parameter? is it possible to fetch the network parameter directly instead?

It's the current max block gas parameter, it's discussed before that this value should be enough for all the known use cases.
The network parameter could be lifted later when the tx execution optimization is applied though.

Copy link

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

ok for the hotfix, just one good thing to change is not to have an undocumented magic number in the fix -- instead if the block max gas can be obtained directly from the context (e.<something>) or have a named constant that has a comment with a link to https://github.com/crypto-org-chain/cronos-mainnet/blob/master/cronosmainnet_25-1/genesis.json#L8

@yihuang
Copy link
Collaborator Author

yihuang commented Nov 17, 2021

ok for the hotfix, just one good thing to change is not to have an undocumented magic number in the fix -- instead if the block max gas can be obtained directly from the context (e.<something>) or have a named constant that has a comment with a link to https://github.com/crypto-org-chain/cronos-mainnet/blob/master/cronosmainnet_25-1/genesis.json#L8

Made a constant for it, and added more comments.

@yihuang yihuang requested a review from tomtau November 17, 2021 04:19
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