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

PrepareProposal/ProcessProposal with block gas meter #14998

Closed
JayT106 opened this issue Feb 10, 2023 · 1 comment · Fixed by #15012
Closed

PrepareProposal/ProcessProposal with block gas meter #14998

JayT106 opened this issue Feb 10, 2023 · 1 comment · Fixed by #15012
Assignees

Comments

@JayT106
Copy link
Contributor

JayT106 commented Feb 10, 2023

Problem Definition

The current ABCI 1.0 implementation (v0.47) allows the app to pick up transactions until it reaches the block tx payload size limit but not based on the block gas limit. There is a case that might happen the proposer pick-up transactions meet the block transaction payload size but the total gas consumes exceeds the block gas limit (unless the setup can fulfill the block tx payload before reaching the block gas limit or the chain has the unlimited gas block). Therefore, the SDK set the BlockMaxGas during the BeginBlock stage, and then the CometBFT running DeliverTx to the app, the app will return runTx fail due to the block out-of-gas. In the end, some proposed transactions cannot be processed and will be removed from the mempool of the app. It will decrease blockchain transaction and data efficiency.

Proposal

Add BlockGasMeter to PrepareProposal/ProcessProposal, and then the handlers can use it to fulfill a new block based on it. But it also relies on the anti-handler to return correct tx gasused info during runTx under this two runTxMode.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Feb 10, 2023
@alexanderbez alexanderbez self-assigned this Feb 13, 2023
@tac0turtle tac0turtle added C:baseapp C:ABCI and removed needs-triage Issue that needs to be triaged labels Feb 13, 2023
@github-project-automation github-project-automation bot moved this to 📝 Todo in Cosmos-SDK Feb 13, 2023
@alexanderbez
Copy link
Contributor

Opened a PR -> #15012

See the comment in the PR body. Since we do not execute the entire proposal (i.e. execute the messages) in the SDK's default handlers, we cannot know if block gas will be exceeded.

@github-project-automation github-project-automation bot moved this from 📝 Todo to 👏 Done in Cosmos-SDK Feb 15, 2023
@tac0turtle tac0turtle moved this to 🥳 Done in Cosmos-SDK Nov 16, 2023
@tac0turtle tac0turtle removed this from Cosmos-SDK Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants