Use your words
This commit is contained in:
parent
f216a7179a
commit
93d65aa9cc
|
@ -1656,9 +1656,7 @@ fn start_fullnode(
|
||||||
(fullnode.run(Some(rotation_sender)), rotation_receiver)
|
(fullnode.run(Some(rotation_sender)), rotation_receiver)
|
||||||
}
|
}
|
||||||
|
|
||||||
//fn stop_fullnode() {}
|
fn new_non_bootstrap_leader_fullnode(
|
||||||
|
|
||||||
fn new_non_bs_leader_fullnode(
|
|
||||||
mint: &Arc<Keypair>,
|
mint: &Arc<Keypair>,
|
||||||
last_tick: &mut Hash,
|
last_tick: &mut Hash,
|
||||||
mut last_id: &mut Hash,
|
mut last_id: &mut Hash,
|
||||||
|
@ -1685,7 +1683,7 @@ fn new_non_bs_leader_fullnode(
|
||||||
(node, node_keypair, voting)
|
(node, node_keypair, voting)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_bs_leader_fullnode(
|
fn new_bootstrap_leader_fullnode(
|
||||||
ticks_per_slot: u64,
|
ticks_per_slot: u64,
|
||||||
slots_per_epoch: u64,
|
slots_per_epoch: u64,
|
||||||
entries: &mut Vec<Entry>,
|
entries: &mut Vec<Entry>,
|
||||||
|
@ -1732,11 +1730,12 @@ fn test_fullnodes_bootup() {
|
||||||
let mut entries = vec![];
|
let mut entries = vec![];
|
||||||
|
|
||||||
let (mint, ledger, mut last_tick, mut last_id, leader) =
|
let (mint, ledger, mut last_tick, mut last_id, leader) =
|
||||||
new_bs_leader_fullnode(ticks_per_slot, slots_per_epoch, &mut entries);
|
new_bootstrap_leader_fullnode(ticks_per_slot, slots_per_epoch, &mut entries);
|
||||||
|
|
||||||
let leader_info = leader.0.info.clone();
|
let leader_info = leader.0.info.clone();
|
||||||
|
|
||||||
let validator = new_non_bs_leader_fullnode(&mint, &mut last_tick, &mut last_id, &mut entries);
|
let validator =
|
||||||
|
new_non_bootstrap_leader_fullnode(&mint, &mut last_tick, &mut last_id, &mut entries);
|
||||||
|
|
||||||
{
|
{
|
||||||
info!("Number of entries {}", entries.len());
|
info!("Number of entries {}", entries.len());
|
||||||
|
@ -1749,20 +1748,20 @@ fn test_fullnodes_bootup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// let validator_info = validator.0.info.clone();
|
// let validator_info = validator.0.info.clone();
|
||||||
let v_ledger = tmp_copy_blocktree!(&ledger);
|
let validator_ledger = tmp_copy_blocktree!(&ledger);
|
||||||
|
|
||||||
let mut exits = vec![];
|
let mut exits = vec![];
|
||||||
let (v_e, v_r_r) = start_fullnode(
|
let (validator_exit, validator_rotation_receiver) = start_fullnode(
|
||||||
validator.0,
|
validator.0,
|
||||||
validator.1,
|
validator.1,
|
||||||
validator.2,
|
validator.2,
|
||||||
&v_ledger,
|
&validator_ledger,
|
||||||
Some(&leader_info),
|
Some(&leader_info),
|
||||||
&fullnode_config,
|
&fullnode_config,
|
||||||
);
|
);
|
||||||
exits.push(v_e);
|
exits.push(validator_exit);
|
||||||
|
|
||||||
let (l_e, l_r_r) = start_fullnode(
|
let (leader_exit, leader_rotation_receiver) = start_fullnode(
|
||||||
leader.0,
|
leader.0,
|
||||||
leader.1,
|
leader.1,
|
||||||
leader.2,
|
leader.2,
|
||||||
|
@ -1770,7 +1769,7 @@ fn test_fullnodes_bootup() {
|
||||||
None,
|
None,
|
||||||
&fullnode_config,
|
&fullnode_config,
|
||||||
);
|
);
|
||||||
exits.push(l_e);
|
exits.push(leader_exit);
|
||||||
|
|
||||||
converge(&leader_info, exits.len());
|
converge(&leader_info, exits.len());
|
||||||
info!(
|
info!(
|
||||||
|
@ -1794,7 +1793,7 @@ fn test_fullnodes_bootup() {
|
||||||
{
|
{
|
||||||
// Check for leader rotation
|
// Check for leader rotation
|
||||||
{
|
{
|
||||||
match l_r_r.try_recv() {
|
match leader_rotation_receiver.try_recv() {
|
||||||
Ok((rotation_type, slot)) => {
|
Ok((rotation_type, slot)) => {
|
||||||
if slot == 0 {
|
if slot == 0 {
|
||||||
// Skip slot 0, as the nodes are not fully initialized in terms of leader scheduler
|
// Skip slot 0, as the nodes are not fully initialized in terms of leader scheduler
|
||||||
|
@ -1823,7 +1822,7 @@ fn test_fullnodes_bootup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for validator rotation
|
// Check for validator rotation
|
||||||
match v_r_r.try_recv() {
|
match validator_rotation_receiver.try_recv() {
|
||||||
Ok((rotation_type, slot)) => {
|
Ok((rotation_type, slot)) => {
|
||||||
if slot == 0 {
|
if slot == 0 {
|
||||||
// Skip slot 0, as the nodes are not fully initialized in terms of leader scheduler
|
// Skip slot 0, as the nodes are not fully initialized in terms of leader scheduler
|
||||||
|
@ -1871,13 +1870,13 @@ fn test_fullnode_rotate(
|
||||||
let mut entries = vec![];
|
let mut entries = vec![];
|
||||||
|
|
||||||
let (mint, ledger, mut last_tick, mut last_id, leader) =
|
let (mint, ledger, mut last_tick, mut last_id, leader) =
|
||||||
new_bs_leader_fullnode(ticks_per_slot, slots_per_epoch, &mut entries);
|
new_bootstrap_leader_fullnode(ticks_per_slot, slots_per_epoch, &mut entries);
|
||||||
|
|
||||||
let leader_info = leader.0.info.clone();
|
let leader_info = leader.0.info.clone();
|
||||||
|
|
||||||
let validator = if include_validator {
|
let validator = if include_validator {
|
||||||
leader_slot_height_of_next_rotation += 1;
|
leader_slot_height_of_next_rotation += 1;
|
||||||
Some(new_non_bs_leader_fullnode(
|
Some(new_non_bootstrap_leader_fullnode(
|
||||||
&mint,
|
&mint,
|
||||||
&mut last_tick,
|
&mut last_tick,
|
||||||
&mut last_id,
|
&mut last_id,
|
||||||
|
@ -1900,27 +1899,27 @@ fn test_fullnode_rotate(
|
||||||
ledger_paths.push(ledger.clone());
|
ledger_paths.push(ledger.clone());
|
||||||
info!("ledger is {}", ledger);
|
info!("ledger is {}", ledger);
|
||||||
|
|
||||||
let v_ledger = tmp_copy_blocktree!(&ledger);
|
let validator_ledger = tmp_copy_blocktree!(&ledger);
|
||||||
ledger_paths.push(v_ledger.clone());
|
ledger_paths.push(validator_ledger.clone());
|
||||||
|
|
||||||
let mut node_exits = vec![];
|
let mut node_exits = vec![];
|
||||||
|
|
||||||
let validator_rotation_receiver = if let Some(node) = validator {
|
let validator_rotation_receiver = if let Some(node) = validator {
|
||||||
let (v_e, v_r_r) = start_fullnode(
|
let (validator_exit, validator_rotation_receiver) = start_fullnode(
|
||||||
node.0,
|
node.0,
|
||||||
node.1,
|
node.1,
|
||||||
node.2,
|
node.2,
|
||||||
&v_ledger,
|
&validator_ledger,
|
||||||
Some(&leader_info),
|
Some(&leader_info),
|
||||||
&fullnode_config,
|
&fullnode_config,
|
||||||
);
|
);
|
||||||
node_exits.push(v_e);
|
node_exits.push(validator_exit);
|
||||||
v_r_r
|
validator_rotation_receiver
|
||||||
} else {
|
} else {
|
||||||
channel().1
|
channel().1
|
||||||
};
|
};
|
||||||
|
|
||||||
let (l_e, leader_rotation_receiver) = start_fullnode(
|
let (leader_exit, leader_rotation_receiver) = start_fullnode(
|
||||||
leader.0,
|
leader.0,
|
||||||
leader.1,
|
leader.1,
|
||||||
leader.2,
|
leader.2,
|
||||||
|
@ -1928,7 +1927,7 @@ fn test_fullnode_rotate(
|
||||||
None,
|
None,
|
||||||
&fullnode_config,
|
&fullnode_config,
|
||||||
);
|
);
|
||||||
node_exits.push(l_e);
|
node_exits.push(leader_exit);
|
||||||
|
|
||||||
converge(&leader_info, node_exits.len());
|
converge(&leader_info, node_exits.len());
|
||||||
info!(
|
info!(
|
||||||
|
|
Loading…
Reference in New Issue