This PR add gas handling to prepare, process and end_block abci calls. Some key changes:
prepare: Prepare the proposal with gas limit check. From the doc, cometbft will be able to ensure the block_gas_limit is enforce (that's what I inferred from the doc, somehow not 100% clearly), but still added as a sanity check.
process: Same as prepare, checks the block gas limit.
Added SetConstants into the gas market trait. Currently they are not used, added allow(dead_code) for future usage. The idea is SetConstants will buffer the update and in end block will commit the changes. Before each end_block finishes, it will check if there are SetConstants called and if there is, it will fetch latest consensus params from cometbft, update accordingly and push to cometbft.
Update:
Shifted tendermint import from interpreters to App so that interpreters are more tendermint agnostic.
Added ValidatorTracker and Client to App so that communication with cometbft can be made to query consensus parameters.
Replaced tendermint::account::Id from FvmExecState with PublicKey. The id is the first 20 bytes of public key hashed, which is not useful for deriving fvm addresses. Converting to PublicKey will make the downstream process much more helpful.
Added MessageSelector trait to handle more generic message selection.
This PR add gas handling to
prepare
,process
andend_block
abci calls. Some key changes:prepare
: Prepare the proposal with gas limit check. From the doc, cometbft will be able to ensure the block_gas_limit is enforce (that's what I inferred from the doc, somehow not 100% clearly), but still added as a sanity check.process
: Same asprepare
, checks the block gas limit.SetConstants
into the gas market trait. Currently they are not used, addedallow(dead_code)
for future usage. The idea isSetConstants
will buffer the update and in end block will commit the changes. Before eachend_block
finishes, it will check if there areSetConstants
called and if there is, it will fetch latest consensus params from cometbft, update accordingly and push to cometbft.Update:
App
so that interpreters are more tendermint agnostic.ValidatorTracker
andClient
toApp
so that communication with cometbft can be made to query consensus parameters.tendermint::account::Id
fromFvmExecState
withPublicKey
. Theid
is the first 20 bytes of public key hashed, which is not useful for deriving fvm addresses. Converting toPublicKey
will make the downstream process much more helpful.MessageSelector
trait to handle more generic message selection.