-
Notifications
You must be signed in to change notification settings - Fork 19
PR 3 of 3: Use bindings created for jet execution. #50
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
Conversation
fae12ef to
e4a37b5
Compare
911b607 to
f984241
Compare
This module is assuming bitcoin jets that are not implemented/unspecified. Comment this out, this will be renabled later in a separate PR after we have all the jets
Add a new function to_type that outputs Type
These are no longer used in C and probably incorrect. We should remove this code entirely after we use FFI jets. This just removes unneeded fields in the ElementsEnv struct in the next commit
This commit also does a couple other things. 1) Makes modification to bitmachine that allows to skip assertions in test cfg. Useful for creating states of bitmachine wihtout creating a program. 2) Removes all existing jets that were implemented in rust. This is really not a good idea because the definitions of certain jets are hard to emulate and have special corner/wierd cases. We are best to directly use the FFI bindings. 3) Adds test for checking FFI with/without env
Also add clippy.toml to preserve MSRV warnings
f984241 to
bbbb7ca
Compare
|
Rebased after #49 |
|
We never actually re-enable the |
|
Ah, yes, I see, there's a TODO for doing Bitcoin jets that still needs to be addressed before we can re-enable the module. |
|
Overall this looks great. There are a bunch of At some point we can use mutagen to assess our test coverage. |
apoelstra
left a comment
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 bbbb7ca
|
@apoelstra, yep. The policy compiler code is really old and based on bitcoin jets that I assumed would be created in 2020. Time to revisit this in 2023. Similar to how we exported the jets, we should also export the test cases from |
I can't find any citation that this is safe to do. We don't actually use this structure in our Rust code; we populate it by calling a c_set function which is defined on the C side, and then pass it to C functions. So no code needs to be changed. However, I want to remove the c_set_* functions because they hide life information (and in fact, are unsound, as we currently use them) and serve to obfuscate code. They seem to have come from BlockstreamResearch#48 BlockstreamResearch#49 BlockstreamResearch#50 BlockstreamResearch#51 in which Sanket seems to have copied the corresponding Haskell code into Rust, where it is unnecessary and dangerous.
I can't find any citation that this is safe to do. We don't actually use this structure in our Rust code; we populate it by calling a c_set function which is defined on the C side, and then pass it to C functions. So no code needs to be changed. However, I want to remove the c_set_* functions because they hide life information (and in fact, are unsound, as we currently use them) and serve to obfuscate code. They seem to have come from BlockstreamResearch#48 BlockstreamResearch#49 BlockstreamResearch#50 BlockstreamResearch#51 in which Sanket seems to have copied the corresponding Haskell code into Rust, where it is unnecessary and dangerous.
Based on #48 and #49