execution

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Hash   common.Hash
	Number uint64
	// contains filtered or unexported fields
}

func (*Block) AwaitBlock

func (block *Block) AwaitBlock(ctx context.Context, timeout time.Duration) *types.Block

func (*Block) EnsureBlock

func (block *Block) EnsureBlock(loadBlock func() (*types.Block, error)) (bool, error)

func (*Block) GetBlock

func (block *Block) GetBlock() *types.Block

func (*Block) GetParentHash

func (block *Block) GetParentHash() *common.Hash

func (*Block) GetSeenBy

func (block *Block) GetSeenBy() []*Client

func (*Block) SetSeenBy

func (block *Block) SetSeenBy(client *Client)

type BlockCache

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

func NewBlockCache

func NewBlockCache(ctx context.Context, logger logrus.FieldLogger, followDistance uint64) (*BlockCache, error)

func (*BlockCache) AddBlock

func (cache *BlockCache) AddBlock(hash common.Hash, number uint64) (*Block, bool)

func (*BlockCache) GetBlockDistance

func (cache *BlockCache) GetBlockDistance(blockRoot, headRoot common.Hash) (linked bool, distance uint64)

func (*BlockCache) GetCachedBlockByRoot

func (cache *BlockCache) GetCachedBlockByRoot(hash common.Hash) *Block

func (*BlockCache) GetCachedBlocks

func (cache *BlockCache) GetCachedBlocks() []*Block

func (*BlockCache) GetChainID

func (cache *BlockCache) GetChainID() *big.Int

func (*BlockCache) GetSpecs

func (cache *BlockCache) GetSpecs() *rpc.ChainSpec

func (*BlockCache) IsCanonicalBlock

func (cache *BlockCache) IsCanonicalBlock(blockRoot, headRoot common.Hash) bool

func (*BlockCache) SetClientSpecs

func (cache *BlockCache) SetClientSpecs(specs *rpc.ChainSpec) error

func (*BlockCache) SetMinFollowDistance

func (cache *BlockCache) SetMinFollowDistance(followDistance uint64)

func (*BlockCache) SubscribeBlockEvent

func (cache *BlockCache) SubscribeBlockEvent(capacity int) *Subscription[*Block]

func (*BlockCache) UnsubscribeBlockEvent

func (cache *BlockCache) UnsubscribeBlockEvent(subscription *Subscription[*Block])

type Client

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

func (*Client) GetClientType

func (client *Client) GetClientType() ClientType

func (*Client) GetEndpointConfig

func (client *Client) GetEndpointConfig() *ClientConfig

func (*Client) GetIndex

func (client *Client) GetIndex() uint16

func (*Client) GetLastError

func (client *Client) GetLastError() error

func (*Client) GetLastEventTime

func (client *Client) GetLastEventTime() time.Time

func (*Client) GetLastHead

func (client *Client) GetLastHead() (uint64, common.Hash)

func (*Client) GetName

func (client *Client) GetName() string

func (*Client) GetRPCClient

func (client *Client) GetRPCClient() *rpc.ExecutionClient

func (*Client) GetStatus

func (client *Client) GetStatus() ClientStatus

func (*Client) GetVersion

func (client *Client) GetVersion() string

func (*Client) NotifyNewBlock

func (client *Client) NotifyNewBlock(hash common.Hash, number uint64)

type ClientConfig

type ClientConfig struct {
	URL     string
	Name    string
	Headers map[string]string
}

type ClientStatus

type ClientStatus uint8
var (
	ClientStatusOnline        ClientStatus = 1
	ClientStatusOffline       ClientStatus = 2
	ClientStatusSynchronizing ClientStatus = 3
)

type ClientType

type ClientType int8
var (
	AnyClient        ClientType
	UnknownClient    ClientType = -1
	BesuClient       ClientType = 1
	ErigonClient     ClientType = 2
	EthjsClient      ClientType = 3
	GethClient       ClientType = 4
	NethermindClient ClientType = 5
	RethClient       ClientType = 6
)

func ParseClientType

func ParseClientType(name string) ClientType

func (ClientType) String

func (clientType ClientType) String() string

type Dispatcher

type Dispatcher[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Dispatcher[T]) Fire

func (d *Dispatcher[T]) Fire(data T)

func (*Dispatcher[T]) Subscribe

func (d *Dispatcher[T]) Subscribe(capacity int) *Subscription[T]

func (*Dispatcher[T]) Unsubscribe

func (d *Dispatcher[T]) Unsubscribe(subscription *Subscription[T])

type HeadFork

type HeadFork struct {
	Number       uint64
	Hash         common.Hash
	ReadyClients []*Client
	AllClients   []*Client
}

func (*HeadFork) IsClientReady

func (fork *HeadFork) IsClientReady(client *Client) bool

type Pool

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

func NewPool

func NewPool(ctx context.Context, config *PoolConfig, logger logrus.FieldLogger) (*Pool, error)

func (*Pool) AddEndpoint

func (pool *Pool) AddEndpoint(endpoint *ClientConfig) (*Client, error)

func (*Pool) AwaitReadyEndpoint added in v0.0.6

func (pool *Pool) AwaitReadyEndpoint(ctx context.Context, clientType ClientType) *Client

func (*Pool) GetAllEndpoints

func (pool *Pool) GetAllEndpoints() []*Client

func (*Pool) GetBlockCache

func (pool *Pool) GetBlockCache() *BlockCache

func (*Pool) GetCanonicalFork

func (pool *Pool) GetCanonicalFork(forkDistance int64) *HeadFork

func (*Pool) GetHeadForks

func (pool *Pool) GetHeadForks(forkDistance int64) []*HeadFork

func (*Pool) GetReadyEndpoint

func (pool *Pool) GetReadyEndpoint(clientType ClientType) *Client

func (*Pool) GetReadyEndpoints

func (pool *Pool) GetReadyEndpoints() []*Client

func (*Pool) IsClientReady

func (pool *Pool) IsClientReady(client *Client) bool

type PoolConfig

type PoolConfig struct {
	FollowDistance uint64 `yaml:"followDistance" envconfig:"EXECUTION_POOL_FOLLOW_DISTANCE"`
	ForkDistance   uint64 `yaml:"forkDistance" envconfig:"EXECUTION_POOL_FORK_DISTANCE"`
	SchedulerMode  string `yaml:"schedulerMode" envconfig:"EXECUTION_POOL_SCHEDULER_MODE"`
}

type SchedulerMode

type SchedulerMode uint8
var (
	RoundRobinScheduler SchedulerMode = 1
)

type Subscription

type Subscription[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Subscription[T]) Channel

func (s *Subscription[T]) Channel() <-chan T

func (*Subscription[T]) Unsubscribe

func (s *Subscription[T]) Unsubscribe()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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