Documentation ¶
Index ¶
- func CleanAndValidateExtCommitInfoInPrepareProposal(ctx sdk.Context, extCommitInfo cometabci.ExtendedCommitInfo, ...) (cometabci.ExtendedCommitInfo, error)
- func GetMaxMarketPairs(ctx sdk.Context, pricesKeeper PreBlockExecPricesKeeper) uint32
- func IsVoteExtensionSeen(veCache *vecache.VeCache, consAddress string, currHeight int64) bool
- func ValidateBigIntSDaiConversionRateValue(ctx sdk.Context, sDaiConversionRate *big.Int, ...) error
- func ValidateExtendedCommitAgainstLastCommit(extCommitInfo cometabci.ExtendedCommitInfo, cmtLastCommit comet.CommitInfo) error
- func ValidateExtendedCommitInfoInProcessProposal(ctx sdk.Context, height int64, extCommitInfo cometabci.ExtendedCommitInfo, ...) error
- func ValidateMarketCountInVE(ctx sdk.Context, ve vetypes.DaemonVoteExtension, ...) error
- func ValidatePricesBytesSizeInVE(ctx sdk.Context, ve vetypes.DaemonVoteExtension) error
- func ValidateSDaiConversionRateHeightInVE(ctx sdk.Context, ratelimitKeeper VoteExtensionRateLimitKeeper) error
- func ValidateSDaiConversionRateSizeInVE(ctx sdk.Context, ve vetypes.DaemonVoteExtension) error
- func ValidateSDaiConversionRateValueInVE(ctx sdk.Context, ve vetypes.DaemonVoteExtension, ...) error
- func ValidateVEConsensusInfo(ctx sdk.Context, valStore voteweighted.ValidatorStore, ...) error
- func ValidateVEMarketsAndPrices(ctx sdk.Context, pricesKeeper PreBlockExecPricesKeeper, veBytes []byte, ...) error
- func ValidateVeSDaiConversionRate(ctx sdk.Context, ratelimitKeeper VoteExtensionRateLimitKeeper, veBytes []byte, ...) error
- type ErrPanic
- type ExtendVoteClobKeeper
- type ExtendVotePerpetualsKeeper
- type OracleClientError
- type PreBlockError
- type PreBlockExecPricesKeeper
- type TransformPricesError
- type VEApplierInterface
- type VEPricePair
- type ValidateVEConsensusInfoFn
- type ValidateVoteExtensionError
- type VoteExtensionHandler
- func (h *VoteExtensionHandler) ExtendVoteHandler() sdk.ExtendVoteHandler
- func (h *VoteExtensionHandler) GetVEBytes(ctx sdk.Context) ([]byte, error)
- func (h *VoteExtensionHandler) ValidateVE(ctx sdk.Context, veBytes []byte, blockHeight int64) (resp *abci.ResponseVerifyVoteExtension, err error)
- func (h *VoteExtensionHandler) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
- type VoteExtensionRateLimitKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAndValidateExtCommitInfoInPrepareProposal ¶
func CleanAndValidateExtCommitInfoInPrepareProposal( ctx sdk.Context, extCommitInfo cometabci.ExtendedCommitInfo, veCodec codec.VoteExtensionCodec, pricesKeeper PreBlockExecPricesKeeper, ratelimitKeeper VoteExtensionRateLimitKeeper, veCache *vecache.VeCache, ) (cometabci.ExtendedCommitInfo, error)
func GetMaxMarketPairs ¶
func GetMaxMarketPairs(ctx sdk.Context, pricesKeeper PreBlockExecPricesKeeper) uint32
func IsVoteExtensionSeen ¶
func ValidateExtendedCommitAgainstLastCommit ¶
func ValidateExtendedCommitAgainstLastCommit(extCommitInfo cometabci.ExtendedCommitInfo, cmtLastCommit comet.CommitInfo) error
ValidateExtendedCommitAgainstLastCommit validates an ExtendedCommitInfo against a LastCommit. Specifically, it checks that the ExtendedCommit + LastCommit (for the same height), are consistent with each other + that they are ordered correctly (by voting power) in accordance with comet(https://github.com/cometbft/cometbft/blob/4ce0277b35f31985bbf2c25d3806a184a4510010/types/validator_set.go#L784).
func ValidateExtendedCommitInfoInProcessProposal ¶
func ValidateExtendedCommitInfoInProcessProposal( ctx sdk.Context, height int64, extCommitInfo cometabci.ExtendedCommitInfo, veCodec codec.VoteExtensionCodec, pricesKeeper PreBlockExecPricesKeeper, ratelimitKeeper VoteExtensionRateLimitKeeper, validateVEConsensusInfo ValidateVEConsensusInfoFn, ) error
func ValidateMarketCountInVE ¶
func ValidateMarketCountInVE( ctx sdk.Context, ve vetypes.DaemonVoteExtension, pricesKeeper PreBlockExecPricesKeeper, ) error
func ValidatePricesBytesSizeInVE ¶
func ValidatePricesBytesSizeInVE( ctx sdk.Context, ve vetypes.DaemonVoteExtension, ) error
func ValidateSDaiConversionRateHeightInVE ¶
func ValidateSDaiConversionRateHeightInVE( ctx sdk.Context, ratelimitKeeper VoteExtensionRateLimitKeeper, ) error
func ValidateSDaiConversionRateSizeInVE ¶
func ValidateSDaiConversionRateSizeInVE( ctx sdk.Context, ve vetypes.DaemonVoteExtension, ) error
func ValidateSDaiConversionRateValueInVE ¶
func ValidateSDaiConversionRateValueInVE( ctx sdk.Context, ve vetypes.DaemonVoteExtension, ratelimitKeeper VoteExtensionRateLimitKeeper, ) error
func ValidateVEConsensusInfo ¶
func ValidateVEConsensusInfo( ctx sdk.Context, valStore voteweighted.ValidatorStore, extCommit cometabci.ExtendedCommitInfo, ) error
ValidateVoteExtensions defines a helper function for verifying vote extension signatures that may be passed or manually injected into a block proposal from a proposer in PrepareProposal. It returns an error if any signature is invalid or if unexpected vote extensions and/or signatures are found or less than 2/3 power is received.
func ValidateVEMarketsAndPrices ¶
func ValidateVEMarketsAndPrices( ctx sdk.Context, pricesKeeper PreBlockExecPricesKeeper, veBytes []byte, voteCodec codec.VoteExtensionCodec, ) error
func ValidateVeSDaiConversionRate ¶
func ValidateVeSDaiConversionRate( ctx sdk.Context, ratelimitKeeper VoteExtensionRateLimitKeeper, veBytes []byte, voteCodec codec.VoteExtensionCodec, ) error
Types ¶
type ErrPanic ¶
type ErrPanic struct {
Err error
}
ErrPanic is an error that is returned when a panic occurs in the ABCI handler.
type ExtendVoteClobKeeper ¶
type OracleClientError ¶
type OracleClientError struct {
Err error
}
OracleClientError is an error that is returned when the oracle client's response is invalid.
func (OracleClientError) Error ¶
func (e OracleClientError) Error() string
func (OracleClientError) Label ¶
func (e OracleClientError) Label() string
type PreBlockError ¶
type PreBlockError struct {
Err error
}
PreBlockError is an error that is returned when the pre-block simulation fails.
func (PreBlockError) Error ¶
func (e PreBlockError) Error() string
func (PreBlockError) Label ¶
func (e PreBlockError) Label() string
type PreBlockExecPricesKeeper ¶
type PreBlockExecPricesKeeper interface { PerformStatefulPriceUpdateValidation( ctx sdk.Context, marketPriceUpdate *pricestypes.MarketPriceUpdate, ) (isSpotValid bool, isPnlValid bool) UpdateSmoothedSpotPrices( ctx sdk.Context, linearInterpolateFunc func(v0 uint64, v1 uint64, ppm uint32) (uint64, error), ) error GetValidMarketSpotPriceUpdates(ctx sdk.Context) []*pricestypes.MarketSpotPriceUpdate GetAllMarketParams(ctx sdk.Context) []pricestypes.MarketParam GetMarketParam(ctx sdk.Context, id uint32) (market pricestypes.MarketParam, exists bool) GetSmoothedSpotPrice(markedId uint32) (uint64, bool) }
PreparePricesKeeper defines the expected Prices keeper used for `PrepareProposal`.
type TransformPricesError ¶
type TransformPricesError struct {
Err error
}
TransformPricesError is an error that is returned when there is a failure in attempting to transform the prices returned from the oracle server to the format expected by the validator set.
func (TransformPricesError) Error ¶
func (e TransformPricesError) Error() string
func (TransformPricesError) Label ¶
func (e TransformPricesError) Label() string
type VEApplierInterface ¶
type VEPricePair ¶
type ValidateVEConsensusInfoFn ¶
type ValidateVEConsensusInfoFn func( ctx sdk.Context, extInfo cometabci.ExtendedCommitInfo, ) error
ValidateVoteExtensionsFn defines the function for validating vote extensions. This function is not explicitly used to validate the oracle data but rather that the signed vote extensions included in the proposal are valid and provide a super-majority of vote extensions for the current block. This method is expected to be used in PrepareProposal and ProcessProposal.
func NewValidateVEConsensusInfo ¶
func NewValidateVEConsensusInfo(validatorStore voteweighted.ValidatorStore) ValidateVEConsensusInfoFn
NewDefaultValidateVoteExtensionsFn returns a new DefaultValidateVoteExtensionsFn.
type ValidateVoteExtensionError ¶
type ValidateVoteExtensionError struct {
Err error
}
ValidateVoteExtensionError is an error that is returned when there is a failure in validating a vote extension.
func (ValidateVoteExtensionError) Error ¶
func (e ValidateVoteExtensionError) Error() string
func (ValidateVoteExtensionError) Label ¶
func (e ValidateVoteExtensionError) Label() string
type VoteExtensionHandler ¶
type VoteExtensionHandler struct {
// contains filtered or unexported fields
}
func NewVoteExtensionHandler ¶
func NewVoteExtensionHandler( logger log.Logger, voteCodec codec.VoteExtensionCodec, pricesKeeper PreBlockExecPricesKeeper, perpetualsKeeper ExtendVotePerpetualsKeeper, clobKeeper ExtendVoteClobKeeper, rateLimitKeeper VoteExtensionRateLimitKeeper, sDAIEventManager sdaiserver.SDAIEventManager, veApplier VEApplierInterface, ) *VoteExtensionHandler
func (*VoteExtensionHandler) ExtendVoteHandler ¶
func (h *VoteExtensionHandler) ExtendVoteHandler() sdk.ExtendVoteHandler
Returns a handler that extends pre-commit votes with the current prices pulled from the perpetually running price daemon In the case of an error, the handler will return an empty vote extension ensuring liveness in the case of a price daemon failure
func (*VoteExtensionHandler) GetVEBytes ¶
func (h *VoteExtensionHandler) GetVEBytes(ctx sdk.Context) ([]byte, error)
func (*VoteExtensionHandler) ValidateVE ¶
func (h *VoteExtensionHandler) ValidateVE( ctx sdk.Context, veBytes []byte, blockHeight int64, ) (resp *abci.ResponseVerifyVoteExtension, err error)
func (*VoteExtensionHandler) VerifyVoteExtensionHandler ¶
func (h *VoteExtensionHandler) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler