Documentation
¶
Index ¶
- Variables
- func NewMsgServerImpl(keeper *Keeper) types.MsgServiceServer
- func NewProposalServer(keeper *Keeper) types.MsgServiceServer
- type Attestation
- func (*Attestation) Descriptor() ([]byte, []int)deprecated
- func (x *Attestation) GetAttestationRoot() []byte
- func (x *Attestation) GetChainId() uint64
- func (x *Attestation) GetConfLevel() uint32
- func (x *Attestation) GetCreatedHeight() uint64
- func (x *Attestation) GetHash() []byte
- func (x *Attestation) GetHeight() uint64
- func (x *Attestation) GetId() uint64
- func (x *Attestation) GetOffset() uint64
- func (x *Attestation) GetStatus() uint32
- func (x *Attestation) GetValidatorSetId() uint64
- func (*Attestation) ProtoMessage()
- func (x *Attestation) ProtoReflect() protoreflect.Message
- func (x *Attestation) Reset()
- func (x *Attestation) String() string
- func (a *Attestation) XChainConfLevel() xchain.ConfLevel
- func (a *Attestation) XChainConfLevelStr() string
- type AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainId(chain_id uint64) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevel(chain_id uint64, conf_level uint32) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffset(chain_id uint64, conf_level uint32, offset uint64) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeight(chain_id uint64, conf_level uint32, offset uint64, height uint64) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeightHash(chain_id uint64, conf_level uint32, offset uint64, height uint64, hash []byte) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeightHashAttestationRoot(chain_id uint64, conf_level uint32, offset uint64, height uint64, hash []byte, ...) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
- type AttestationCreatedHeightIndexKey
- type AttestationIdIndexKey
- type AttestationIndexKey
- type AttestationIterator
- type AttestationPrimaryKey
- type AttestationStatusChainIdConfLevelOffsetIndexKey
- func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatus(status uint32) AttestationStatusChainIdConfLevelOffsetIndexKey
- func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainId(status uint32, chain_id uint64) AttestationStatusChainIdConfLevelOffsetIndexKey
- func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainIdConfLevel(status uint32, chain_id uint64, conf_level uint32) AttestationStatusChainIdConfLevelOffsetIndexKey
- func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainIdConfLevelOffset(status uint32, chain_id uint64, conf_level uint32, offset uint64) AttestationStatusChainIdConfLevelOffsetIndexKey
- type AttestationStore
- type AttestationTable
- type Keeper
- func (k *Keeper) Add(ctx context.Context, msg *types.MsgAddVotes) error
- func (k *Keeper) Approve(ctx context.Context, valset ValSet) error
- func (k *Keeper) AttestationsFrom(ctx context.Context, req *types.AttestationsFromRequest) (*types.AttestationsFromResponse, error)
- func (k *Keeper) BeginBlock(ctx context.Context) error
- func (k *Keeper) EndBlock(ctx context.Context) error
- func (k *Keeper) ExtendVote(ctx sdk.Context, _ *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
- func (k *Keeper) LatestAttestation(ctx context.Context, req *types.LatestAttestationRequest) (*types.LatestAttestationResponse, error)
- func (k *Keeper) ListAttestationsFrom(ctx context.Context, chainID uint64, confLevel uint32, offset uint64, ...) ([]*types.Attestation, error)
- func (k *Keeper) PrepareVotes(ctx context.Context, commit abci.ExtendedCommitInfo) ([]sdk.Msg, error)
- func (k *Keeper) RegisterProposalService(server grpc1.Server)
- func (k *Keeper) SetValidatorProvider(valProvider vtypes.ValidatorProvider)
- func (k *Keeper) VerifyVoteExtension(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
- func (k *Keeper) WindowCompare(ctx context.Context, req *types.WindowCompareRequest) (*types.WindowCompareResponse, error)
- type Signature
- func (*Signature) Descriptor() ([]byte, []int)deprecated
- func (x *Signature) GetAttId() uint64
- func (x *Signature) GetId() uint64
- func (x *Signature) GetSignature() []byte
- func (x *Signature) GetValidatorAddress() []byte
- func (*Signature) ProtoMessage()
- func (x *Signature) ProtoReflect() protoreflect.Message
- func (x *Signature) Reset()
- func (x *Signature) String() string
- type SignatureAttIdIndexKey
- type SignatureAttIdValidatorAddressIndexKey
- type SignatureIdIndexKey
- type SignatureIndexKey
- type SignatureIterator
- type SignaturePrimaryKey
- type SignatureTable
- type Status
- type ValSet
Constants ¶
This section is empty.
Variables ¶
var ( Status_name = map[int32]string{ 0: "Unknown", 1: "Pending", 2: "Approved", } Status_value = map[string]int32{ "Unknown": 0, "Pending": 1, "Approved": 2, } )
Enum value maps for Status.
var File_halo_attest_keeper_attestation_proto protoreflect.FileDescriptor
Functions ¶
func NewMsgServerImpl ¶
func NewMsgServerImpl(keeper *Keeper) types.MsgServiceServer
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func NewProposalServer ¶
func NewProposalServer(keeper *Keeper) types.MsgServiceServer
NewProposalServer returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Attestation ¶
type Attestation struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Auto-incremented ID ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Chain ID as per https://chainlist.org ConfLevel uint32 `protobuf:"varint,3,opt,name=conf_level,json=confLevel,proto3" json:"conf_level,omitempty"` // Confirmation level of the cross-chain block Offset uint64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` // Offset of the cross-chain block Height uint64 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` // Height of the source-chain block Hash []byte `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"` // Hash of the source-chain block AttestationRoot []byte `protobuf:"bytes,7,opt,name=attestation_root,json=attestationRoot,proto3" json:"attestation_root,omitempty"` // Attestation merkle root of the cross-chain Block Status uint32 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` // Status of the block; pending, approved. ValidatorSetId uint64 `protobuf:"varint,9,opt,name=validator_set_id,json=validatorSetId,proto3" json:"validator_set_id,omitempty"` // Validator set that approved this attestation. CreatedHeight uint64 `protobuf:"varint,10,opt,name=created_height,json=createdHeight,proto3" json:"created_height,omitempty"` // Consensus height at which this attestation was created. // contains filtered or unexported fields }
func (*Attestation) Descriptor
deprecated
func (*Attestation) Descriptor() ([]byte, []int)
Deprecated: Use Attestation.ProtoReflect.Descriptor instead.
func (*Attestation) GetAttestationRoot ¶
func (x *Attestation) GetAttestationRoot() []byte
func (*Attestation) GetChainId ¶
func (x *Attestation) GetChainId() uint64
func (*Attestation) GetConfLevel ¶
func (x *Attestation) GetConfLevel() uint32
func (*Attestation) GetCreatedHeight ¶
func (x *Attestation) GetCreatedHeight() uint64
func (*Attestation) GetHash ¶ added in v0.1.0
func (x *Attestation) GetHash() []byte
func (*Attestation) GetHeight ¶ added in v0.1.0
func (x *Attestation) GetHeight() uint64
func (*Attestation) GetId ¶
func (x *Attestation) GetId() uint64
func (*Attestation) GetOffset ¶ added in v0.1.6
func (x *Attestation) GetOffset() uint64
func (*Attestation) GetStatus ¶
func (x *Attestation) GetStatus() uint32
func (*Attestation) GetValidatorSetId ¶
func (x *Attestation) GetValidatorSetId() uint64
func (*Attestation) ProtoMessage ¶
func (*Attestation) ProtoMessage()
func (*Attestation) ProtoReflect ¶
func (x *Attestation) ProtoReflect() protoreflect.Message
func (*Attestation) Reset ¶
func (x *Attestation) Reset()
func (*Attestation) String ¶
func (x *Attestation) String() string
func (*Attestation) XChainConfLevel ¶ added in v0.1.8
func (a *Attestation) XChainConfLevel() xchain.ConfLevel
func (*Attestation) XChainConfLevelStr ¶ added in v0.1.8
func (a *Attestation) XChainConfLevelStr() string
type AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey ¶ added in v0.1.8
type AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey struct {
// contains filtered or unexported fields
}
func (AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainId ¶ added in v0.1.8
func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainId(chain_id uint64) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
func (AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevel ¶ added in v0.1.8
func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevel(chain_id uint64, conf_level uint32) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
func (AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffset ¶ added in v0.1.8
func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffset(chain_id uint64, conf_level uint32, offset uint64) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
func (AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeight ¶ added in v0.1.8
func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeight(chain_id uint64, conf_level uint32, offset uint64, height uint64) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
func (AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeightHash ¶ added in v0.1.8
func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeightHash(chain_id uint64, conf_level uint32, offset uint64, height uint64, hash []byte) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
func (AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeightHashAttestationRoot ¶ added in v0.1.8
func (this AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey) WithChainIdConfLevelOffsetHeightHashAttestationRoot(chain_id uint64, conf_level uint32, offset uint64, height uint64, hash []byte, attestation_root []byte) AttestationChainIdConfLevelOffsetHeightHashAttestationRootIndexKey
type AttestationCreatedHeightIndexKey ¶
type AttestationCreatedHeightIndexKey struct {
// contains filtered or unexported fields
}
func (AttestationCreatedHeightIndexKey) WithCreatedHeight ¶
func (this AttestationCreatedHeightIndexKey) WithCreatedHeight(created_height uint64) AttestationCreatedHeightIndexKey
type AttestationIdIndexKey ¶
type AttestationIdIndexKey struct {
// contains filtered or unexported fields
}
func (AttestationIdIndexKey) WithId ¶
func (this AttestationIdIndexKey) WithId(id uint64) AttestationIdIndexKey
type AttestationIndexKey ¶
type AttestationIndexKey interface {
// contains filtered or unexported methods
}
type AttestationIterator ¶
func (AttestationIterator) Value ¶
func (i AttestationIterator) Value() (*Attestation, error)
type AttestationPrimaryKey ¶
type AttestationPrimaryKey = AttestationIdIndexKey
primary key starting index..
type AttestationStatusChainIdConfLevelOffsetIndexKey ¶ added in v0.1.8
type AttestationStatusChainIdConfLevelOffsetIndexKey struct {
// contains filtered or unexported fields
}
func (AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatus ¶ added in v0.1.8
func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatus(status uint32) AttestationStatusChainIdConfLevelOffsetIndexKey
func (AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainId ¶ added in v0.1.8
func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainId(status uint32, chain_id uint64) AttestationStatusChainIdConfLevelOffsetIndexKey
func (AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainIdConfLevel ¶ added in v0.1.8
func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainIdConfLevel(status uint32, chain_id uint64, conf_level uint32) AttestationStatusChainIdConfLevelOffsetIndexKey
func (AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainIdConfLevelOffset ¶ added in v0.1.8
func (this AttestationStatusChainIdConfLevelOffsetIndexKey) WithStatusChainIdConfLevelOffset(status uint32, chain_id uint64, conf_level uint32, offset uint64) AttestationStatusChainIdConfLevelOffsetIndexKey
type AttestationStore ¶
type AttestationStore interface { AttestationTable() AttestationTable SignatureTable() SignatureTable // contains filtered or unexported methods }
func NewAttestationStore ¶
func NewAttestationStore(db ormtable.Schema) (AttestationStore, error)
type AttestationTable ¶
type AttestationTable interface { Insert(ctx context.Context, attestation *Attestation) error InsertReturningId(ctx context.Context, attestation *Attestation) (uint64, error) LastInsertedSequence(ctx context.Context) (uint64, error) Update(ctx context.Context, attestation *Attestation) error Save(ctx context.Context, attestation *Attestation) error Delete(ctx context.Context, attestation *Attestation) error Has(ctx context.Context, id uint64) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. Get(ctx context.Context, id uint64) (*Attestation, error) HasByChainIdConfLevelOffsetHeightHashAttestationRoot(ctx context.Context, chain_id uint64, conf_level uint32, offset uint64, height uint64, hash []byte, attestation_root []byte) (found bool, err error) // GetByChainIdConfLevelOffsetHeightHashAttestationRoot returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetByChainIdConfLevelOffsetHeightHashAttestationRoot(ctx context.Context, chain_id uint64, conf_level uint32, offset uint64, height uint64, hash []byte, attestation_root []byte) (*Attestation, error) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error DeleteRange(ctx context.Context, from, to AttestationIndexKey) error // contains filtered or unexported methods }
func NewAttestationTable ¶
func NewAttestationTable(db ormtable.Schema) (AttestationTable, error)
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper is the attestation keeper. It keeps tracks of all attestations included on-chain and detects when they are approved.
func New ¶
func New( cdc codec.BinaryCodec, storeSvc store.KVStoreService, skeeper baseapp.ValidatorStore, namer types.ChainNameFunc, voter types.Voter, voteWindow uint64, voteExtLimit uint64, trimLag uint64, ) (*Keeper, error)
New returns a new attestation keeper.
func (*Keeper) Add ¶
Add adds the given aggregate votes as pending attestations to the store. It merges the votes with attestations it already exists.
func (*Keeper) Approve ¶
Approve approves any pending attestations that have quorum signatures from the provided set.
func (*Keeper) AttestationsFrom ¶
func (k *Keeper) AttestationsFrom(ctx context.Context, req *types.AttestationsFromRequest) (*types.AttestationsFromResponse, error)
func (*Keeper) ExtendVote ¶
func (k *Keeper) ExtendVote(ctx sdk.Context, _ *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
ExtendVote extends a vote with application-injected data (vote extensions).
func (*Keeper) LatestAttestation ¶
func (k *Keeper) LatestAttestation(ctx context.Context, req *types.LatestAttestationRequest) (*types.LatestAttestationResponse, error)
func (*Keeper) ListAttestationsFrom ¶
func (k *Keeper) ListAttestationsFrom(ctx context.Context, chainID uint64, confLevel uint32, offset uint64, max uint64) ([]*types.Attestation, error)
ListAttestationsFrom returns the subsequent approved attestations from the provided offset (inclusive).
func (*Keeper) PrepareVotes ¶
func (*Keeper) RegisterProposalService ¶
RegisterProposalService registers the proposal service on the provided router. This implements abci.ProcessProposal verification of new proposals.
func (*Keeper) SetValidatorProvider ¶
func (k *Keeper) SetValidatorProvider(valProvider vtypes.ValidatorProvider)
SetValidatorProvider sets the validator provider.
func (*Keeper) VerifyVoteExtension ¶
func (k *Keeper) VerifyVoteExtension(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) ( *abci.ResponseVerifyVoteExtension, error, )
VerifyVoteExtension verifies a vote extension.
func (*Keeper) WindowCompare ¶
func (k *Keeper) WindowCompare(ctx context.Context, req *types.WindowCompareRequest) (*types.WindowCompareResponse, error)
type Signature ¶
type Signature struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Auto-incremented ID Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // Validator signature over XBlockRoot; Ethereum 65 bytes [R || S || V] format. ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // Validator ethereum address; 20 bytes. AttId uint64 `protobuf:"varint,4,opt,name=att_id,json=attId,proto3" json:"att_id,omitempty"` // Attestation ID to which this signature belongs. // contains filtered or unexported fields }
Signature is the attestation signature of the validator over the block root.
func (*Signature) Descriptor
deprecated
func (*Signature) GetSignature ¶
func (*Signature) GetValidatorAddress ¶
func (*Signature) ProtoMessage ¶
func (*Signature) ProtoMessage()
func (*Signature) ProtoReflect ¶
func (x *Signature) ProtoReflect() protoreflect.Message
type SignatureAttIdIndexKey ¶ added in v0.1.0
type SignatureAttIdIndexKey struct {
// contains filtered or unexported fields
}
func (SignatureAttIdIndexKey) WithAttId ¶ added in v0.1.0
func (this SignatureAttIdIndexKey) WithAttId(att_id uint64) SignatureAttIdIndexKey
type SignatureAttIdValidatorAddressIndexKey ¶
type SignatureAttIdValidatorAddressIndexKey struct {
// contains filtered or unexported fields
}
func (SignatureAttIdValidatorAddressIndexKey) WithAttId ¶
func (this SignatureAttIdValidatorAddressIndexKey) WithAttId(att_id uint64) SignatureAttIdValidatorAddressIndexKey
func (SignatureAttIdValidatorAddressIndexKey) WithAttIdValidatorAddress ¶
func (this SignatureAttIdValidatorAddressIndexKey) WithAttIdValidatorAddress(att_id uint64, validator_address []byte) SignatureAttIdValidatorAddressIndexKey
type SignatureIdIndexKey ¶
type SignatureIdIndexKey struct {
// contains filtered or unexported fields
}
func (SignatureIdIndexKey) WithId ¶
func (this SignatureIdIndexKey) WithId(id uint64) SignatureIdIndexKey
type SignatureIndexKey ¶
type SignatureIndexKey interface {
// contains filtered or unexported methods
}
type SignatureIterator ¶
func (SignatureIterator) Value ¶
func (i SignatureIterator) Value() (*Signature, error)
type SignaturePrimaryKey ¶
type SignaturePrimaryKey = SignatureIdIndexKey
primary key starting index..
type SignatureTable ¶
type SignatureTable interface { Insert(ctx context.Context, signature *Signature) error InsertReturningId(ctx context.Context, signature *Signature) (uint64, error) LastInsertedSequence(ctx context.Context) (uint64, error) Update(ctx context.Context, signature *Signature) error Save(ctx context.Context, signature *Signature) error Delete(ctx context.Context, signature *Signature) error Has(ctx context.Context, id uint64) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. Get(ctx context.Context, id uint64) (*Signature, error) HasByAttIdValidatorAddress(ctx context.Context, att_id uint64, validator_address []byte) (found bool, err error) // GetByAttIdValidatorAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. GetByAttIdValidatorAddress(ctx context.Context, att_id uint64, validator_address []byte) (*Signature, error) List(ctx context.Context, prefixKey SignatureIndexKey, opts ...ormlist.Option) (SignatureIterator, error) ListRange(ctx context.Context, from, to SignatureIndexKey, opts ...ormlist.Option) (SignatureIterator, error) DeleteBy(ctx context.Context, prefixKey SignatureIndexKey) error DeleteRange(ctx context.Context, from, to SignatureIndexKey) error // contains filtered or unexported methods }
func NewSignatureTable ¶
func NewSignatureTable(db ormtable.Schema) (SignatureTable, error)
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType