-
Notifications
You must be signed in to change notification settings - Fork 12
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
Introduce typed holes; improve disconnect support in human-readable encoding #169
Conversation
src/human_encoding/mod.rs
Outdated
let cmr_str = /*if let node::Inner::Witness(..) = node.inner() { | ||
String::new() | ||
} else { | ||
format!("-- cmr {:.8}...", node.cmr()) | ||
}; | ||
} else { */ | ||
format!("-- cmr {}...", node.cmr()) | ||
+ &format!(" -- imr {}...", node.imr().as_ref().map(ToString::to_string).unwrap_or("???".to_string())) | ||
// }; | ||
; |
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.
04f8ffa: We probably want to remove the special case for witness entirely.
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.
Oops, this code just shouldn't be there. Or we should step back and consider whether we want to add CMRs, IMRs, or both (and how). Right now it's an ad-hoc choice based on what I currently needed to generate blog posts.
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 print the CMR for all nodes since it exists. As for the IMR, the ???
string might be confusing, because it looks like a bug in our software. I think we should remove it. Alternatively we could print something like (malleable)
for witness IMRs.
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 malleable
is misleading. How about [undetermined]
? Or even [undetermined at commitment time]
since we've got a lot of room for characters here.
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.
04f8ffa: Looks good. Unfortunately most of the example programs don't yet compile. In particular bip340.simpl
causes errors on the latest commit because the holes are not filled somehow.
04f8ffa
to
f9f548f
Compare
Rebased and renamed last commit. No other changes. I will fix the example programs tomorrow. |
Right now if you use holes anywhere you'll get a parse error complaining about it, but the parse error will give the type of the hole.
f9f548f
to
7494aab
Compare
FIxed the example programs. Deleted the hidden and disconnect ones, since those test bugs that are no longer architecturally possible. |
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.
7494aab: The example programs work now. Let's resolve the printing of CMRs and IMRs, and then this PR is ready to be merged.
Ok, added commit which tweaks the printing output. |
I don't know what exactly is the issue. But as of 5465612
|
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.
5465612: The formatting looks good.
I could reproduce @sanket1729's error on my end. The disassembly output has a main
, but the assembler doesn't find it.
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.
5465612 ACK. Sanket's bug is already present on master.
I opened #173 |
This introduces the notion of "typed holes" which can be used as placeholders in the text encoding of Simplicity. It uses these holes for disconnect, so that at commitment time users can set their right children to placeholders. The old behavior, which allowed putting a complete expression into
disconnect
that wouldn't be committed to, was dangerous.