mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 13:06:34 +00:00
be specific about which slot we want a sync committee root for
This commit is contained in:
parent
02bc6541d9
commit
4d4f4e89f4
@ -213,7 +213,7 @@ def run_test_full_random_operations(spec, state, rng=Random(2080)):
|
||||
yield 'post', state
|
||||
|
||||
|
||||
def get_random_sync_aggregate(spec, state, fraction_participated=1.0, rng=Random(2099)):
|
||||
def get_random_sync_aggregate(spec, state, slot, fraction_participated=1.0, rng=Random(2099)):
|
||||
committee_indices = compute_committee_indices(spec, state, state.current_sync_committee)
|
||||
participant_count = int(len(committee_indices) * fraction_participated)
|
||||
participant_indices = rng.sample(range(len(committee_indices)), participant_count)
|
||||
@ -224,7 +224,7 @@ def get_random_sync_aggregate(spec, state, fraction_participated=1.0, rng=Random
|
||||
signature = compute_aggregate_sync_committee_signature(
|
||||
spec,
|
||||
state,
|
||||
state.slot - 1,
|
||||
slot,
|
||||
participants,
|
||||
)
|
||||
return spec.SyncAggregate(
|
||||
|
@ -123,7 +123,12 @@ def random_block_altair(spec, state, signed_blocks):
|
||||
block = random_block(spec, state, signed_blocks)
|
||||
fraction_missed = len(signed_blocks) / SYNC_AGGREGATE_PARTICIPATION_BUCKETS
|
||||
fraction_participated = 1.0 - fraction_missed
|
||||
block.body.sync_aggregate = get_random_sync_aggregate(spec, state, fraction_participated=fraction_participated)
|
||||
block.body.sync_aggregate = get_random_sync_aggregate(
|
||||
spec,
|
||||
state,
|
||||
block.slot - 1,
|
||||
fraction_participated=fraction_participated,
|
||||
)
|
||||
return block
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user