mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 04:04:19 +00:00
Update 0_beacon-chain.md
This commit is contained in:
parent
1141467349
commit
de60533d72
@ -34,6 +34,7 @@
|
|||||||
- [`BeaconBlockHeader`](#beaconblockheader)
|
- [`BeaconBlockHeader`](#beaconblockheader)
|
||||||
- [`Validator`](#validator)
|
- [`Validator`](#validator)
|
||||||
- [`PendingAttestation`](#pendingattestation)
|
- [`PendingAttestation`](#pendingattestation)
|
||||||
|
- [`HistoricalBatch`](#historicalbatch)
|
||||||
- [Beacon transactions](#beacon-transactions)
|
- [Beacon transactions](#beacon-transactions)
|
||||||
- [`ProposerSlashing`](#proposerslashing)
|
- [`ProposerSlashing`](#proposerslashing)
|
||||||
- [`AttesterSlashing`](#attesterslashing)
|
- [`AttesterSlashing`](#attesterslashing)
|
||||||
@ -452,6 +453,17 @@ The types are defined topologically to aid in facilitating an executable version
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `HistoricalBatch`
|
||||||
|
|
||||||
|
```python
|
||||||
|
{
|
||||||
|
// Block roots
|
||||||
|
'block_roots': ['bytes32', SLOTS_PER_HISTORICAL_ROOT],
|
||||||
|
// State roots
|
||||||
|
'state_roots': ['bytes32', SLOTS_PER_HISTORICAL_ROOT],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Beacon transactions
|
### Beacon transactions
|
||||||
|
|
||||||
#### `ProposerSlashing`
|
#### `ProposerSlashing`
|
||||||
@ -2191,7 +2203,11 @@ def finish_epoch_update(state: BeaconState) -> None:
|
|||||||
state.latest_randao_mixes[next_epoch % LATEST_RANDAO_MIXES_LENGTH] = get_randao_mix(state, current_epoch)
|
state.latest_randao_mixes[next_epoch % LATEST_RANDAO_MIXES_LENGTH] = get_randao_mix(state, current_epoch)
|
||||||
# Set historical root accumulator
|
# Set historical root accumulator
|
||||||
if next_epoch % (SLOTS_PER_HISTORICAL_ROOT // SLOTS_PER_EPOCH) == 0:
|
if next_epoch % (SLOTS_PER_HISTORICAL_ROOT // SLOTS_PER_EPOCH) == 0:
|
||||||
state.historical_roots.append(hash_tree_root(state.latest_block_roots + state.latest_state_roots))
|
historical_batch = HistoricalBatch(
|
||||||
|
block_roots=state.latest_block_roots,
|
||||||
|
state_roots=state.latest_state_roots,
|
||||||
|
)
|
||||||
|
state.historical_roots.append(hash_tree_root(historical_batch))
|
||||||
# Rotate current/previous epoch attestations
|
# Rotate current/previous epoch attestations
|
||||||
state.previous_epoch_attestations = state.current_epoch_attestations
|
state.previous_epoch_attestations = state.current_epoch_attestations
|
||||||
state.current_epoch_attestations = []
|
state.current_epoch_attestations = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user