mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-19 14:04:25 +00:00
name (slot, shard) union wrapper ShardWork
This commit is contained in:
parent
72215412fa
commit
3665dbea8b
@ -33,7 +33,7 @@
|
|||||||
- [`ShardBlobReference`](#shardblobreference)
|
- [`ShardBlobReference`](#shardblobreference)
|
||||||
- [`SignedShardBlobReference`](#signedshardblobreference)
|
- [`SignedShardBlobReference`](#signedshardblobreference)
|
||||||
- [`ShardProposerSlashing`](#shardproposerslashing)
|
- [`ShardProposerSlashing`](#shardproposerslashing)
|
||||||
- [`ShardCommitteeWork`](#shardcommitteework)
|
- [`ShardWork`](#shardwork)
|
||||||
- [Helper functions](#helper-functions)
|
- [Helper functions](#helper-functions)
|
||||||
- [Misc](#misc-2)
|
- [Misc](#misc-2)
|
||||||
- [`next_power_of_two`](#next_power_of_two)
|
- [`next_power_of_two`](#next_power_of_two)
|
||||||
@ -185,7 +185,7 @@ class BeaconState(merge.BeaconState): # [extends The Merge state]
|
|||||||
current_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
|
current_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
|
||||||
# [New fields]
|
# [New fields]
|
||||||
# A ring buffer of the latest slots, with information per active shard.
|
# A ring buffer of the latest slots, with information per active shard.
|
||||||
shard_buffer: Vector[List[ShardCommitteeWork, MAX_SHARDS], SHARD_STATE_MEMORY_SLOTS]
|
shard_buffer: Vector[List[ShardWork, MAX_SHARDS], SHARD_STATE_MEMORY_SLOTS]
|
||||||
shard_gasprice: uint64
|
shard_gasprice: uint64
|
||||||
current_epoch_start_shard: Shard
|
current_epoch_start_shard: Shard
|
||||||
```
|
```
|
||||||
@ -282,7 +282,7 @@ class ShardProposerSlashing(Container):
|
|||||||
signed_reference_2: SignedShardBlobReference
|
signed_reference_2: SignedShardBlobReference
|
||||||
```
|
```
|
||||||
|
|
||||||
### `ShardCommitteeWork`
|
### `ShardWork`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
class ShardWork(Container):
|
class ShardWork(Container):
|
||||||
@ -765,7 +765,7 @@ def reset_pending_headers(state: BeaconState) -> None:
|
|||||||
buffer_index = slot % SHARD_STATE_MEMORY_SLOTS
|
buffer_index = slot % SHARD_STATE_MEMORY_SLOTS
|
||||||
|
|
||||||
# Reset the shard work tracking
|
# Reset the shard work tracking
|
||||||
state.shard_buffer[buffer_index] = [ShardCommitteeWork() for _ in range(active_shards)]
|
state.shard_buffer[buffer_index] = [ShardWork() for _ in range(active_shards)]
|
||||||
|
|
||||||
start_shard = get_start_shard(state, slot)
|
start_shard = get_start_shard(state, slot)
|
||||||
for shard_index in range(state.shard_buffer[buffer_index]):
|
for shard_index in range(state.shard_buffer[buffer_index]):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user