config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const UnitInCoin = 100000000

UnitInCoin is the number of base units in 1 coin.

Variables

View Source
var LocalnetConfig = Config{
	ShardCount:                         32,
	TargetCommitteeSize:                4,
	EjectionBalance:                    16,
	MaxBalanceChurnQuotient:            32,
	BeaconShardNumber:                  18446744073709551615,
	BLSWithdrawalPrefixByte:            '\x00',
	MaxCasperVotes:                     1024,
	LatestBlockRootsLength:             8192,
	InitialForkVersion:                 0,
	InitialSlotNumber:                  0,
	SlotDuration:                       4,
	EpochLength:                        8,
	MinAttestationInclusionDelay:       2,
	CollectivePenaltyCalculationPeriod: 1048576,
	ZeroBalanceValidatorTTL:            4194304,
	BaseRewardQuotient:                 1024,
	WhistleblowerRewardQuotient:        512,
	IncluderRewardQuotient:             8,
	InactivityPenaltyQuotient:          17179869184,
	MaxProposerSlashings:               16,
	MaxCasperSlashings:                 16,
	MaxAttestations:                    128,
	MaxDeposits:                        16,
	MaxExits:                           16,
	MaxDeposit:                         64 * UnitInCoin,
	MinDeposit:                         2 * UnitInCoin,
}

LocalnetConfig is the config used for testing the blockchain locally

View Source
var MainNetConfig = Config{
	ShardCount:                         64,
	TargetCommitteeSize:                3,
	EjectionBalance:                    16,
	MaxBalanceChurnQuotient:            32,
	BeaconShardNumber:                  18446744073709551615,
	BLSWithdrawalPrefixByte:            '\x00',
	MaxCasperVotes:                     1024,
	LatestBlockRootsLength:             8192,
	InitialForkVersion:                 0,
	InitialSlotNumber:                  0,
	SlotDuration:                       7,
	EpochLength:                        32,
	MinAttestationInclusionDelay:       4,
	CollectivePenaltyCalculationPeriod: 1048576,
	ZeroBalanceValidatorTTL:            4194304,
	BaseRewardQuotient:                 1024,
	WhistleblowerRewardQuotient:        512,
	IncluderRewardQuotient:             8,
	InactivityPenaltyQuotient:          17179869184,
	MaxProposerSlashings:               16,
	MaxCasperSlashings:                 16,
	MaxAttestations:                    128,
	MaxDeposits:                        16,
	MaxExits:                           16,
	MaxDeposit:                         64 * UnitInCoin,
	MinDeposit:                         2 * UnitInCoin,
}

MainNetConfig is the config used on the mainnet

View Source
var NetworkIDs = map[string]Config{
	"localnet": LocalnetConfig,
	"regtest":  RegtestConfig,
	"testnet":  MainNetConfig,
}

NetworkIDs maps a network ID string to the corresponding config.

View Source
var RegtestConfig = Config{
	ShardCount:                         4,
	TargetCommitteeSize:                4,
	EjectionBalance:                    16,
	MaxBalanceChurnQuotient:            32,
	BeaconShardNumber:                  18446744073709551615,
	BLSWithdrawalPrefixByte:            '\x00',
	MaxCasperVotes:                     1024,
	LatestBlockRootsLength:             8192,
	InitialForkVersion:                 0,
	InitialSlotNumber:                  0,
	SlotDuration:                       1,
	EpochLength:                        4,
	MinAttestationInclusionDelay:       0,
	CollectivePenaltyCalculationPeriod: 1048576,
	ZeroBalanceValidatorTTL:            4194304,
	BaseRewardQuotient:                 1024,
	WhistleblowerRewardQuotient:        512,
	IncluderRewardQuotient:             8,
	InactivityPenaltyQuotient:          17179869184,
	MaxProposerSlashings:               16,
	MaxCasperSlashings:                 16,
	MaxAttestations:                    128,
	MaxDeposits:                        16,
	MaxExits:                           16,
	MaxDeposit:                         64 * UnitInCoin,
	MinDeposit:                         2 * UnitInCoin,
}

RegtestConfig is the config used for unit tests

Functions

func GetBaseDirectory

func GetBaseDirectory(testModeEnabled bool) (path string, err error)

GetBaseDirectory gets the directory for synapse

Types

type Config

type Config struct {
	ShardCount                         int
	TargetCommitteeSize                int
	EjectionBalance                    uint64
	MaxBalanceChurnQuotient            uint64
	BeaconShardNumber                  uint64
	BLSWithdrawalPrefixByte            byte
	MaxCasperVotes                     uint32
	LatestBlockRootsLength             uint64
	LatestRandaoMixesLength            uint64
	InitialForkVersion                 uint64
	InitialSlotNumber                  uint64
	SlotDuration                       uint32
	MinAttestationInclusionDelay       uint64
	EpochLength                        uint64
	CollectivePenaltyCalculationPeriod uint64
	ZeroBalanceValidatorTTL            uint64
	BaseRewardQuotient                 uint64
	WhistleblowerRewardQuotient        uint64
	IncluderRewardQuotient             uint64
	InactivityPenaltyQuotient          uint64
	MaxProposerSlashings               int
	MaxCasperSlashings                 int
	MaxAttestations                    int
	MaxDeposits                        int
	MaxExits                           int
	MaxDeposit                         uint64
	MinDeposit                         uint64
}

Config is the config for the blockchain.

Jump to

Keyboard shortcuts

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