-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
R4R: Enforce block maximum gas limit in DeliverTx #2795
Merged
Merged
Changes from 13 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
2f73cf4
block gas meter working
rigelrozanski 956d351
basic structure in place
rigelrozanski ebaa394
modified app provider to pass genesis
rigelrozanski 3bf67b6
compiling
rigelrozanski 8069b2b
default infinite block gas meter
rigelrozanski 2446830
examples installing
rigelrozanski eead278
initial test case
rigelrozanski 7e6fcc0
passing test
rigelrozanski 68e3b9a
only use block gas for deliver
rigelrozanski 0d4dd87
fix baseapp tests
rigelrozanski 5249064
add init chain block gas for gen-txs (all unit tests fixed)
rigelrozanski 7be5179
Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas
rigelrozanski 90217e2
docs and pending
rigelrozanski 2a594fe
basic cwgoes comments
rigelrozanski 4818e67
Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas
rigelrozanski 56dc236
Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas
rigelrozanski d911565
Fix compile
jaekwon 10bdf8f
Store ConsensusParams to main store
jaekwon 4afd53d
Consume block gas to tx gas limit even upon overconsumption
jaekwon bd982b1
Merge reference/baseapp and spec/baseapp/WIP_abci_application.md
jaekwon 70e60c2
Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas
rigelrozanski 6fd3132
lint fix, merge fix
rigelrozanski 972377c
lint
rigelrozanski b4b61b8
address some comments while reviewing Jaes work
rigelrozanski abed373
extra max block gas test at limit
rigelrozanski 2d3e1af
Add demonstrative failing testcase
cwgoes 56fa7dc
fix BlockGasRecovery
rigelrozanski 0861112
Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas
rigelrozanski ce10ef2
replaced proto with codec in baseapp
rigelrozanski 5792e1d
Apply suggestions from code review
alexanderbez 819af35
Final fixes from review
jaekwon 0da2472
Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas
rigelrozanski f12ac43
dep
rigelrozanski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# ABCI application | ||
rigelrozanski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The `BaseApp` struct fulfills the tendermint-abci `Application` interface. | ||
alexanderbez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Info | ||
|
||
## SetOption | ||
|
||
## Query | ||
|
||
## CheckTx | ||
|
||
## InitChain | ||
TODO pseudo code | ||
|
||
During chain initialization InitChain runs the initialization logic directly on | ||
the CommitMultiStore and commits it. The deliver and check states are | ||
initialized with the ChainID. Additionally the Block gas meter is initialized | ||
rigelrozanski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with an infinite amount of gas to run any genesis transactions. | ||
|
||
Note that we do not `Commit` during `InitChain` however BeginBlock for block 1 | ||
rigelrozanski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
starts from this deliverState. | ||
|
||
|
||
## BeginBlock | ||
TODO complete description & pseudo code | ||
|
||
The block gas meter is reset within BeginBlock for the deliver state. | ||
If no maximum block gas is set within baseapp then an infinite | ||
gas meter is set, otherwise a gas meter with the baseapp `maximumBlockGas` | ||
is initialized | ||
|
||
## DeliverTx | ||
TODO complete description & pseudo code | ||
|
||
Before transaction logic is run, the `BlockGasMeter` is first checked for | ||
remaining gas. If no gas remains, then `DeliverTx` immediately returns an error. | ||
|
||
After the transaction has been processed the used gas is deducted from the | ||
BlockGasMeter. If the remaining gas exceeds the meter's limits, then DeliverTx | ||
returns an error and the transaction is not committed. | ||
|
||
## EndBlock | ||
|
||
## Commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably good to indicate that its local spam prevention, not consensus