-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: make PresignatureId be generated and reproducible from triple ids #752
feat: make PresignatureId be generated and reproducible from triple ids #752
Conversation
hasher.update(triple1.to_le_bytes()); | ||
let seed: [u8; 32] = hasher.finalize().into(); | ||
let mut rng = StdRng::from_seed(seed); | ||
let id = rng.gen::<u64>(); |
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.
Why not just pick first 8 byte of the [u8; 32]
as u64 id?
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.
yeah that also works. Either could work, but I guess that one doesn't rely on RNG. Will change it to not use RNG
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.
Nice enhancement!
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.
Nice.
test_multichain_reshare_with_lake_congestion test is unstable :/ cc @ailisp I do not think that this is fault of the test. Probably we need to fix it on the node some day.
Terraform Feature Environment Destroy (dev-752)Terraform Initialization ⚙️
|
This is better to have now than later, as we won't break the presignature id guarantees later if we add it later.
This will allow us to validate
Presignature
generation messages a lit bit more easily by verifying that the presignature id is correct in the future