mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Update VC and BN APIs for naive aggregation (#950)
* Refactor `Attestation` production * Add constant * Start refactor for aggregation * Return early when no attesting validators * Refactor into individual functions * Tidy, add comments * Add first draft of NaiveAggregationPool * Further progress on naive aggregation pool * Fix compile errors in VC * Change locking logic for naive pool * Introduce AttesationType * Add pruning, comments * Add MAX_ATTESTATIONS_PER_SLOT restriction * Add pruning based on slot * Update BN for new aggregation fns * Fix test compile errors * Fix failing rest_api test * Move SignedAggregateAndProof into own file * Update docs, fix warning * Tidy some formatting in validator API * Remove T::default_spec from signing * Fix failing rest test * Tidy * Add test, fix bug * Improve naive pool tests * Add max attestations test * Revert changes to the op_pool * Refactor timer
This commit is contained in:
@@ -105,7 +105,7 @@ impl<T: EthSpec> ProductionValidatorClient<T> {
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.into_future()
|
||||
.map_err(|e| format!("Unable to read system time: {:?}", e))
|
||||
.and_then(move |now| {
|
||||
.and_then::<_, Box<dyn Future<Item = _, Error = _> + Send>>(move |now| {
|
||||
let log = log_3.clone();
|
||||
let genesis = Duration::from_secs(genesis_time);
|
||||
|
||||
@@ -114,9 +114,7 @@ impl<T: EthSpec> ProductionValidatorClient<T> {
|
||||
//
|
||||
// If the validator client starts before genesis, it will get errors from
|
||||
// the slot clock.
|
||||
let box_future: Box<dyn Future<Item = _, Error = _> + Send> = if now
|
||||
< genesis
|
||||
{
|
||||
if now < genesis {
|
||||
info!(
|
||||
log,
|
||||
"Starting node prior to genesis";
|
||||
@@ -138,9 +136,7 @@ impl<T: EthSpec> ProductionValidatorClient<T> {
|
||||
);
|
||||
|
||||
Box::new(future::ok((beacon_node, remote_eth2_config, genesis_time)))
|
||||
};
|
||||
|
||||
box_future
|
||||
}
|
||||
})
|
||||
})
|
||||
.and_then(move |(beacon_node, remote_eth2_config, genesis_time)| {
|
||||
|
||||
Reference in New Issue
Block a user