Assessment reports>ZetaChain>Discussion>Gas stability pool

Gas stability pool

The gas stability pool is a mechanism that allows for the increase in gas fee (priority fee) if the CCTXs posted by the observers are not included in blocks (gas fee was too low). This is achieved by having a pool that is filled with surplus remains of CCTXs. The funding happens in the CCTX outbound voting in the finalizing vote.

func (k msgServer) VoteOnObservedOutboundTx(goCtx context.Context, msg *types.MsgVoteOnObservedOutboundTx) (*types.MsgVoteOnObservedOutboundTxResponse, error) {
	...
	// Fund the gas stability pool with the remaining funds
	if err := k.FundGasStabilityPoolFromRemainingFees(ctx, *cctx.GetCurrentOutTxParam(), msg.OutTxChain); err != nil {
		log.Error().Msgf(
			"VoteOnObservedOutboundTx: CCTX: %s Can't fund the gas stability pool with remaining fees %s", cctx.Index, err.Error(),
		)
	}
	...
}

The system to check whether or not transactions have gone through is the method IterateAndUpdateCctxGasPrice that is executed at the beginning of every block. It will check every epoch block and every interval second to query all pendingCctxs and increase gas prices.

Zellic © 2024Back to top ↑