This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Actually... I don't think this is possible to happen.
A node will not move from the VCBC stage until it receives confirmation that a threshold of voters have seen the proposal. So we no at the very least that 2/3rd's will vote 1 for at least one of the proposers.
Still, perhaps more randomized testing will help build our confidence here.
}
}
None => {
returnErr(Error::InvalidMessage(format!("target {target} not found")))
}
},
None => returnErr(Error::InvalidMessage("no target is defined".to_string())),
The reason will be displayed to describe this comment to others. Learn more.
This test is really useful to fix some issues. Despite its name, the random here means picking a random message from the message buffer. I don't think quickcheck can be helpful here, even I thought about it before.
let _ = env_logger::builder()
.is_test(true)
.filter_level(log::LevelFilter::Debug)
.try_init();
for test_id in0..10{
log::info!("--- starting test {test_id}");
letmut net = TestNet::new();
letmut rng = thread_rng();
for c in&mut net.cons{
let proposal = (0..4).map(|_| rng.gen_range(0..64)).collect();
letmut msgs = c.propose(proposal).unwrap();
net.buffer.append(&mut msgs);
}
loop{
let rand_index = rng.gen_range(0..net.buffer.len());
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should continue in a loop forever going back to the first proposer.
It could be that we hit the first guy too early. Now that some time has passed their proposal had enough time to reach the other nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it is a good idea, in this case we might have double votes per proposal, unless we increase the sequence from 0 to 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, you're worried about a tag re-use issue. Yeah good point. Ok, let's leave it as is for now and I'll create an issue to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually... I don't think this is possible to happen.
A node will not move from the VCBC stage until it receives confirmation that a threshold of voters have seen the proposal. So we no at the very least that 2/3rd's will vote 1 for at least one of the proposers.
Still, perhaps more randomized testing will help build our confidence here.