backend

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

type Metrics

type Metrics interface {
	CacheAdd(chainID types.ChainID, label string, cacheSize int, evicted bool)
	CacheGet(chainID types.ChainID, label string, hit bool)

	RecordDBEntryCount(chainID types.ChainID, count int64)
	RecordDBSearchEntriesRead(chainID types.ChainID, count int64)
}

type MockBackend

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

func NewMockBackend

func NewMockBackend() *MockBackend

func (*MockBackend) CheckBlock

func (m *MockBackend) CheckBlock(chainID *hexutil.U256, blockHash common.Hash, blockNumber hexutil.Uint64) (types.SafetyLevel, error)

func (*MockBackend) CheckMessage

func (m *MockBackend) CheckMessage(identifier types.Identifier, payloadHash common.Hash) (types.SafetyLevel, error)

func (*MockBackend) CheckMessages added in v1.9.1

func (m *MockBackend) CheckMessages(messages []types.Message, minSafety types.SafetyLevel) error

func (*MockBackend) Close

func (m *MockBackend) Close() error

func (*MockBackend) Start

func (m *MockBackend) Start(ctx context.Context) error

func (*MockBackend) Stop

func (m *MockBackend) Stop(ctx context.Context) error

type SupervisorBackend

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

func NewSupervisorBackend

func NewSupervisorBackend(ctx context.Context, logger log.Logger, m Metrics, cfg *config.Config) (*SupervisorBackend, error)

func (*SupervisorBackend) CheckBlock

func (su *SupervisorBackend) CheckBlock(chainID *hexutil.U256, blockHash common.Hash, blockNumber hexutil.Uint64) (types.SafetyLevel, error)

CheckBlock checks if the block is safe according to the safety level The block is considered safe if all logs in the block are safe this is decided by finding the last log in the block and

func (*SupervisorBackend) CheckMessage

func (su *SupervisorBackend) CheckMessage(identifier types.Identifier, payloadHash common.Hash) (types.SafetyLevel, error)

func (*SupervisorBackend) CheckMessages added in v1.9.1

func (su *SupervisorBackend) CheckMessages(
	messages []types.Message,
	minSafety types.SafetyLevel) error

func (*SupervisorBackend) Close

func (su *SupervisorBackend) Close() error

func (*SupervisorBackend) Start

func (su *SupervisorBackend) Start(ctx context.Context) error

func (*SupervisorBackend) Stop

func (su *SupervisorBackend) Stop(ctx context.Context) error

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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