-
Notifications
You must be signed in to change notification settings - Fork 84
How to deal with fees/gas in tendermint consensus? #57
Comments
Updates on this issue? I'm guessing this didn't make it in 0.9.0... Make good sense to utilize CheckTx as you've mentioned here. How is Tendermint core going to calculate the actual amount of gas being used? Has this been investigated. |
This needs to be well specified with bucky and jae before working on it. Important part that affects both the apps and the core and we need to spend some time architecting it well. And there is no time these days.... hopefully next week |
@rigelrozanski I guess that tendermint core does not care how much gas is used. It just passes it on to the app. |
Once this is finalized, how would it affect tendermint itself? As far as i can see, there's no particular ordering mechanism in Is there a reference implementation at the moment? |
A good consensus algorithm needs a way to prioritize multiple transactions, when there is more than a trivial level of transactions.
In order to do this well, the tendermint core will need to be aware of the fees and gas associated with a given transaction. There are two general ideas how to do this:
After some discussion, @jaekwon and me decided that the second approach was more flexible. We could implement this base logic in basecoin, and people could write plugins to just take advantage of this existing logic. The other approach is a slippery slope, adding more and more logic into tendermint core, until it is no longer a general purpose consensus engine.
The proposal is to make the following changes:
abci interface:
CheckTx
returns two more fields, fees and gasbasecoin (or other abci implementation):
CheckTx
, app validates tx, checks sigs, checks fees and gas, checks the account has the moneyDeliverTx
, app removes 100% of Fees from account regardless of success/fail of app callFeeHandler
interface intoNewBasecoin
or a similar approachtendermint core:
CheckTx
(as now)Question from Jae, how do you configure the gas limit? If it is different between nodes, this will quickly lead to a breakdown in consensus. Changing it is analogous to changing the maximum blocksize in bitcoin. In other words, quite easy 😉
As a first step, the gas limit per block can be set inside the genesis block to ensure consistency.
Midterm, some yet-to-be-invented, on-chain governance mechanism can provide a way that validators could vote on the changes. If a >2/3 majority approves a new gas limit, all nodes could update to that limit without breaking consensus.
Implementing this would be a breaking change to the abci interface, and should be rolled out as a minor release. Idea is targetting 0.9.0, along with the abci_proof enhancements. To break every abci app implementation again 😄 With luck, this could be early February 🤞
The text was updated successfully, but these errors were encountered: