MAX_PERSISTENT_COMMITTEE_SIZE -> TARGET_PERSISTENT_COMMITTEE_SIZE
This commit is contained in:
parent
469f3d84a3
commit
c224af999e
|
@ -66,7 +66,7 @@ We define the following Python custom types for type hinting and readability:
|
||||||
| Name | Value |
|
| Name | Value |
|
||||||
| - | - |
|
| - | - |
|
||||||
| `SHARD_SLOTS_PER_BEACON_SLOT` | `2**1` (= 2) |
|
| `SHARD_SLOTS_PER_BEACON_SLOT` | `2**1` (= 2) |
|
||||||
| `MAX_PERSISTENT_COMMITTEE_SIZE` | `2**7` (= 128) |
|
| `TARGET_PERSISTENT_COMMITTEE_SIZE` | `2**7` (= 128) |
|
||||||
| `SHARD_HEADER_SIZE` | `2**9` (= 512) |
|
| `SHARD_HEADER_SIZE` | `2**9` (= 512) |
|
||||||
| `SHARD_BLOCK_SIZE_TARGET` | `2**14` (= 16,384) |
|
| `SHARD_BLOCK_SIZE_TARGET` | `2**14` (= 16,384) |
|
||||||
| `SHARD_BLOCK_SIZE_LIMIT` | `2**16` (= 65,536) |
|
| `SHARD_BLOCK_SIZE_LIMIT` | `2**16` (= 65,536) |
|
||||||
|
@ -151,7 +151,7 @@ class ShardBlockCore(Container):
|
||||||
data_root: Hash
|
data_root: Hash
|
||||||
state_root: Hash
|
state_root: Hash
|
||||||
total_bytes: uint64
|
total_bytes: uint64
|
||||||
attester_bitfield: Bitvector[MAX_PERSISTENT_COMMITTEE_SIZE * 2]
|
attester_bitfield: Bitvector[TARGET_PERSISTENT_COMMITTEE_SIZE * 2]
|
||||||
```
|
```
|
||||||
|
|
||||||
### `ExtendedShardBlockCore`
|
### `ExtendedShardBlockCore`
|
||||||
|
@ -164,7 +164,7 @@ class ExtendedShardBlockCore(Container):
|
||||||
data: Bytes[SHARD_BLOCK_SIZE_LIMIT - SHARD_HEADER_SIZE]
|
data: Bytes[SHARD_BLOCK_SIZE_LIMIT - SHARD_HEADER_SIZE]
|
||||||
state_root: Hash
|
state_root: Hash
|
||||||
total_bytes: uint64
|
total_bytes: uint64
|
||||||
attester_bitfield: Bitvector[MAX_PERSISTENT_COMMITTEE_SIZE * 2]
|
attester_bitfield: Bitvector[TARGET_PERSISTENT_COMMITTEE_SIZE * 2]
|
||||||
```
|
```
|
||||||
|
|
||||||
### `ShardState`
|
### `ShardState`
|
||||||
|
@ -172,10 +172,10 @@ class ExtendedShardBlockCore(Container):
|
||||||
```python
|
```python
|
||||||
class ShardState(Container):
|
class ShardState(Container):
|
||||||
history_accumulator: Vector[Hash, HISTORY_ACCUMULATOR_VECTOR]
|
history_accumulator: Vector[Hash, HISTORY_ACCUMULATOR_VECTOR]
|
||||||
earlier_committee_rewards: List[uint64, MAX_PERSISTENT_COMMITTEE_SIZE]
|
earlier_committee_rewards: List[uint64, TARGET_PERSISTENT_COMMITTEE_SIZE]
|
||||||
later_committee_rewards: List[uint64, MAX_PERSISTENT_COMMITTEE_SIZE]
|
later_committee_rewards: List[uint64, TARGET_PERSISTENT_COMMITTEE_SIZE]
|
||||||
earlier_committee_fees: List[Gwei, MAX_PERSISTENT_COMMITTEE_SIZE]
|
earlier_committee_fees: List[Gwei, TARGET_PERSISTENT_COMMITTEE_SIZE]
|
||||||
later_committee_fees: List[Gwei, MAX_PERSISTENT_COMMITTEE_SIZE]
|
later_committee_fees: List[Gwei, TARGET_PERSISTENT_COMMITTEE_SIZE]
|
||||||
basefee: Gwei
|
basefee: Gwei
|
||||||
slot: ShardSlot
|
slot: ShardSlot
|
||||||
shard: Shard
|
shard: Shard
|
||||||
|
@ -230,7 +230,7 @@ def get_period_committee(state: BeaconState, epoch: Epoch, shard: Shard) -> Sequ
|
||||||
count=SHARD_COUNT,
|
count=SHARD_COUNT,
|
||||||
)
|
)
|
||||||
|
|
||||||
return full_committee[:MAX_PERSISTENT_COMMITTEE_SIZE]
|
return full_committee[:TARGET_PERSISTENT_COMMITTEE_SIZE]
|
||||||
```
|
```
|
||||||
|
|
||||||
### `get_persistent_committee`
|
### `get_persistent_committee`
|
||||||
|
@ -495,7 +495,7 @@ def shard_block_transition(state: ShardState,
|
||||||
add_reward(state, beacon_state, validator_index, base_reward)
|
add_reward(state, beacon_state, validator_index, base_reward)
|
||||||
attestations += 1
|
attestations += 1
|
||||||
|
|
||||||
for i in range(len(attester_committee), MAX_PERSISTENT_COMMITTEE_SIZE):
|
for i in range(len(attester_committee), TARGET_PERSISTENT_COMMITTEE_SIZE):
|
||||||
assert block.core.attester_bitfield[i] is False or block.core.attester_bitfield[i] == 0 # TODO: FIX Bitvector
|
assert block.core.attester_bitfield[i] is False or block.core.attester_bitfield[i] == 0 # TODO: FIX Bitvector
|
||||||
|
|
||||||
assert bls_verify(
|
assert bls_verify(
|
||||||
|
|
|
@ -57,7 +57,7 @@ def build_empty_shard_block(spec,
|
||||||
attester_committee = spec.get_persistent_committee(beacon_state, shard_state.shard, block.core.slot)
|
attester_committee = spec.get_persistent_committee(beacon_state, shard_state.shard, block.core.slot)
|
||||||
block.core.attester_bitfield = list(
|
block.core.attester_bitfield = list(
|
||||||
(True,) * len(attester_committee) +
|
(True,) * len(attester_committee) +
|
||||||
(False,) * (spec.MAX_PERSISTENT_COMMITTEE_SIZE * 2 - len(attester_committee))
|
(False,) * (spec.TARGET_PERSISTENT_COMMITTEE_SIZE * 2 - len(attester_committee))
|
||||||
)
|
)
|
||||||
block.signatures.attestation_signature = sign_shard_attestation(
|
block.signatures.attestation_signature = sign_shard_attestation(
|
||||||
spec,
|
spec,
|
||||||
|
|
Loading…
Reference in New Issue