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

Fix bundle merge reveal check #116

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

theacdutra
Copy link
Member

Description

This PR intent fix the merge reveal bundle check. Also, adjusts the error message for correct naming.

@@ -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() ||
Copy link
Member

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?

Copy link
Member

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

Copy link
Member Author

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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d53454a

@dr-orlovsky dr-orlovsky merged commit e028cd6 into RGB-WG:master Dec 27, 2023
17 of 19 checks passed
@theacdutra theacdutra deleted the fix/bundle-merge-check branch December 27, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants