ethverifier

package
v0.78.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	Send(event events.Event)
	SendBatch(events []events.Event)
}

Broker interface. Do not need to mock (use package broker/mock).

type CallEngine

type CallEngine interface {
	MakeResult(specID string, bytes []byte) (ethcall.Result, error)
	CallSpec(ctx context.Context, id string, atBlock uint64) (ethcall.Result, error)
}

type EthCallEngine

type EthCallEngine interface {
	MakeResult(specID string, bytes []byte) (ethcall.Result, error)
	CallSpec(ctx context.Context, id string, atBlock uint64) (ethcall.Result, error)
	GetEthTime(ctx context.Context, atBlock uint64) (uint64, error)
	GetRequiredConfirmations(specId string) (uint64, error)
	GetInitialTriggerTime(id string) (uint64, error)
	StartAtHeight(height uint64, timestamp uint64)
	Start()
}

type EthL2CallEngines added in v0.74.0

type EthL2CallEngines interface {
	GetOrInstantiate(chainID string) (EthCallEngine, error)
}

type EthereumConfirmations

type EthereumConfirmations interface {
	CheckRequiredConfirmations(block uint64, required uint64) error
	Check(block uint64) error
	GetConfirmations() uint64
}

type L2Clients added in v0.74.0

type L2Clients interface {
	Get(chainID string) (*eth.L2Client, *eth.EthereumConfirmations, bool)
}

type L2Verifiers added in v0.74.0

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

func NewL2Verifiers added in v0.74.0

func NewL2Verifiers(
	log *logging.Logger,
	witness Witness,
	ts TimeService,
	broker Broker,
	oracleBroadcaster OracleDataBroadcaster,
	clients L2Clients,
	callEngines EthL2CallEngines,
	isValidator bool,
) (sv *L2Verifiers)

func (*L2Verifiers) FromProtoSnapshot added in v0.74.0

func (v *L2Verifiers) FromProtoSnapshot()

func (*L2Verifiers) GetState added in v0.74.0

func (s *L2Verifiers) GetState(k string) ([]byte, []types.StateProvider, error)

func (*L2Verifiers) Keys added in v0.74.0

func (s *L2Verifiers) Keys() []string

func (*L2Verifiers) LoadState added in v0.74.0

func (s *L2Verifiers) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)

func (*L2Verifiers) Namespace added in v0.74.0

func (s *L2Verifiers) Namespace() types.SnapshotNamespace

func (*L2Verifiers) OnEthereumL2ConfigsUpdated added in v0.74.0

func (v *L2Verifiers) OnEthereumL2ConfigsUpdated(
	ctx context.Context, ethCfg *types.EthereumL2Configs,
) error

func (*L2Verifiers) OnStateLoaded added in v0.74.0

func (s *L2Verifiers) OnStateLoaded(ctx context.Context) error

func (*L2Verifiers) OnTick added in v0.74.0

func (v *L2Verifiers) OnTick(ctx context.Context, t time.Time)

func (*L2Verifiers) ProcessEthereumContractCallResult added in v0.74.0

func (v *L2Verifiers) ProcessEthereumContractCallResult(callEvent ethcall.ContractCallEvent) error

func (*L2Verifiers) Stopped added in v0.74.0

func (s *L2Verifiers) Stopped() bool

func (*L2Verifiers) ToProtoSnapshot added in v0.74.0

func (v *L2Verifiers) ToProtoSnapshot() []byte

type OracleDataBroadcaster

type OracleDataBroadcaster interface {
	BroadcastData(context.Context, common.Data) error
}

type Result

type Result interface {
	Bytes() []byte
	Values() ([]any, error)
	Normalised() (map[string]string, error)
	PassesFilters() (bool, error)
	HasRequiredConfirmations() bool
}

type TimeService

type TimeService interface {
	GetTimeNow() time.Time
}

TimeService interface.

type Verifier

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

func New

func New(
	log *logging.Logger,
	witness Witness,
	ts TimeService,
	broker Broker,
	oracleBroadcaster OracleDataBroadcaster,
	ethCallEngine EthCallEngine,
	ethConfirmations EthereumConfirmations,
	isValidator bool,
) (sv *Verifier)

func (*Verifier) GetState

func (s *Verifier) GetState(k string) ([]byte, []types.StateProvider, error)

func (*Verifier) Keys

func (s *Verifier) Keys() []string

func (*Verifier) LoadState

func (s *Verifier) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)

func (*Verifier) Namespace

func (s *Verifier) Namespace() types.SnapshotNamespace

func (*Verifier) OnStateLoaded

func (s *Verifier) OnStateLoaded(ctx context.Context) error

func (*Verifier) OnTick

func (s *Verifier) OnTick(ctx context.Context, t time.Time)

func (*Verifier) ProcessEthereumContractCallResult

func (s *Verifier) ProcessEthereumContractCallResult(callEvent ethcall.ContractCallEvent) error

func (*Verifier) Stopped

func (s *Verifier) Stopped() bool

type Witness

type Witness interface {
	StartCheckWithDelay(validators.Resource, func(interface{}, bool), time.Time, int64) error
	RestoreResource(validators.Resource, func(interface{}, bool)) error
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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