relay

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXECUTION_STATE_ROOT_LEAF_INDEX   = 2
	EXECUTION_BLOCK_NUMBER_LEAF_INDEX = 6
)

merkle tree's leaf index

View Source
const (
	MINIMAL_SECONDS_PER_SLOT                 uint64 = 6
	MINIMAL_SLOTS_PER_EPOCH                  uint64 = 8
	MINIMAL_EPOCHS_PER_SYNC_COMMITTEE_PERIOD uint64 = 8
)

minimal preset

View Source
const (
	MAINNET_SECONDS_PER_SLOT                 uint64 = 12
	MAINNET_SLOTS_PER_EPOCH                  uint64 = 32
	MAINNET_EPOCHS_PER_SYNC_COMMITTEE_PERIOD uint64 = 256
)

mainnet preset

View Source
const (
	Mainnet = "mainnet"
	Minimal = "minimal"
	Goerli  = "goerli"
	Sepolia = "sepolia"
)
View Source
const (
	GENESIS_SLOT = 0
)

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")
)

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) Descriptor() ([]byte, []int)

func (*Fraction) Marshal added in v0.2.2

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

func (*Fraction) MarshalTo added in v0.2.2

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

func (*Fraction) MarshalToSizedBuffer added in v0.2.2

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

func (*Fraction) ProtoMessage added in v0.2.2

func (*Fraction) ProtoMessage()

func (*Fraction) Reset added in v0.2.2

func (m *Fraction) Reset()

func (*Fraction) Size added in v0.2.2

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

func (*Fraction) String added in v0.2.2

func (m *Fraction) String() string

func (*Fraction) Unmarshal added in v0.2.2

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

func (*Fraction) XXX_DiscardUnknown added in v0.2.2

func (m *Fraction) XXX_DiscardUnknown()

func (*Fraction) XXX_Marshal added in v0.2.2

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

func (*Fraction) XXX_Merge added in v0.2.2

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

func (*Fraction) XXX_Size added in v0.2.2

func (m *Fraction) XXX_Size() int

func (*Fraction) XXX_Unmarshal added in v0.2.2

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

type InitialState added in v0.2.5

type InitialState struct {
	Genesis              beacon.Genesis
	Slot                 uint64
	BlockNumber          uint64
	AccountStorageRoot   [32]byte
	Timestamp            time.Time
	CurrentSyncCommittee lctypes.SyncCommittee
}

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 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

func (pr *Prover) GetLatestFinalizedHeader() (headers core.Header, err error)

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) 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

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

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) Build

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

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) 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 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

Jump to

Keyboard shortcuts

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