Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBT: validators are wrongly re-sorted #687

Open
Shivani912 opened this issue Nov 19, 2020 · 0 comments
Open

MBT: validators are wrongly re-sorted #687

Shivani912 opened this issue Nov 19, 2020 · 0 comments
Labels

Comments

@Shivani912
Copy link
Contributor

From working on #686 , looks like MBT is wrongly re-arranging validators in validator_set after Testgen (correctly) generates it. Not sure yet where exactly this is happening. As a temporary solution, I'm re-sorting it locally (in light-client/tests/model_based.rs) to get the correct validator set.

This was caught by comparing the hashes like below from a more detailed output of one of the tests:

 > step 1, expecting Success
regen vals hash: Hash::Sha256(2B141A0A08B7EF0A65BC5F4D92F00BDEF0279124DEAC497BEF4C4336D0A3CE6F) 
 current resorted vals hash: Hash::Sha256(2B141A0A08B7EF0A65BC5F4D92F00BDEF0279124DEAC497BEF4C4336D0A3CE6F)
      > lite: Invalid(InvalidValidatorSet { header_validators_hash: Hash::Sha256(2B141A0A08B7EF0A65BC5F4D92F00BDEF0279124DEAC497BEF4C4336D0A3CE6F), 
validators_hash: Hash::Sha256(F85F593D2CBDCB7B0D45B6C17A708CAB7AF4C51256DAC7F9412FCACA0B1420F4) })
  • "regen val hash" is the hash of validator set that was re-generated from testgen_block of the test using Testgen (testgen_block is a raw, minimal data using which the Testgen produces a LigthBlock)
  • "current resorted vals hash" is the hash of re-sorted validator set in LightBlock
  • "header_validators_hash" is the hash of validator set in LightBlock's Header, and
  • "validators_hash" is the hash of the validator set present in LightBlock

For better understanding, below is what a single MBT test contains:

/// A LiteBlock together with the time when it's being checked, and the expected verdict
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BlockVerdict {
block: AnonLightBlock,
testgen_block: TestgenLightBlock,
now: Time,
verdict: LiteVerdict,
}

@Shivani912 Shivani912 mentioned this issue Nov 19, 2020
5 tasks
@thanethomson thanethomson added this to the v0.17.0 milestone Nov 19, 2020
@Shivani912 Shivani912 modified the milestones: v0.17.0, v0.18 Dec 3, 2020
@thanethomson thanethomson removed this from the v0.19 milestone Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants