forkmanager

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const InitialFork = "initialfork"

Variables

This section is empty.

Functions

func GetInstance

func GetInstance() *forkManager

GeInstance returns fork manager singleton instance. Thread safe

Types

type Fork

type Fork struct {
	// Name is name of the fork
	Name string
	// FromBlockNumber indicates the block from which fork becomes enabled
	FromBlockNumber uint64
	// Params are fork consensus parameters
	Params *ForkParams
	// IsActive is false if fork is registered but not activated
	IsActive bool
	// Handlers is a map of all handlers registered for this fork
	Handlers map[HandlerDesc]HandlerContainer
}

Fork structure defines one fork

type ForkParams

type ForkParams struct {
	// MaxValidatorSetSize indicates the maximum size of validator set
	MaxValidatorSetSize *uint64 `json:"maxValidatorSetSize,omitempty"`

	// EpochSize is size of epoch
	EpochSize *uint64 `json:"epochSize,omitempty"`

	// SprintSize is size of sprint
	SprintSize *uint64 `json:"sprintSize,omitempty"`

	// BlockTime is target frequency of blocks production
	BlockTime *common.Duration `json:"blockTime,omitempty"`

	// BlockTimeDrift defines the time slot in which a new block can be created
	BlockTimeDrift *uint64 `json:"blockTimeDrift,omitempty"`
}

ForkParams hard-coded fork params

func (*ForkParams) Copy

func (fp *ForkParams) Copy() *ForkParams

Copy creates a deep copy of ForkParams

type HandlerContainer

type HandlerContainer struct {
	// ID represents an auto-incremented identifier for a handler
	ID uint
	// Handler represents an actual event handler
	Handler interface{}
}

HandlerContainer keeps id of a handler and actual handler

type HandlerDesc

type HandlerDesc string

HandlerDesc gives description for the handler eq: "extra", "proposer_calculator", etc

Jump to

Keyboard shortcuts

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