types

package
v0.0.0-...-dde17ac Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGenesisStates

func NewGenesisStates() (*ActiveState, *CrystallizedState)

NewGenesisStates initializes a beacon chain with starting parameters.

Types

type ActiveState

type ActiveState struct {
	TotalAttesterDeposits uint64 // TotalAttesterDeposits is the total quantity of wei that attested for the most recent checkpoint.
	AttesterBitfields     []byte // AttesterBitfields represents which validator has attested.
}

ActiveState contains fields of current state of beacon chain, it changes every block.

type AggregateVote

type AggregateVote struct {
	ShardID        uint16      // Shard ID of the voted shard.
	ShardBlockHash common.Hash // ShardBlockHash is the shard block hash of the voted shard.
	SignerBitmask  []byte      // SignerBitmask is the bit mask of every validator that signed.
	AggregateSig   []uint      // AggregateSig is the aggregated signatures of individual shard.
}

AggregateVote contains the fields of aggregate vote in individual shard.

type Block

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

Block defines a beacon chain core primitive.

func NewBlock

func NewBlock(slotNumber uint64) *Block

NewBlock creates a new beacon block given certain arguments.

func NewGenesisBlock

func NewGenesisBlock() *Block

NewGenesisBlock returns the canonical, genesis block for the beacon chain protocol.

func (*Block) Data

func (b *Block) Data() *Data

Data getter makes the block's properties read-only.

type CrosslinkRecord

type CrosslinkRecord struct {
	Epoch uint64      // Epoch records the epoch the crosslink was submitted in.
	Hash  common.Hash // Hash is the block hash.
}

CrosslinkRecord contains the fields of last fully formed crosslink to be submitted into the chain.

type CrystallizedState

type CrystallizedState struct {
	ActiveValidators       []ValidatorRecord // ActiveValidators is the list of active validators.
	QueuedValidators       []ValidatorRecord // QueuedValidators is the list of joined but not yet inducted validators.
	ExitedValidators       []ValidatorRecord // ExitedValidators is the list of removed validators pending withdrawal.
	CurrentShuffling       []uint16          // CurrentShuffling is hhe permutation of validators used to determine who cross-links what shard in this epoch.
	CurrentEpoch           uint64            // CurrentEpoch is the current epoch.
	LastJustifiedEpoch     uint64            // LastJustifiedEpoch is the last justified epoch.
	LastFinalizedEpoch     uint64            // LastFinalizedEpoch is the last finalized epoch.
	Dynasty                uint64            // Dynasty is the current dynasty.
	NextShard              uint16            // NextShard is the next shard that cross-linking assignment will start from.
	CurrentCheckpoint      common.Hash       // CurrentCheckpoint is the current FFG checkpoint.
	CrosslinkRecords       []CrosslinkRecord // CrosslinkRecords records about the most recent crosslink for each shard.
	TotalDeposits          uint              // TotalDeposits is the Total balance of deposits.
	CrosslinkSeed          common.Hash       // CrosslinkSeed is used to select the committees for each shard.
	CrosslinkSeedLastReset uint64            // CrosslinkSeedLastReset is the last epoch the crosslink seed was reset.
}

CrystallizedState contains fields of every epoch state, it changes every epoch.

type Data

type Data struct {
	ParentHash              common.Hash     // ParentHash is the hash of the parent beacon block.
	SlotNumber              uint64          // Slot number is the number a client should check to know when it creates block.
	RandaoReveal            common.Hash     // RandaoReveal is used for Randao commitment reveal.
	AttestationBitmask      []byte          // AttestationBitmask is the bit field of who from the attestation committee participated.
	AttestationAggregateSig []uint          // AttestationAggregateSig is validator's aggregate sig.
	ShardAggregateVotes     []AggregateVote // ShardAggregateVotes is shard aggregate votes.
	MainChainRef            common.Hash     // MainChainRef is the reference to main chain block.
	ActiveStateHash         []byte          // ActiveStateHash is the state that changes every block.
	CrystallizedStateHash   []byte          // CrystallizedStateHash is the state that changes every epoch.
	Timestamp               time.Time
}

Data contains the fields in a beacon chain block.

type PartialCrosslinkRecord

type PartialCrosslinkRecord struct {
	ShardID        uint16      // ShardID is the shard crosslink being made for.
	ShardBlockHash common.Hash // ShardBlockHash is the hash of the block.
	NotaryBitfield []byte      // NotaryBitfield determines which voter has voted.
	AggregateSig   []uint      // AggregateSig is the aggregated signature of all the notaries who voted.
}

PartialCrosslinkRecord contains information about cross links that are being put together during this epoch.

type ValidatorRecord

type ValidatorRecord struct {
	PubKey            enr.Secp256k1  // PubKey is the validator's public key.
	WithdrawalShard   uint16         // WithdrawalShard is the shard balance will be sent to after withdrawal.
	WithdrawalAddress common.Address // WithdrawalAddress is the address balance will be sent to after withdrawal.
	RandaoCommitment  common.Hash    // RandaoCommitment is validator's current RANDAO beacon commitment.
	Balance           uint64         // Balance is validator's current balance.
	SwitchDynasty     uint64         // SwitchDynasty is the dynasty where the validator can (be inducted | be removed | withdraw their balance).
}

ValidatorRecord contains information about a validator

Jump to

Keyboard shortcuts

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