Merge pull request #1141 from 0xKiwi/patch-2

Change data structure order to mirror beacon state property order
This commit is contained in:
Danny Ryan 2019-06-05 09:54:09 -06:00 committed by GitHub
commit 6feede7f6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 62 additions and 62 deletions

View File

@ -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)
- [`PendingAttestation`](#pendingattestation)
- [`Eth1Data`](#eth1data)
- [`HistoricalBatch`](#historicalbatch)
- [`DepositData`](#depositdata)
- [`BeaconBlockHeader`](#beaconblockheader)
- [`Validator`](#validator)
- [`PendingAttestation`](#pendingattestation)
- [`HistoricalBatch`](#historicalbatch)
- [Beacon operations](#beacon-operations)
- [`ProposerSlashing`](#proposerslashing)
- [`AttesterSlashing`](#attesterslashing)
@ -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
@ -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
@ -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
@ -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`