mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Optimizations, disable val client sync check & additional lcli tools (#834)
* Start adding interop genesis state to lcli * Use more efficient method to generate genesis state * Remove duplicate int_to_bytes32 * Add lcli command to change state genesis time * Add option to allow VC to start with unsynced BN * Set VC to do parallel key loading * Don't default to dummy eth1 backend * Add endpoint to dump operation pool * Add metrics for op pool * Remove state clone for slot notifier * Add mem size approximation for tree hash cache * Avoid cloning tree hash when getting head * Fix failing API tests * Address Michael's comments * Add HashMap::from_par_iter
This commit is contained in:
@@ -6,7 +6,8 @@ use node_test_rig::{
|
||||
testing_client_config, ClientConfig, ClientGenesis, LocalBeaconNode,
|
||||
};
|
||||
use remote_beacon_node::{
|
||||
Committee, HeadBeaconBlock, PublishStatus, ValidatorDuty, ValidatorResponse,
|
||||
Committee, HeadBeaconBlock, PersistedOperationPool, PublishStatus, ValidatorDuty,
|
||||
ValidatorResponse,
|
||||
};
|
||||
use std::convert::TryInto;
|
||||
use std::sync::Arc;
|
||||
@@ -237,10 +238,12 @@ fn check_duties<T: BeaconChainTypes>(
|
||||
"there should be a duty for each validator"
|
||||
);
|
||||
|
||||
let state = beacon_chain
|
||||
let mut state = beacon_chain
|
||||
.state_at_slot(epoch.start_slot(T::EthSpec::slots_per_epoch()))
|
||||
.expect("should get state at slot");
|
||||
|
||||
state.build_all_caches(spec).expect("should build caches");
|
||||
|
||||
validators
|
||||
.iter()
|
||||
.zip(duties.iter())
|
||||
@@ -816,6 +819,29 @@ fn get_fork_choice() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_operation_pool() {
|
||||
let mut env = build_env();
|
||||
|
||||
let node = build_node(&mut env, testing_client_config());
|
||||
let remote_node = node.remote_node().expect("should produce remote node");
|
||||
|
||||
let result = env
|
||||
.runtime()
|
||||
.block_on(remote_node.http.advanced().get_operation_pool())
|
||||
.expect("should not error when getting fork choice");
|
||||
|
||||
let expected = PersistedOperationPool::from_operation_pool(
|
||||
&node
|
||||
.client
|
||||
.beacon_chain()
|
||||
.expect("node should have chain")
|
||||
.op_pool,
|
||||
);
|
||||
|
||||
assert_eq!(result, expected, "result should be as expected");
|
||||
}
|
||||
|
||||
fn compare_validator_response<T: EthSpec>(
|
||||
state: &BeaconState<T>,
|
||||
response: &ValidatorResponse,
|
||||
|
||||
Reference in New Issue
Block a user