mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Use bulk duties request in validator client
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
use crate::response_builder::ResponseBuilder;
|
use crate::response_builder::ResponseBuilder;
|
||||||
use crate::ApiResult;
|
use crate::ApiResult;
|
||||||
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
|
||||||
use hyper::{Body, Request};
|
use hyper::{Body, Request};
|
||||||
use std::sync::Arc;
|
|
||||||
use version;
|
use version;
|
||||||
|
|
||||||
/// Read the version string from the current Lighthouse build.
|
/// Read the version string from the current Lighthouse build.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use std::collections::HashMap;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use tokio::timer::Interval;
|
use tokio::timer::Interval;
|
||||||
use types::{ChainSpec, CommitteeIndex, Epoch, EthSpec, PublicKey, Slot};
|
use types::{ChainSpec, Epoch, EthSpec, PublicKey, Slot};
|
||||||
|
|
||||||
/// Delay this period of time after the slot starts. This allows the node to process the new slot.
|
/// Delay this period of time after the slot starts. This allows the node to process the new slot.
|
||||||
const TIME_DELAY_FROM_SLOT: Duration = Duration::from_millis(100);
|
const TIME_DELAY_FROM_SLOT: Duration = Duration::from_millis(100);
|
||||||
@@ -296,7 +296,7 @@ impl<T: SlotClock + Clone + 'static, E: EthSpec> DutiesService<T, E> {
|
|||||||
.beacon_node
|
.beacon_node
|
||||||
.http
|
.http
|
||||||
.validator()
|
.validator()
|
||||||
.get_duties(epoch, pubkeys.as_slice())
|
.get_duties_bulk(epoch, pubkeys.as_slice())
|
||||||
.map(move |all_duties| (epoch, all_duties))
|
.map(move |all_duties| (epoch, all_duties))
|
||||||
.map_err(move |e| format!("Failed to get duties for epoch {}: {:?}", epoch, e))
|
.map_err(move |e| format!("Failed to get duties for epoch {}: {:?}", epoch, e))
|
||||||
.map(move |(epoch, all_duties)| {
|
.map(move |(epoch, all_duties)| {
|
||||||
|
|||||||
Reference in New Issue
Block a user