capability
module increments GasMeter
non-deterministically across validators
#15015
Labels
capability
module increments GasMeter
non-deterministically across validators
#15015
Summary of Bug
The
capability
module'sInitMemStore
function incrementsgasMeter
non-deterministically across validators.When a validator is restarted, InitMemStore is called during
BeginBlock
of the next committed block. This function performs some store operations which incrementGasUsed
on theGasMeter
here.So long as
SetGasMeter
is always called as part of the AnteHandler chain (which is the current behavior of the default AnteHandler chain here), then this is not an issue as theGasMeter
will be reset betweenBeginBlock
and the firstDeliverTx
call.However, if the application uses a custom AnteHandler chain that omits this behavior, the
GasUsed
within each transaction will vary, as theGasMeter
will be the initial meter set duringBeginBlock
here which increments gas differently if the capability module'sMemStore
has not yet been initialized.As a solution, should we consider adding
WithGasMeter
to thenoGasCtx
here?Version
1e8e923
The text was updated successfully, but these errors were encountered: