Documentation ¶
Index ¶
- func CleanSignature(input types.BeefySignature) (v uint8, r [32]byte, s [32]byte, reverted bool, err error)
- func Hex(b []byte) string
- func ScanBlocks(ctx context.Context, meta *types.Metadata, api *gsrpc.SubstrateAPI, ...) (chan ScanBlocksResult, error)
- func ScanCommitments(ctx context.Context, meta *types.Metadata, api *gsrpc.SubstrateAPI, ...) (<-chan ScanCommitmentsResult, error)
- type BeefyAuthoritySet
- type BeefyClientState
- type Config
- type ContractsConfig
- type EthereumWriter
- type FinalRequestParams
- type InitialRequestParams
- type OnDemandRelay
- type OnDemandSyncConfig
- type PolkadotListener
- type Relay
- type Request
- type ScanBlocksResult
- type ScanCommitmentsResult
- type SinkConfig
- type SourceConfig
- type TokenBucket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanSignature ¶
func CleanSignature(input types.BeefySignature) (v uint8, r [32]byte, s [32]byte, reverted bool, err error)
Implementation derived from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/5bb3f3e788c6b2c806d562ef083b438354f969d7/contracts/utils/cryptography/ECDSA.sol#L139-L145
func ScanBlocks ¶
func ScanBlocks(ctx context.Context, meta *types.Metadata, api *gsrpc.SubstrateAPI, startBlock uint64) (chan ScanBlocksResult, error)
func ScanCommitments ¶
func ScanCommitments(ctx context.Context, meta *types.Metadata, api *gsrpc.SubstrateAPI, startBlock uint64) (<-chan ScanCommitmentsResult, error)
Types ¶
type BeefyAuthoritySet ¶
type BeefyClientState ¶
type Config ¶
type Config struct { Source SourceConfig `mapstructure:"source"` Sink SinkConfig `mapstructure:"sink"` OnDemandSync OnDemandSyncConfig `mapstructure:"on-demand-sync"` }
type ContractsConfig ¶
type EthereumWriter ¶
type EthereumWriter struct {
// contains filtered or unexported fields
}
func NewEthereumWriter ¶
func NewEthereumWriter( config *SinkConfig, conn *ethereum.Connection, ) *EthereumWriter
type FinalRequestParams ¶
type FinalRequestParams struct { Commitment contracts.BeefyClientCommitment Bitfield []*big.Int Proofs []contracts.BeefyClientValidatorProof Leaf contracts.BeefyClientMMRLeaf LeafProof [][32]byte LeafProofOrder *big.Int }
type InitialRequestParams ¶
type InitialRequestParams struct { Commitment contracts.BeefyClientCommitment Bitfield []*big.Int Proof contracts.BeefyClientValidatorProof }
type OnDemandRelay ¶
type OnDemandRelay struct {
// contains filtered or unexported fields
}
func NewOnDemandRelay ¶
func NewOnDemandRelay(config *Config, ethereumKeypair *secp256k1.Keypair) (*OnDemandRelay, error)
type OnDemandSyncConfig ¶
type OnDemandSyncConfig struct { // ID of the AssetHub channel AssetHubChannelID string `mapstructure:"asset-hub-channel-id"` // Maximum number of tokens available to consume MaxTokens uint64 `mapstructure:"max-tokens"` // Number of tokens added each `RefillPeriod` RefillAmount uint64 `mapstructure:"refill-amount"` // Period between token refills RefillPeriod uint64 `mapstructure:"refill-period"` }
type PolkadotListener ¶
type PolkadotListener struct {
// contains filtered or unexported fields
}
func NewPolkadotListener ¶
func NewPolkadotListener( config *SourceConfig, conn *relaychain.Connection, ) *PolkadotListener
type Request ¶
type Request struct { // Validators that signed this commitment Validators []substrate.Authority ValidatorsRoot [32]byte SignedCommitment types.SignedCommitment Proof merkle.SimplifiedMMRProof }
func (*Request) CommitmentHash ¶
func (*Request) MakeSubmitFinalParams ¶
func (*Request) MakeSubmitInitialParams ¶
func (r *Request) MakeSubmitInitialParams(valAddrIndex int64, initialBitfield []*big.Int) (*InitialRequestParams, error)
Generate RequestParams which contains merkle proof by validator's index together with the signature which will be verified in BeefyClient contract later
type ScanBlocksResult ¶
type ScanCommitmentsResult ¶
type ScanCommitmentsResult struct { SignedCommitment types.SignedCommitment Proof merkle.SimplifiedMMRProof BlockHash types.Hash Error error }
type SinkConfig ¶
type SinkConfig struct { Ethereum config.EthereumConfig `mapstructure:"ethereum"` DescendantsUntilFinal uint64 `mapstructure:"descendants-until-final"` Contracts ContractsConfig `mapstructure:"contracts"` }
type SourceConfig ¶
type SourceConfig struct { Polkadot config.PolkadotConfig `mapstructure:"polkadot"` BridgeHub config.ParachainConfig `mapstructure:"bridge-hub"` }
type TokenBucket ¶
type TokenBucket struct {
// contains filtered or unexported fields
}
func NewTokenBucket ¶
func NewTokenBucket(maxTokens, refillAmount uint64, refillPeriod time.Duration) *TokenBucket
func (*TokenBucket) Start ¶
func (tb *TokenBucket) Start(ctx context.Context)
func (*TokenBucket) TryConsume ¶
func (tb *TokenBucket) TryConsume(tokens uint64) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.