-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix bundle merge reveal check #116
Conversation
src/accessors/merge_reveal.rs
Outdated
@@ -187,12 +187,12 @@ impl<Seal: ExposedSeal> MergeReveal for Assignments<Seal> { | |||
impl MergeReveal for TransitionBundle { | |||
fn merge_reveal(mut self, other: Self) -> Result<Self, MergeRevealError> { | |||
debug_assert_eq!(self.commitment_id(), other.commitment_id()); | |||
if self.known_transitions.len() + other.known_transitions.len() > self.input_map.len() || | |||
if self.input_map.len() < other.known_transitions.len() || |
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 need to take into account both self
and other
when do comparison. Why do you think the original version was buggy?
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.
All right, I see. I think it should be this way: first we do extend
, than we do check
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 imagined that the original version made a purposeful comparison between self
and other
, so I adjusted it to a verification that made more sense.
So, should we first do the extend
and then check if the amount of input_map
is less than the known_transitions
?
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.
Yes
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.
Done
1f09376
to
d53454a
Compare
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.
ACK d53454a
Description
This PR intent fix the merge reveal bundle check. Also, adjusts the error message for correct naming.