mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Fix race condition in the syncing sim (#944)
* Fix race condition in the syncing sim * Update another strategy
This commit is contained in:
@@ -94,7 +94,7 @@ impl<E: EthSpec> LocalNetwork<E> {
|
|||||||
.expect("bootnode must have a network"),
|
.expect("bootnode must have a network"),
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.expect("should have atleast one node");
|
.expect("should have at least one node");
|
||||||
|
|
||||||
let index = self.beacon_nodes.read().len();
|
let index = self.beacon_nodes.read().len();
|
||||||
|
|
||||||
|
|||||||
@@ -94,8 +94,10 @@ pub fn verify_two_nodes_sync<E: EthSpec>(
|
|||||||
// Add beacon nodes
|
// Add beacon nodes
|
||||||
network
|
network
|
||||||
.add_beacon_node(beacon_config.clone())
|
.add_beacon_node(beacon_config.clone())
|
||||||
.join(network.add_beacon_node(beacon_config.clone()))
|
.map(|_| (network, beacon_config))
|
||||||
.map(|_| network)
|
.and_then(|(network, beacon_config)| {
|
||||||
|
network.add_beacon_node(beacon_config).map(|_| network)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.and_then(move |network| {
|
.and_then(move |network| {
|
||||||
// Delay for `sync_delay` epochs before verifying synced state.
|
// Delay for `sync_delay` epochs before verifying synced state.
|
||||||
@@ -128,8 +130,10 @@ pub fn verify_in_between_sync<E: EthSpec>(
|
|||||||
// Add a beacon node
|
// Add a beacon node
|
||||||
network
|
network
|
||||||
.add_beacon_node(beacon_config.clone())
|
.add_beacon_node(beacon_config.clone())
|
||||||
.join(network.add_beacon_node(beacon_config.clone()))
|
.map(|_| (network, beacon_config))
|
||||||
.map(|_| network)
|
.and_then(|(network, beacon_config)| {
|
||||||
|
network.add_beacon_node(beacon_config).map(|_| network)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.and_then(move |network| {
|
.and_then(move |network| {
|
||||||
// Delay before adding additional syncing nodes.
|
// Delay before adding additional syncing nodes.
|
||||||
|
|||||||
Reference in New Issue
Block a user