Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- type Fraction
- func (*Fraction) Descriptor() ([]byte, []int)
- func (m *Fraction) Marshal() (dAtA []byte, err error)
- func (m *Fraction) MarshalTo(dAtA []byte) (int, error)
- func (m *Fraction) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Fraction) ProtoMessage()
- func (m *Fraction) Reset()
- func (m *Fraction) Size() (n int)
- func (m *Fraction) String() string
- func (m *Fraction) Unmarshal(dAtA []byte) error
- func (m *Fraction) XXX_DiscardUnknown()
- func (m *Fraction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Fraction) XXX_Merge(src proto.Message)
- func (m *Fraction) XXX_Size() int
- func (m *Fraction) XXX_Unmarshal(b []byte) error
- type InitialState
- type Module
- type Prover
- func (pr *Prover) CheckRefreshRequired(counterparty core.ChainInfoICS02Querier) (bool, error)
- func (pr *Prover) CreateInitialLightClientState(height ibcexported.Height) (ibcexported.ClientState, ibcexported.ConsensusState, error)
- func (pr *Prover) GetLatestFinalizedHeader() (headers core.Header, err error)
- func (pr *Prover) GetLogger() *log.RelayLogger
- func (pr *Prover) Init(homePath string, timeout time.Duration, codec codec.ProtoCodecMarshaler, ...) error
- func (pr *Prover) ProveHostConsensusState(ctx core.QueryContext, height ibcexported.Height, ...) (proof []byte, err error)
- func (pr *Prover) ProveState(ctx core.QueryContext, path string, value []byte) ([]byte, clienttypes.Height, error)
- func (pr *Prover) SetRelayInfo(path *core.PathEnd, counterparty *core.ProvableChain, ...) error
- func (pr *Prover) SetupForRelay(ctx context.Context) error
- func (pr *Prover) SetupHeadersForUpdate(counterparty core.FinalityAwareChain, latestFinalizedHeader core.Header) ([]core.Header, error)
- type ProverConfig
- func (prc ProverConfig) Build(chain core.Chain) (core.Prover, error)
- func (*ProverConfig) Descriptor() ([]byte, []int)
- func (prc *ProverConfig) GetMaxClockDrift() time.Duration
- func (prc *ProverConfig) GetTrustingPeriod() time.Duration
- func (prc *ProverConfig) IsMainnetPreset() bool
- func (m *ProverConfig) Marshal() (dAtA []byte, err error)
- func (m *ProverConfig) MarshalTo(dAtA []byte) (int, error)
- func (m *ProverConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProverConfig) ProtoMessage()
- func (m *ProverConfig) Reset()
- func (m *ProverConfig) Size() (n int)
- func (m *ProverConfig) String() string
- func (m *ProverConfig) Unmarshal(dAtA []byte) error
- func (prc ProverConfig) Validate() error
- func (m *ProverConfig) XXX_DiscardUnknown()
- func (m *ProverConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProverConfig) XXX_Merge(src proto.Message)
- func (m *ProverConfig) XXX_Size() int
- func (m *ProverConfig) XXX_Unmarshal(b []byte) error
Constants ¶
const ( EXECUTION_STATE_ROOT_LEAF_INDEX = 2 EXECUTION_BLOCK_NUMBER_LEAF_INDEX = 6 )
merkle tree's leaf index
const ( MINIMAL_SECONDS_PER_SLOT uint64 = 6 MINIMAL_SLOTS_PER_EPOCH uint64 = 8 MINIMAL_EPOCHS_PER_SYNC_COMMITTEE_PERIOD uint64 = 8 )
minimal preset
const ( MAINNET_SECONDS_PER_SLOT uint64 = 12 MAINNET_SLOTS_PER_EPOCH uint64 = 32 MAINNET_EPOCHS_PER_SYNC_COMMITTEE_PERIOD uint64 = 256 )
mainnet preset
const ( Mainnet = "mainnet" Minimal = "minimal" Goerli = "goerli" Sepolia = "sepolia" )
const ( MAINNET_PRESET_SYNC_COMMITTEE_SIZE = 512 MINIMAL_PRESET_SYNC_COMMITTEE_SIZE = 32 )
const (
GENESIS_SLOT = 0
)
const ModuleName = "ethereum-light-client"
Variables ¶
var ( AltairSpec = lctypes.ForkSpec{ FinalizedRootGindex: 105, CurrentSyncCommitteeGindex: 54, NextSyncCommitteeGindex: 55, } BellatrixSpec = lctypes.ForkSpec{ FinalizedRootGindex: AltairSpec.FinalizedRootGindex, CurrentSyncCommitteeGindex: AltairSpec.CurrentSyncCommitteeGindex, NextSyncCommitteeGindex: AltairSpec.NextSyncCommitteeGindex, ExecutionPayloadGindex: 25, ExecutionPayloadStateRootGindex: 18, ExecutionPayloadBlockNumberGindex: 22, } CapellaSpec = BellatrixSpec DenebSpec = lctypes.ForkSpec{ FinalizedRootGindex: CapellaSpec.FinalizedRootGindex, CurrentSyncCommitteeGindex: CapellaSpec.CurrentSyncCommitteeGindex, NextSyncCommitteeGindex: CapellaSpec.NextSyncCommitteeGindex, ExecutionPayloadGindex: CapellaSpec.ExecutionPayloadGindex, ExecutionPayloadStateRootGindex: 34, ExecutionPayloadBlockNumberGindex: 38, } )
var ( ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group") )
var IBCCommitmentsSlot = common.HexToHash("1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900")
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the module interfaces to protobuf Any.
Types ¶
type Fraction ¶ added in v0.2.2
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.2
func (*Fraction) MarshalToSizedBuffer ¶ added in v0.2.2
func (*Fraction) ProtoMessage ¶ added in v0.2.2
func (*Fraction) ProtoMessage()
func (*Fraction) XXX_DiscardUnknown ¶ added in v0.2.2
func (m *Fraction) XXX_DiscardUnknown()
func (*Fraction) XXX_Marshal ¶ added in v0.2.2
func (*Fraction) XXX_Unmarshal ¶ added in v0.2.2
type InitialState ¶ added in v0.2.5
type Module ¶
type Module struct{}
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 (*Prover) CheckRefreshRequired ¶ added in v0.2.2
func (pr *Prover) CheckRefreshRequired(counterparty core.ChainInfoICS02Querier) (bool, error)
func (*Prover) CreateInitialLightClientState ¶ added in v0.2.5
func (pr *Prover) CreateInitialLightClientState(height ibcexported.Height) (ibcexported.ClientState, ibcexported.ConsensusState, error)
CreateInitialLightClientState returns a pair of ClientState and ConsensusState based on the state of the self chain at `height`. These states will be submitted to the counterparty chain as MsgCreateClient. If `height` is nil, the latest finalized height is selected automatically.
func (*Prover) GetLatestFinalizedHeader ¶
buildLatestFinalizedHeader returns the latest finalized header on this chain The returned header is expected to be the latest one of headers that can be verified by the light client
func (*Prover) GetLogger ¶ added in v0.3.1
func (pr *Prover) GetLogger() *log.RelayLogger
func (*Prover) Init ¶
func (pr *Prover) Init(homePath string, timeout time.Duration, codec codec.ProtoCodecMarshaler, debug bool) error
Init initializes the chain
func (*Prover) ProveHostConsensusState ¶ added in v0.2.8
func (pr *Prover) ProveHostConsensusState(ctx core.QueryContext, height ibcexported.Height, consensusState ibcexported.ConsensusState) (proof []byte, err error)
ProveHostConsensusState returns an existence proof of the consensus state at `height` This proof would be ignored in ibc-go, but it is required to `getSelfConsensusState` of ibc-solidity.
func (*Prover) ProveState ¶ added in v0.2.0
func (pr *Prover) ProveState(ctx core.QueryContext, path string, value []byte) ([]byte, clienttypes.Height, error)
ProveState returns the proof of an IBC state specified by `path` and `value`
func (*Prover) SetRelayInfo ¶
func (pr *Prover) SetRelayInfo(path *core.PathEnd, counterparty *core.ProvableChain, counterpartyPath *core.PathEnd) error
SetRelayInfo sets source's path and counterparty's info to the chain
func (*Prover) SetupForRelay ¶
SetupForRelay performs chain-specific setup before starting the relay
func (*Prover) SetupHeadersForUpdate ¶
func (pr *Prover) SetupHeadersForUpdate(counterparty core.FinalityAwareChain, latestFinalizedHeader core.Header) ([]core.Header, error)
SetupHeadersForUpdate returns the finalized header and any intermediate headers needed to apply it to the client on the counterpaty chain The order of the returned header slice should be as: [<intermediate headers>..., <update header>] if the header slice's length == 0 and err == nil, the relayer should skips the update-client
type ProverConfig ¶
type ProverConfig struct { BeaconEndpoint string `protobuf:"bytes,1,opt,name=beacon_endpoint,json=beaconEndpoint,proto3" json:"beacon_endpoint,omitempty"` Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"` TrustingPeriod string `protobuf:"bytes,3,opt,name=trusting_period,json=trustingPeriod,proto3" json:"trusting_period,omitempty"` MaxClockDrift string `protobuf:"bytes,4,opt,name=max_clock_drift,json=maxClockDrift,proto3" json:"max_clock_drift,omitempty"` RefreshThresholdRate *Fraction `protobuf:"bytes,5,opt,name=refresh_threshold_rate,json=refreshThresholdRate,proto3" json:"refresh_threshold_rate,omitempty"` }
func (*ProverConfig) Descriptor ¶
func (*ProverConfig) Descriptor() ([]byte, []int)
func (*ProverConfig) GetMaxClockDrift ¶ added in v0.2.2
func (prc *ProverConfig) GetMaxClockDrift() time.Duration
func (*ProverConfig) GetTrustingPeriod ¶ added in v0.2.2
func (prc *ProverConfig) GetTrustingPeriod() time.Duration
func (*ProverConfig) IsMainnetPreset ¶
func (prc *ProverConfig) IsMainnetPreset() bool
NOTE the prover supports only the mainnet and minimal preset for now
func (*ProverConfig) Marshal ¶
func (m *ProverConfig) Marshal() (dAtA []byte, err 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 ¶ added in v0.2.1
func (prc 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