Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change data structure order to mirror beacon state property order #1141

Merged
merged 4 commits into from
Jun 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
- [Data structures](#data-structures)
- [Misc dependencies](#misc-dependencies)
- [`Fork`](#fork)
- [`Validator`](#validator)
- [`Crosslink`](#crosslink)
- [`Eth1Data`](#eth1data)
- [`AttestationData`](#attestationdata)
- [`AttestationDataAndCustodyBit`](#attestationdataandcustodybit)
- [`IndexedAttestation`](#indexedattestation)
- [`DepositData`](#depositdata)
- [`BeaconBlockHeader`](#beaconblockheader)
- [`Validator`](#validator)
- [`PendingAttestation`](#pendingattestation)
- [`Eth1Data`](#eth1data)
- [`HistoricalBatch`](#historicalbatch)
- [`DepositData`](#depositdata)
- [`BeaconBlockHeader`](#beaconblockheader)
- [Beacon operations](#beacon-operations)
- [`ProposerSlashing`](#proposerslashing)
- [`AttesterSlashing`](#attesterslashing)
Expand Down Expand Up @@ -275,6 +275,28 @@ class Fork(Container):
epoch: uint64
```

#### `Validator`

```python
class Validator(Container):
# BLS public key
pubkey: Bytes48
# Withdrawal credentials
withdrawal_credentials: Bytes32
# Epoch when became eligible for activation
activation_eligibility_epoch: uint64
# Epoch when validator activated
activation_epoch: uint64
# Epoch when validator exited
exit_epoch: uint64
# Epoch when validator is eligible to withdraw
withdrawable_epoch: uint64
# Was the validator slashed
slashed: bool
# Effective balance
effective_balance: uint64
```

#### `Crosslink`

```python
Expand All @@ -290,18 +312,6 @@ class Crosslink(Container):
data_root: Bytes32
```

#### `Eth1Data`

```python
class Eth1Data(Container):
# Root of the deposit tree
deposit_root: Bytes32
# Total number of deposits
deposit_count: uint64
# Block hash
block_hash: Bytes32
```

#### `AttestationData`

```python
Expand Down Expand Up @@ -342,6 +352,42 @@ class IndexedAttestation(Container):
signature: Bytes96
```

#### `PendingAttestation`

```python
class PendingAttestation(Container):
# Attester aggregation bitfield
aggregation_bitfield: bytes
# Attestation data
data: AttestationData
# Inclusion delay
inclusion_delay: uint64
# Proposer index
proposer_index: uint64
```

#### `Eth1Data`

```python
class Eth1Data(Container):
# Root of the deposit tree
deposit_root: Bytes32
# Total number of deposits
deposit_count: uint64
# Block hash
block_hash: Bytes32
```

#### `HistoricalBatch`

```python
class HistoricalBatch(Container):
# Block roots
block_roots: Vector[Bytes32, SLOTS_PER_HISTORICAL_ROOT]
# State roots
state_roots: Vector[Bytes32, SLOTS_PER_HISTORICAL_ROOT]
```

#### `DepositData`

```python
Expand All @@ -367,52 +413,6 @@ class BeaconBlockHeader(Container):
signature: Bytes96
```

#### `Validator`

```python
class Validator(Container):
# BLS public key
pubkey: Bytes48
# Withdrawal credentials
withdrawal_credentials: Bytes32
# Epoch when became eligible for activation
activation_eligibility_epoch: uint64
# Epoch when validator activated
activation_epoch: uint64
# Epoch when validator exited
exit_epoch: uint64
# Epoch when validator is eligible to withdraw
withdrawable_epoch: uint64
# Was the validator slashed
slashed: bool
# Effective balance
effective_balance: uint64
```

#### `PendingAttestation`

```python
class PendingAttestation(Container):
# Attester aggregation bitfield
aggregation_bitfield: bytes
# Attestation data
data: AttestationData
# Inclusion delay
inclusion_delay: uint64
# Proposer index
proposer_index: uint64
```

#### `HistoricalBatch`

```python
class HistoricalBatch(Container):
# Block roots
block_roots: Vector[Bytes32, SLOTS_PER_HISTORICAL_ROOT]
# State roots
state_roots: Vector[Bytes32, SLOTS_PER_HISTORICAL_ROOT]
```

### Beacon operations

#### `ProposerSlashing`
Expand Down