diff --git a/beacon_chain/spec/crypto.nim b/beacon_chain/spec/crypto.nim index df13b6275..58abd4ae0 100644 --- a/beacon_chain/spec/crypto.nim +++ b/beacon_chain/spec/crypto.nim @@ -181,7 +181,7 @@ func bls_verify*( # TODO bls_verify_multiple(...) used to have this workaround, and now it # lives here. No matter the signature, there's also no meaningful way to # verify it -- it's a kind of vacuous truth. No pubkey/sig pairs. - if pubkey == ValidatorPubKey(): + if pubkey == default(ValidatorPubKey): return true sig.blsValue.verify(msg, domain, pubkey.blsValue) diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index e41c59825..d57003ec1 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -245,8 +245,8 @@ proc process_attester_slashing*( ## verify_indexed_attestation, but go by spec unless there ## is compelling perf evidence otherwise. for index in sorted(toSeq(intersection( - toSet(attestation_1.attesting_indices), - toSet(attestation_2.attesting_indices)).items), system.cmp): + toHashSet(attestation_1.attesting_indices), + toHashSet(attestation_2.attesting_indices)).items), system.cmp): if is_slashable_validator( state.validators[index.int], get_current_epoch(state)): slash_validator(state, index.ValidatorIndex, stateCache) @@ -384,9 +384,9 @@ proc processBlock*( # Adds nontrivial additional computation, but only does so when metrics # enabled. - beacon_current_live_validators.set(toSet( + beacon_current_live_validators.set(toHashSet( mapIt(state.current_epoch_attestations, it.proposerIndex)).len.int64) - beacon_previous_live_validators.set(toSet( + beacon_previous_live_validators.set(toHashSet( mapIt(state.previous_epoch_attestations, it.proposerIndex)).len.int64) if not process_block_header(state, blck, flags, stateCache): diff --git a/beacon_chain/spec/state_transition_epoch.nim b/beacon_chain/spec/state_transition_epoch.nim index 184d3ae50..e97267cb0 100644 --- a/beacon_chain/spec/state_transition_epoch.nim +++ b/beacon_chain/spec/state_transition_epoch.nim @@ -128,7 +128,7 @@ proc process_justification_and_finalization*( # This is a somewhat expensive approach let active_validator_indices = - toSet(mapIt( + toHashSet(mapIt( get_active_validator_indices(state, get_current_epoch(state)), it.int)) let matching_target_attestations_previous = @@ -147,11 +147,11 @@ proc process_justification_and_finalization*( trace "Non-attesting indices in previous epoch", missing_all_validators= difference(active_validator_indices, - toSet(mapIt(get_attesting_indices(state, + toHashSet(mapIt(get_attesting_indices(state, matching_target_attestations_previous, stateCache), it.int))), missing_unslashed_validators= difference(active_validator_indices, - toSet(mapIt(get_unslashed_attesting_indices(state, + toHashSet(mapIt(get_unslashed_attesting_indices(state, matching_target_attestations_previous, stateCache), it.int))), prev_attestations_len=len(state.previous_epoch_attestations), cur_attestations_len=len(state.current_epoch_attestations),