2019-02-19 23:35:02 +00:00
|
|
|
# beacon_chain
|
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
import
|
|
|
|
options, sequtils, unittest,
|
|
|
|
./testutil,
|
|
|
|
../beacon_chain/spec/[beaconstate, crypto, datatypes, digest, helpers, validator],
|
2019-03-12 15:03:14 +00:00
|
|
|
../beacon_chain/[beacon_node_types, attestation_pool, block_pool, extras, state_transition, ssz]
|
2019-02-19 23:35:02 +00:00
|
|
|
|
2019-06-03 08:26:38 +00:00
|
|
|
template withPool(body: untyped) =
|
|
|
|
mixin genState, genBlock
|
|
|
|
|
|
|
|
var
|
|
|
|
blockPool {.inject.} = BlockPool.init(makeTestDB(genState, genBlock))
|
|
|
|
pool {.inject.} = AttestationPool.init(blockPool)
|
|
|
|
state {.inject.} = loadTailState(blockPool)
|
|
|
|
# Slot 0 is a finalized slot - won't be making attestations for it..
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, state.data.data.slot + 1)
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
body
|
|
|
|
|
2019-05-27 12:48:13 +00:00
|
|
|
suite "Attestation pool processing" & preset():
|
2019-02-19 23:35:02 +00:00
|
|
|
## For now just test that we can compile and execute block processing with
|
|
|
|
## mock data.
|
|
|
|
|
2019-06-03 08:26:38 +00:00
|
|
|
# Genesis state that results in 2 members per committee
|
2019-03-13 22:59:20 +00:00
|
|
|
let
|
2019-07-10 12:23:02 +00:00
|
|
|
genState = initialize_beacon_state_from_eth1(
|
2019-09-02 10:31:14 +00:00
|
|
|
Eth2Digest(), 0,
|
|
|
|
makeInitialDeposits(SLOTS_PER_EPOCH * 2, {skipValidation}),
|
|
|
|
{skipValidation})
|
2019-02-28 21:21:29 +00:00
|
|
|
genBlock = get_initial_beacon_block(genState)
|
|
|
|
|
2019-05-27 12:48:13 +00:00
|
|
|
test "Can add and retrieve simple attestation" & preset():
|
2019-06-24 09:21:56 +00:00
|
|
|
var cache = get_empty_per_epoch_cache()
|
2019-06-03 08:26:38 +00:00
|
|
|
withPool:
|
|
|
|
let
|
|
|
|
# Create an attestation for slot 1!
|
2019-06-24 09:21:56 +00:00
|
|
|
crosslink_committee = get_crosslink_committee(state.data.data,
|
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* rm more transfer-related code and tests; rm more unnecessary strutils imports
* rm remaining unused imports
* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls
* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)
* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD
* update domain types to 0.9.0
* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0
* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0
* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0
* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0
* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests
* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
|
|
|
compute_epoch_at_slot(state.data.data.slot), 1, cache)
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, crosslink_committee[0])
|
2019-02-19 23:35:02 +00:00
|
|
|
|
2019-08-19 16:41:13 +00:00
|
|
|
pool.add(state.data.data, state.blck, attestation)
|
2019-02-19 23:35:02 +00:00
|
|
|
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, MIN_ATTESTATION_INCLUSION_DELAY.Slot) # minus 1?
|
2019-02-19 23:35:02 +00:00
|
|
|
|
2019-06-03 08:26:38 +00:00
|
|
|
let attestations = pool.getAttestationsForBlock(
|
|
|
|
state.data.data, state.data.data.slot + 1)
|
2019-02-19 23:35:02 +00:00
|
|
|
|
2019-06-03 08:26:38 +00:00
|
|
|
check:
|
|
|
|
attestations.len == 1
|
2019-02-21 04:42:17 +00:00
|
|
|
|
2019-05-27 12:48:13 +00:00
|
|
|
test "Attestations may arrive in any order" & preset():
|
2019-06-24 09:21:56 +00:00
|
|
|
var cache = get_empty_per_epoch_cache()
|
2019-06-03 08:26:38 +00:00
|
|
|
withPool:
|
|
|
|
let
|
|
|
|
# Create an attestation for slot 1!
|
2019-06-24 09:21:56 +00:00
|
|
|
cc0 = get_crosslink_committee(state.data.data,
|
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* rm more transfer-related code and tests; rm more unnecessary strutils imports
* rm remaining unused imports
* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls
* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)
* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD
* update domain types to 0.9.0
* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0
* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0
* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0
* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0
* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests
* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
|
|
|
compute_epoch_at_slot(state.data.data.slot), 1, cache)
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation0 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[0])
|
2019-06-03 08:26:38 +00:00
|
|
|
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, state.data.data.slot + 1)
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
let
|
2019-06-24 09:21:56 +00:00
|
|
|
cc1 = get_crosslink_committee(state.data.data,
|
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* rm more transfer-related code and tests; rm more unnecessary strutils imports
* rm remaining unused imports
* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls
* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)
* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD
* update domain types to 0.9.0
* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0
* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0
* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0
* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0
* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests
* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
|
|
|
compute_epoch_at_slot(state.data.data.slot), 2, cache)
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation1 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc1[0])
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
# test reverse order
|
2019-08-19 16:41:13 +00:00
|
|
|
pool.add(state.data.data, state.blck, attestation1)
|
|
|
|
pool.add(state.data.data, state.blck, attestation0)
|
2019-06-03 08:26:38 +00:00
|
|
|
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, MIN_ATTESTATION_INCLUSION_DELAY.Slot) # minus 1?
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
let attestations = pool.getAttestationsForBlock(
|
|
|
|
state.data.data, state.data.data.slot + 1)
|
|
|
|
|
|
|
|
check:
|
|
|
|
attestations.len == 1
|
|
|
|
|
|
|
|
test "Attestations should be combined" & preset():
|
2019-06-24 09:21:56 +00:00
|
|
|
var cache = get_empty_per_epoch_cache()
|
2019-06-03 08:26:38 +00:00
|
|
|
withPool:
|
|
|
|
let
|
|
|
|
# Create an attestation for slot 1!
|
2019-06-24 09:21:56 +00:00
|
|
|
cc0 = get_crosslink_committee(state.data.data,
|
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* rm more transfer-related code and tests; rm more unnecessary strutils imports
* rm remaining unused imports
* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls
* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)
* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD
* update domain types to 0.9.0
* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0
* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0
* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0
* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0
* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests
* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
|
|
|
compute_epoch_at_slot(state.data.data.slot), 1, cache)
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation0 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[0])
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation1 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[1])
|
2019-06-03 08:26:38 +00:00
|
|
|
|
2019-08-19 16:41:13 +00:00
|
|
|
pool.add(state.data.data, state.blck, attestation0)
|
|
|
|
pool.add(state.data.data, state.blck, attestation1)
|
2019-06-03 08:26:38 +00:00
|
|
|
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, MIN_ATTESTATION_INCLUSION_DELAY.Slot) # minus 1?
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
let attestations = pool.getAttestationsForBlock(
|
|
|
|
state.data.data, state.data.data.slot + 1)
|
|
|
|
|
|
|
|
check:
|
|
|
|
attestations.len == 1
|
|
|
|
|
|
|
|
test "Attestations may overlap, bigger first" & preset():
|
2019-06-24 09:21:56 +00:00
|
|
|
var cache = get_empty_per_epoch_cache()
|
2019-06-03 08:26:38 +00:00
|
|
|
withPool:
|
|
|
|
|
|
|
|
var
|
|
|
|
# Create an attestation for slot 1!
|
2019-06-24 09:21:56 +00:00
|
|
|
cc0 = get_crosslink_committee(state.data.data,
|
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* rm more transfer-related code and tests; rm more unnecessary strutils imports
* rm remaining unused imports
* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls
* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)
* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD
* update domain types to 0.9.0
* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0
* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0
* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0
* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0
* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests
* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
|
|
|
compute_epoch_at_slot(state.data.data.slot), 1, cache)
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation0 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[0])
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation1 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[1])
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
attestation0.combine(attestation1, {skipValidation})
|
|
|
|
|
2019-08-19 16:41:13 +00:00
|
|
|
pool.add(state.data.data, state.blck, attestation0)
|
|
|
|
pool.add(state.data.data, state.blck, attestation1)
|
2019-06-03 08:26:38 +00:00
|
|
|
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, MIN_ATTESTATION_INCLUSION_DELAY.Slot) # minus 1?
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
let attestations = pool.getAttestationsForBlock(
|
|
|
|
state.data.data, state.data.data.slot + 1)
|
|
|
|
|
|
|
|
check:
|
|
|
|
attestations.len == 1
|
|
|
|
|
|
|
|
test "Attestations may overlap, smaller first" & preset():
|
2019-06-24 09:21:56 +00:00
|
|
|
var cache = get_empty_per_epoch_cache()
|
2019-06-03 08:26:38 +00:00
|
|
|
withPool:
|
|
|
|
var
|
|
|
|
# Create an attestation for slot 1!
|
2019-06-24 09:21:56 +00:00
|
|
|
cc0 = get_crosslink_committee(state.data.data,
|
initial 0.9.0 spec sync (#509)
* rename compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* remove some unnecessary imports; remove some crosslink-related code and tests; complete renaming of compute_epoch_of_slot(...) to compute_epoch_at_slot(...)
* rm more transfer-related code and tests; rm more unnecessary strutils imports
* rm remaining unused imports
* remove useless get_empty_per_epoch_cache(...)/compute_start_slot_of_epoch(...) calls
* rename compute_start_slot_of_epoch(...) to compute_start_slot_at_epoch(...)
* rename ACTIVATION_EXIT_DELAY to MAX_SEED_LOOKAHEAD
* update domain types to 0.9.0
* mark AttesterSlashing, IndexedAttestation, AttestationDataAndCustodyBit, DepositData, BeaconBlockHeader, Fork, integer_squareroot(...), and process_voluntary_exit(...) as 0.9.0
* mark increase_balance(...), decrease_balance(...), get_block_root(...), CheckPoint, Deposit, PendingAttestation, HistoricalBatch, is_active_validator(...), and is_slashable_attestation_data(...) as 0.9.0
* mark compute_activation_exit_epoch(...), bls_verify(...), Validator, get_active_validator_indices(...), get_current_epoch(...), get_total_active_balance(...), and get_previous_epoch(...) as 0.9.0
* mark get_block_root_at_slot(...), ProposerSlashing, get_domain(...), VoluntaryExit, mainnet preset Gwei values, minimal preset max operations, process_block_header(...), and is_slashable_validator(...) as 0.9.0
* mark makeWithdrawalCredentials(...), get_validator_churn_limit(...), get_total_balance(...), is_valid_indexed_attestation(...), bls_aggregate_pubkeys(...), initial genesis value/constants, Attestation, get_randao_mix(...), mainnet preset max operations per block constants, minimal preset Gwei values and time parameters, process_eth1_data(...), get_shuffled_seq(...), compute_committee(...), and process_slots(...) as 0.9.0; partially update get_indexed_attestation(...) to 0.9.0 by removing crosslink refs and associated tests
* mark initiate_validator_exit(...), process_registry_updates(...), BeaconBlock, Eth1Data, compute_domain(...), process_randao(...), process_attester_slashing(...), get_base_reward(...), and process_slot(...) as 0.9.0
2019-10-30 19:41:19 +00:00
|
|
|
compute_epoch_at_slot(state.data.data.slot), 1, cache)
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation0 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[0])
|
2019-06-03 08:26:38 +00:00
|
|
|
attestation1 = makeAttestation(
|
2019-06-24 09:21:56 +00:00
|
|
|
state.data.data, state.blck.root, cc0[1])
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
attestation0.combine(attestation1, {skipValidation})
|
|
|
|
|
2019-08-19 16:41:13 +00:00
|
|
|
pool.add(state.data.data, state.blck, attestation1)
|
|
|
|
pool.add(state.data.data, state.blck, attestation0)
|
2019-06-03 08:26:38 +00:00
|
|
|
|
2019-07-15 21:10:40 +00:00
|
|
|
process_slots(state.data, MIN_ATTESTATION_INCLUSION_DELAY.Slot) # minus 1?
|
2019-06-03 08:26:38 +00:00
|
|
|
|
|
|
|
let attestations = pool.getAttestationsForBlock(
|
|
|
|
state.data.data, state.data.data.slot + 1)
|
|
|
|
|
|
|
|
check:
|
|
|
|
attestations.len == 1
|