simulator

package
v0.0.0-...-3bf8caa Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0, GPL-3.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameters

type Parameters struct {
	SecondsPerSlot         uint64
	SlotsPerEpoch          primitives.Slot
	AggregationPercent     float64
	ProposerSlashingProbab float64
	AttesterSlashingProbab float64
	NumValidators          uint64
	NumEpochs              uint64
}

Parameters for a slasher simulator.

func DefaultParams

func DefaultParams() *Parameters

DefaultParams for launching a slasher simulator.

type ServiceConfig

type ServiceConfig struct {
	Params                      *Parameters
	Database                    db.SlasherDatabase
	StateNotifier               statefeed.Notifier
	AttestationStateFetcher     blockchain.AttestationStateFetcher
	HeadStateFetcher            blockchain.HeadFetcher
	StateGen                    stategen.StateManager
	SlashingsPool               slashings.PoolManager
	PrivateKeysByValidatorIndex map[primitives.ValidatorIndex]bls.SecretKey
	SyncChecker                 sync.Checker
	ClockWaiter                 startup.ClockWaiter
	ClockSetter                 startup.ClockSetter
}

ServiceConfig for the simulator.

type Simulator

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

Simulator defines a struct which can launch a slasher simulation at scale using configuration parameters.

func New

func New(ctx context.Context, srvConfig *ServiceConfig) (*Simulator, error)

New initializes a slasher simulator from a beacon database and configuration parameters.

func (*Simulator) Start

func (s *Simulator) Start()

Start a simulator.

func (*Simulator) Stop

func (s *Simulator) Stop() error

Stop the simulator.

Jump to

Keyboard shortcuts

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