partitions

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestration

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

func NewOrchestration

func NewOrchestration(networkID types.NetworkID, dbFile string, log *slog.Logger) (*Orchestration, error)

NewOrchestration creates new boltDB implementation of shard validator orchestration.

  • dbFile is filename (full path) to the Bolt DB file to use for storage, if the file does not exist it will be created;

func (*Orchestration) AddShardConfig

func (o *Orchestration) AddShardConfig(shardConf *types.PartitionDescriptionRecord) error

AddShardConfig verifies and stores the given shard conf.

Validation rules:

  • The network ID must match
  • The partition ID must match one of the existing partitions
  • The shard ID must be 0x80 (CBOR encoding of the empty bitstring)
  • The new epoch number must be one greater than the current epoch of the only shard in the specified partition
  • The activation round number must be strictly greater than the current round of the only shard in the specified partition
  • The node identifiers must match their authentication keys

func (*Orchestration) Close

func (o *Orchestration) Close() error

func (*Orchestration) NetworkID

func (o *Orchestration) NetworkID() types.NetworkID

func (*Orchestration) ShardConfig

func (o *Orchestration) ShardConfig(partitionID types.PartitionID, shardID types.ShardID, rootRound uint64) (*types.PartitionDescriptionRecord, error)

ShardConfig returns ShardConf for the given root round.

func (*Orchestration) ShardConfigs

ShardConfigs returns shard confs active in the given root round.

type TrustBase

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

func NewPartitionTrustBase

func NewPartitionTrustBase(tb map[string]abcrypto.Verifier) *TrustBase

func (*TrustBase) GetQuorum

func (v *TrustBase) GetQuorum() uint64

GetQuorum calculates and returns minimum number of nodes required for a quorum

func (*TrustBase) GetTotalNodes

func (v *TrustBase) GetTotalNodes() uint64

GetTotalNodes returns total number of registered validator nodes

func (*TrustBase) NodeIDs

func (v *TrustBase) NodeIDs() []string

func (*TrustBase) Verify

func (v *TrustBase) Verify(nodeId string, f func(v abcrypto.Verifier) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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