Documentation ¶
Index ¶
- func GetAllReceipts(ctx context.Context, conn *Connection, block *etypes.Block) (etypes.Receipts, error)
- func MakeHeaderFromEthHeader(gethheader *etypes.Header, proofcache *ethashproof.DatasetMerkleTreeCache, ...) (*chain.Header, error)
- func MakeMessageFromEvent(mapping map[common.Address]string, event *etypes.Log, receiptsTrie *etrie.Trie, ...) (*chain.EthereumOutboundMessage, error)
- type BlockCache
- type BlockLoader
- type ChannelConfig
- type ChannelsConfig
- type Config
- type Connection
- type DefaultBlockLoader
- type DefaultCacheLoader
- type DoubleNodeWithMerkleProof
- type EthashproofCacheLoader
- type EthashproofCacheState
- type Header
- type HeaderCacheState
- type HeaderID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllReceipts ¶
func GetAllReceipts(ctx context.Context, conn *Connection, block *etypes.Block) (etypes.Receipts, error)
Fetch all receipts for the given block in batches of `receiptFetchBatchSize`
func MakeHeaderFromEthHeader ¶
func MakeHeaderFromEthHeader( gethheader *etypes.Header, proofcache *ethashproof.DatasetMerkleTreeCache, log *logrus.Entry, ) (*chain.Header, error)
Types ¶
type BlockCache ¶
type BlockCache struct {
// contains filtered or unexported fields
}
Keeps the blocks and receipts for the latest block heights / numbers in memory (up to `capacity` block numbers)
func NewBlockCache ¶
func NewBlockCache(capacity int) *BlockCache
func (*BlockCache) Get ¶
func (bc *BlockCache) Get(hash gethCommon.Hash) (*gethTypes.Block, *gethTrie.Trie, bool)
type BlockLoader ¶
type ChannelConfig ¶
type ChannelsConfig ¶
type ChannelsConfig struct { Basic ChannelConfig `mapstructure:"basic"` Incentivized ChannelConfig `mapstructure:"incentivized"` }
type Config ¶
type Config struct { Endpoint string `mapstructure:"endpoint"` // BeefyPrivateKey string `mapstructure:"beefy-private-key"` // ParachainCommitmentsPrivateKey string `mapstructure:"parachain-commitments-private-key"` DescendantsUntilFinal byte `mapstructure:"descendants-until-final"` // Channels ChannelsConfig `mapstructure:"channels"` // BeefyLightClient string `mapstructure:"beefylightclient"` StartBlock uint64 `mapstructure:"startblock"` }
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func (*Connection) Close ¶
func (co *Connection) Close()
func (*Connection) GetClient ¶
func (co *Connection) GetClient() *ethclient.Client
func (*Connection) GetKP ¶
func (co *Connection) GetKP() *secp256k1.Keypair
type DefaultBlockLoader ¶
type DefaultBlockLoader struct {
Conn *Connection
}
func (*DefaultBlockLoader) GetAllReceipts ¶
func (*DefaultBlockLoader) GetBlock ¶
func (d *DefaultBlockLoader) GetBlock(ctx context.Context, hash gethCommon.Hash) (*gethTypes.Block, error)
type DefaultCacheLoader ¶
type DefaultCacheLoader struct{}
func (*DefaultCacheLoader) MakeCache ¶
func (d *DefaultCacheLoader) MakeCache(epoch uint64) (*ethashproof.DatasetMerkleTreeCache, error)
type DoubleNodeWithMerkleProof ¶
func MakeProofData ¶
func MakeProofData( gethheader *etypes.Header, proofcache *ethashproof.DatasetMerkleTreeCache, ) ([]DoubleNodeWithMerkleProof, error)
type EthashproofCacheLoader ¶
type EthashproofCacheLoader interface {
MakeCache(epoch uint64) (*ethashproof.DatasetMerkleTreeCache, error)
}
type EthashproofCacheState ¶
type HeaderCacheState ¶
type HeaderCacheState struct {
// contains filtered or unexported fields
}
HeaderCacheState fetches and caches data we need to construct proofs as we move along the Ethereum chain.
func NewHeaderCacheState ¶
func NewHeaderCacheState( eg *errgroup.Group, initBlockHeight uint64, bl BlockLoader, ecl EthashproofCacheLoader, ) (*HeaderCacheState, error)
func (*HeaderCacheState) GetEthashproofCache ¶
func (s *HeaderCacheState) GetEthashproofCache(number uint64) (*ethashproof.DatasetMerkleTreeCache, error)
GetEthashProofCache returns the cache used for proof generation. It will return immediately if `number` is in the current or next epoch. Outside that range, it might block for multiple minutes to generate the cache. Calling GetEthashproofCache will also update the current epoch to `number` / 30000.
func (*HeaderCacheState) GetReceiptTrie ¶
func (s *HeaderCacheState) GetReceiptTrie(ctx context.Context, hash gethCommon.Hash) (*gethTrie.Trie, error)
GetReceiptTrie returns a Merkle Patricia trie constructed from the receipts of the block specified by `hash`. If the trie isn't cached, it will block for multiple seconds to fetch receipts and construct the trie.