module

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QBFTConsensusType  = "qbft"
	IBFT2ConsensusType = "ibft2"
)
View Source
const QBFT_CLIENT_TYPE = "hb-qbft"

Variables

View Source
var (
	ErrInvalidLengthConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQbft        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQbft          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQbft = fmt.Errorf("proto: unexpected end of group")
)
View Source
var IBCCommitmentsSlot = common.HexToHash("1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900")

keccak256(abi.encode(uint256(keccak256("ibc.commitment")) - 1)) & ~bytes32(uint256(0xff))

Functions

This section is empty.

Types

type ClientState

type ClientState struct {
	ChainId         []byte       `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	IbcStoreAddress []byte       `protobuf:"bytes,2,opt,name=ibc_store_address,json=ibcStoreAddress,proto3" json:"ibc_store_address,omitempty"`
	LatestHeight    types.Height `protobuf:"bytes,3,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height"`
	// duration in seconds
	// if this is set to 0, the client will not verify the header's timestamp is within the trusting period
	TrustingPeriod uint64 `protobuf:"varint,4,opt,name=trusting_period,json=trustingPeriod,proto3" json:"trusting_period,omitempty"`
	// duration in seconds
	MaxClockDrift uint64 `protobuf:"varint,5,opt,name=max_clock_drift,json=maxClockDrift,proto3" json:"max_clock_drift,omitempty"`
}

func (*ClientState) CheckForMisbehaviour

func (cs *ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) bool

func (*ClientState) CheckSubstituteAndUpdateState

func (cs *ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, substituteClientStore storetypes.KVStore, substituteClient exported.ClientState) error

func (*ClientState) ClientType

func (cs *ClientState) ClientType() string

func (*ClientState) Descriptor

func (*ClientState) Descriptor() ([]byte, []int)

func (*ClientState) ExportMetadata

func (cs *ClientState) ExportMetadata(clientStore storetypes.KVStore) []exported.GenesisMetadata

func (*ClientState) GetLatestHeight

func (cs *ClientState) GetLatestHeight() exported.Height

func (*ClientState) GetTimestampAtHeight

func (cs *ClientState) GetTimestampAtHeight(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height) (uint64, error)

func (*ClientState) Initialize

func (cs *ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, consensusState exported.ConsensusState) error

func (*ClientState) Marshal

func (m *ClientState) Marshal() (dAtA []byte, err error)

func (*ClientState) MarshalTo

func (m *ClientState) MarshalTo(dAtA []byte) (int, error)

func (*ClientState) MarshalToSizedBuffer

func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClientState) ProtoMessage

func (*ClientState) ProtoMessage()

func (*ClientState) Reset

func (m *ClientState) Reset()

func (*ClientState) Size

func (m *ClientState) Size() (n int)

func (*ClientState) Status

func (cs *ClientState) Status(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec) exported.Status

func (*ClientState) String

func (m *ClientState) String() string

func (*ClientState) Unmarshal

func (m *ClientState) Unmarshal(dAtA []byte) error

func (*ClientState) UpdateState

func (cs *ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height

func (*ClientState) UpdateStateOnMisbehaviour

func (cs *ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage)

func (*ClientState) Validate

func (cs *ClientState) Validate() error

func (*ClientState) VerifyClientMessage

func (cs *ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error

func (*ClientState) VerifyMembership

func (cs *ClientState) VerifyMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, value []byte) error

func (*ClientState) VerifyNonMembership

func (cs *ClientState) VerifyNonMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path) error

func (*ClientState) VerifyUpgradeAndUpdateState

func (cs *ClientState) VerifyUpgradeAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, store storetypes.KVStore, newClient exported.ClientState, newConsState exported.ConsensusState, proofUpgradeClient, proofUpgradeConsState []byte) error

func (*ClientState) XXX_DiscardUnknown

func (m *ClientState) XXX_DiscardUnknown()

func (*ClientState) XXX_Marshal

func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClientState) XXX_Merge

func (m *ClientState) XXX_Merge(src proto.Message)

func (*ClientState) XXX_Size

func (m *ClientState) XXX_Size() int

func (*ClientState) XXX_Unmarshal

func (m *ClientState) XXX_Unmarshal(b []byte) error

func (*ClientState) ZeroCustomFields

func (cs *ClientState) ZeroCustomFields() exported.ClientState

type ConsensusState

type ConsensusState struct {
	Timestamp  uint64   `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Root       []byte   `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"`
	Validators [][]byte `protobuf:"bytes,3,rep,name=validators,proto3" json:"validators,omitempty"`
}

func (*ConsensusState) ClientType

func (cs *ConsensusState) ClientType() string

func (*ConsensusState) Descriptor

func (*ConsensusState) Descriptor() ([]byte, []int)

func (*ConsensusState) GetTimestamp

func (cs *ConsensusState) GetTimestamp() uint64

func (*ConsensusState) Marshal

func (m *ConsensusState) Marshal() (dAtA []byte, err error)

func (*ConsensusState) MarshalTo

func (m *ConsensusState) MarshalTo(dAtA []byte) (int, error)

func (*ConsensusState) MarshalToSizedBuffer

func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConsensusState) ProtoMessage

func (*ConsensusState) ProtoMessage()

func (*ConsensusState) Reset

func (m *ConsensusState) Reset()

func (*ConsensusState) Size

func (m *ConsensusState) Size() (n int)

func (*ConsensusState) String

func (m *ConsensusState) String() string

func (*ConsensusState) Unmarshal

func (m *ConsensusState) Unmarshal(dAtA []byte) error

func (*ConsensusState) ValidateBasic

func (cs *ConsensusState) ValidateBasic() error

func (*ConsensusState) XXX_DiscardUnknown

func (m *ConsensusState) XXX_DiscardUnknown()

func (*ConsensusState) XXX_Marshal

func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConsensusState) XXX_Merge

func (m *ConsensusState) XXX_Merge(src proto.Message)

func (*ConsensusState) XXX_Size

func (m *ConsensusState) XXX_Size() int

func (*ConsensusState) XXX_Unmarshal

func (m *ConsensusState) XXX_Unmarshal(b []byte) error

type ExtraData

type ExtraData struct {
	Vanity     []byte
	Validators []common.Address
	Vote       interface{}
	Round      []byte
	Seals      [][]byte
}

type Fraction added in v0.2.5

type Fraction struct {
	Numerator   uint64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"`
	Denominator uint64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"`
}

func (*Fraction) Descriptor added in v0.2.5

func (*Fraction) Descriptor() ([]byte, []int)

func (*Fraction) Marshal added in v0.2.5

func (m *Fraction) Marshal() (dAtA []byte, err error)

func (*Fraction) MarshalTo added in v0.2.5

func (m *Fraction) MarshalTo(dAtA []byte) (int, error)

func (*Fraction) MarshalToSizedBuffer added in v0.2.5

func (m *Fraction) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Fraction) ProtoMessage added in v0.2.5

func (*Fraction) ProtoMessage()

func (*Fraction) Reset added in v0.2.5

func (m *Fraction) Reset()

func (*Fraction) Size added in v0.2.5

func (m *Fraction) Size() (n int)

func (*Fraction) String added in v0.2.5

func (m *Fraction) String() string

func (*Fraction) Unmarshal added in v0.2.5

func (m *Fraction) Unmarshal(dAtA []byte) error

func (*Fraction) XXX_DiscardUnknown added in v0.2.5

func (m *Fraction) XXX_DiscardUnknown()

func (*Fraction) XXX_Marshal added in v0.2.5

func (m *Fraction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Fraction) XXX_Merge added in v0.2.5

func (m *Fraction) XXX_Merge(src proto.Message)

func (*Fraction) XXX_Size added in v0.2.5

func (m *Fraction) XXX_Size() int

func (*Fraction) XXX_Unmarshal added in v0.2.5

func (m *Fraction) XXX_Unmarshal(b []byte) error
type Header struct {
	// RLP encoded header of Besu, which does not include the seals in the extra data
	BesuHeaderRlp     []byte       `protobuf:"bytes,1,opt,name=besu_header_rlp,json=besuHeaderRlp,proto3" json:"besu_header_rlp,omitempty"`
	Seals             [][]byte     `protobuf:"bytes,2,rep,name=seals,proto3" json:"seals,omitempty"`
	TrustedHeight     types.Height `protobuf:"bytes,3,opt,name=trusted_height,json=trustedHeight,proto3" json:"trusted_height"`
	AccountStateProof []byte       `protobuf:"bytes,4,opt,name=account_state_proof,json=accountStateProof,proto3" json:"account_state_proof,omitempty"`
}

func (Header) ClientType

func (Header) ClientType() string

func (*Header) Descriptor

func (*Header) Descriptor() ([]byte, []int)

func (*Header) GetHeight

func (h *Header) GetHeight() exported.Height

func (*Header) Marshal

func (m *Header) Marshal() (dAtA []byte, err error)

func (*Header) MarshalTo

func (m *Header) MarshalTo(dAtA []byte) (int, error)

func (*Header) MarshalToSizedBuffer

func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) Size

func (m *Header) Size() (n int)

func (*Header) String

func (m *Header) String() string

func (*Header) Unmarshal

func (m *Header) Unmarshal(dAtA []byte) error

func (*Header) ValidateBasic

func (h *Header) ValidateBasic() error

func (*Header) XXX_DiscardUnknown

func (m *Header) XXX_DiscardUnknown()

func (*Header) XXX_Marshal

func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Header) XXX_Merge

func (m *Header) XXX_Merge(src proto.Message)

func (*Header) XXX_Size

func (m *Header) XXX_Size() int

func (*Header) XXX_Unmarshal

func (m *Header) XXX_Unmarshal(b []byte) error

type Module

type Module struct{}

func (Module) GetCmd

func (Module) GetCmd(ctx *config.Context) *cobra.Command

GetCmd returns the command

func (Module) Name

func (Module) Name() string

Name returns the name of the module

func (Module) RegisterInterfaces

func (Module) RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the module interfaces to protobuf Any.

type Prover

type Prover struct {
	// contains filtered or unexported fields
}

func NewProver

func NewProver(chain *ethereum.Chain, config ProverConfig) *Prover

func (*Prover) CheckRefreshRequired

func (pr *Prover) CheckRefreshRequired(ctx context.Context, counterparty core.ChainInfoICS02Querier) (bool, error)

CheckRefreshRequired implements Prover.CheckRefreshRequired

func (*Prover) CreateInitialLightClientState

func (pr *Prover) CreateInitialLightClientState(ctx context.Context, height exported.Height) (exported.ClientState, exported.ConsensusState, error)

CreateInitialLightClientState implements Prover.CreateInitialLightClientState

func (*Prover) GetLatestFinalizedHeader

func (pr *Prover) GetLatestFinalizedHeader(ctx context.Context) (latestFinalizedHeader core.Header, err error)

GetLatestFinalizedHeader implements Prover.GetLatestFinalizedHeader

func (*Prover) Init

func (pr *Prover) Init(homePath string, timeout time.Duration, codec codec.ProtoCodecMarshaler, debug bool) error

Init implements Prover.Init

func (*Prover) ProveHostConsensusState

func (pr *Prover) ProveHostConsensusState(ctx core.QueryContext, height exported.Height, consensusState exported.ConsensusState) (proof []byte, err error)

ProveHostConsensusState implements Prover.ProveHostConsensusState

func (*Prover) ProveState

func (pr *Prover) ProveState(ctx core.QueryContext, path string, value []byte) ([]byte, clienttypes.Height, error)

ProveState implements Prover.ProveState

func (*Prover) SetRelayInfo

func (pr *Prover) SetRelayInfo(path *core.PathEnd, counterparty *core.ProvableChain, counterpartyPath *core.PathEnd) error

SetRelayInfo implements Prover.SetRelayInfo

func (*Prover) SetupForRelay

func (pr *Prover) SetupForRelay(ctx context.Context) error

SetupForRelay implements Prover.SetupForRelay

func (*Prover) SetupHeadersForUpdate

func (pr *Prover) SetupHeadersForUpdate(ctx context.Context, counterparty core.FinalityAwareChain, latestFinalizedHeader core.Header) ([]core.Header, error)

SetupHeadersForUpdate implements Prover.SetupHeadersForUpdate

type ProverConfig

type ProverConfig struct {
	ConsensusType        string    `protobuf:"bytes,1,opt,name=consensus_type,json=consensusType,proto3" json:"consensus_type,omitempty"`
	TrustingPeriod       string    `protobuf:"bytes,2,opt,name=trusting_period,json=trustingPeriod,proto3" json:"trusting_period,omitempty"`
	MaxClockDrift        string    `protobuf:"bytes,3,opt,name=max_clock_drift,json=maxClockDrift,proto3" json:"max_clock_drift,omitempty"`
	RefreshThresholdRate *Fraction `protobuf:"bytes,4,opt,name=refresh_threshold_rate,json=refreshThresholdRate,proto3" json:"refresh_threshold_rate,omitempty"`
}

func (ProverConfig) Build

func (c ProverConfig) Build(chain core.Chain) (core.Prover, error)

func (*ProverConfig) Descriptor

func (*ProverConfig) Descriptor() ([]byte, []int)

func (ProverConfig) GetMaxClockDrift added in v0.2.3

func (c ProverConfig) GetMaxClockDrift() time.Duration

func (ProverConfig) GetTrustingPeriod

func (c ProverConfig) GetTrustingPeriod() time.Duration

func (ProverConfig) IsIBFT2

func (c ProverConfig) IsIBFT2() bool

func (*ProverConfig) Marshal

func (m *ProverConfig) Marshal() (dAtA []byte, err error)

func (*ProverConfig) MarshalTo

func (m *ProverConfig) MarshalTo(dAtA []byte) (int, error)

func (*ProverConfig) MarshalToSizedBuffer

func (m *ProverConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProverConfig) ProtoMessage

func (*ProverConfig) ProtoMessage()

func (*ProverConfig) Reset

func (m *ProverConfig) Reset()

func (*ProverConfig) Size

func (m *ProverConfig) Size() (n int)

func (*ProverConfig) String

func (m *ProverConfig) String() string

func (*ProverConfig) Unmarshal

func (m *ProverConfig) Unmarshal(dAtA []byte) error

func (ProverConfig) Validate

func (c ProverConfig) Validate() error

func (*ProverConfig) XXX_DiscardUnknown

func (m *ProverConfig) XXX_DiscardUnknown()

func (*ProverConfig) XXX_Marshal

func (m *ProverConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProverConfig) XXX_Merge

func (m *ProverConfig) XXX_Merge(src proto.Message)

func (*ProverConfig) XXX_Size

func (m *ProverConfig) XXX_Size() int

func (*ProverConfig) XXX_Unmarshal

func (m *ProverConfig) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL