protocolupgrade

package
v0.67.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrimReleaseTag

func TrimReleaseTag(tag string) string

TrimReleaseTag removes 'v' or 'V' at the beginning of the tag if present.

Types

type Broker

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

type Commander

type Commander interface {
	CommandSync(ctx context.Context, cmd txn.Command, payload proto.Message, f func(error), bo *backoff.ExponentialBackOff)
}

type Config

type Config struct {
	Level encoding.LogLevel `long:"log-level"`
}

Config represent the configuration of the collateral engine.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.

type Engine

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

func New

func New(log *logging.Logger, config Config, broker Broker, topology ValidatorTopology, version string) *Engine

func (*Engine) BeginBlock

func (e *Engine) BeginBlock(ctx context.Context, blockHeight uint64)

BeginBlock is called at the beginning of the block, to mark the current block height and check if there are proposals that are accepted/rejected. If there is more than one active proposal that is accepted (unlikely) we choose the one with the earliest upgrade block.

func (*Engine) Cleanup

func (e *Engine) Cleanup(ctx context.Context)

Cleanup is called by the abci before the final snapshot is taken to clear remaining state. It emits events for the accepted and rejected proposals.

func (*Engine) CoreReadyForUpgrade added in v0.65.0

func (e *Engine) CoreReadyForUpgrade() bool

func (*Engine) GetState

func (e *Engine) GetState(k string) ([]byte, []types.StateProvider, error)

func (*Engine) GetUpgradeStatus

func (e *Engine) GetUpgradeStatus() types.UpgradeStatus

GetUpgradeStatus is an RPC call that returns the status of an upgrade.

func (*Engine) IsValidProposal added in v0.55.0

func (e *Engine) IsValidProposal(ctx context.Context, pk string, upgradeBlockHeight uint64, vegaReleaseTag string) error

func (*Engine) Keys

func (e *Engine) Keys() []string

func (*Engine) LoadState

func (e *Engine) LoadState(ctx context.Context, p *types.Payload) ([]types.StateProvider, error)

func (*Engine) Namespace

func (e *Engine) Namespace() types.SnapshotNamespace

func (*Engine) OnRequiredMajorityChanged

func (e *Engine) OnRequiredMajorityChanged(_ context.Context, requiredMajority num.Decimal) error

func (*Engine) SetCoreReadyForUpgrade added in v0.65.0

func (e *Engine) SetCoreReadyForUpgrade()

SetCoreReadyForUpgrade is called by abci after a snapshot has been taken and the core process is ready to wait for data node to process if connected or to be shutdown.

func (*Engine) SetReadyForUpgrade

func (e *Engine) SetReadyForUpgrade()

SetReadyForUpgrade is called by abci after both core and data node has processed all required events before the update. This will modify the RPC API.

func (*Engine) Stopped

func (e *Engine) Stopped() bool

func (*Engine) TimeForUpgrade

func (e *Engine) TimeForUpgrade() bool

TimeForUpgrade is called by abci at the beginning of the block (before calling begin block of the engine) - if a block height for upgrade is set and is equal to the last block's height then return true.

func (*Engine) UpgradeProposal

func (e *Engine) UpgradeProposal(ctx context.Context, pk string, upgradeBlockHeight uint64, vegaReleaseTag string) error

UpgradeProposal records the intention of a validator to upgrade the protocol to a release tag at block height.

type ValidatorTopology

type ValidatorTopology interface {
	IsTendermintValidator(pubkey string) bool
	IsSelfTendermintValidator() bool
	GetVotingPower(pubkey string) int64
	GetTotalVotingPower() int64
}

Jump to

Keyboard shortcuts

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