-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.k
74 lines (72 loc) · 3.35 KB
/
config.k
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module CONFIG
imports DOMAINS
imports TYPES
/*
class BeaconState(Container):
# Versioning
genesis_time: uint64
slot: Slot
fork: Fork
# History
latest_block_header: BeaconBlockHeader
block_roots: Vector[Root, SLOTS_PER_HISTORICAL_ROOT]
state_roots: Vector[Root, SLOTS_PER_HISTORICAL_ROOT]
historical_roots: List[Root, HISTORICAL_ROOTS_LIMIT]
# Eth1
eth1_data: Eth1Data
eth1_data_votes: List[Eth1Data, SLOTS_PER_ETH1_VOTING_PERIOD]
eth1_deposit_index: uint64
# Registry
validators: List[Validator, VALIDATOR_REGISTRY_LIMIT]
balances: List[Gwei, VALIDATOR_REGISTRY_LIMIT]
# Shuffling
randao_mixes: Vector[Root, EPOCHS_PER_HISTORICAL_VECTOR]
# Slashings
slashings: Vector[Gwei, EPOCHS_PER_SLASHINGS_VECTOR] # Per-epoch sums of slashed effective balances
# Attestations
previous_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
current_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
# Finality
justification_bits: Bitvector[JUSTIFICATION_BITS_LENGTH] # Bit set for every recent justified epoch
previous_justified_checkpoint: Checkpoint # Previous epoch snapshot
current_justified_checkpoint: Checkpoint
finalized_checkpoint: Checkpoint
*/
configuration
<beacon-chain>
<k> $PGM:KItem </k>
<state> //Type BeaconState in python spec.
// Versioning
<genesis-time> 0 </genesis-time>
<slot> 0 </slot>
<fork> .Fork </fork>
// History
<latest-block-header> .BlockHeader </latest-block-header>
<block-roots> .Map </block-roots> //Vector[Root, SLOTS_PER_HISTORICAL_ROOT]
<state-roots> .Map </state-roots> //Vector[Root, SLOTS_PER_HISTORICAL_ROOT]
<historical-roots> .BytesList </historical-roots> //List[Root, HISTORICAL_ROOTS_LIMIT]
// Eth1
<eth1-data> .Eth1Data </eth1-data>
<eth1-data-votes> .Eth1DataList </eth1-data-votes> //List[Eth1Data, SLOTS_PER_ETH1_VOTING_PERIOD]
<eth1-deposit-index> 0 </eth1-deposit-index>
// Registry
<validators> .Map </validators> //List[Validator, VALIDATOR_REGISTRY_LIMIT]
<balances> .Map </balances> //List[Gwei, VALIDATOR_REGISTRY_LIMIT]
// Shuffling
<randao-mixes> .BytesList </randao-mixes> //Vector[Bytes32, EPOCHS_PER_HISTORICAL_VECTOR]
// Slashings
<slashings> .Map </slashings> //Vector[Gwei, EPOCHS_PER_SLASHINGS_VECTOR]
// Attestations
<previous-epoch-attestations> .PendingAttestationList </previous-epoch-attestations>
//List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
<current-epoch-attestations> .PendingAttestationList </current-epoch-attestations>
//List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
// Finality
<justification-bits> .BitList </justification-bits> //Bitvector[JUSTIFICATION_BITS_LENGTH]
<previous-justified-checkpoint> .Checkpoint </previous-justified-checkpoint>
<current-justified-checkpoint> .Checkpoint </current-justified-checkpoint>
<finalized-checkpoint> .Checkpoint </finalized-checkpoint>
</state>
<zerohashes-cache> .Map </zerohashes-cache>
</beacon-chain>
endmodule