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

Update simplicity #116

Merged

Conversation

uncomputable
Copy link
Collaborator

Update rust-simplicity to the latest version. This brings support for Mac and optimizations of the internal representation of Simplicity values. CI is enabled for Mac.

Fixes #114

@uncomputable uncomputable force-pushed the 2025-03-update-simplicity branch from e4fc65b to a933e66 Compare March 22, 2025 16:11
@m-kus
Copy link

m-kus commented Mar 24, 2025

@uncomputable I tried your branch locally, but the issue still remains 🤔

@uncomputable
Copy link
Collaborator Author

uncomputable commented Mar 24, 2025

How is this possible. 1273808 literally adds a unit test for the problematic program. The test succeeds.

Edit: Maybe you mean that the issue remains in the stark-symfony crate. I will look into that once Simfony is properly updated.

@m-kus
Copy link

m-kus commented Mar 24, 2025

I think that's because BitMachine is used for running tests in Simfony.
In the Elements node a different (multistage) workflow is used for Simplicity scripts, and it fails at an early stage.

Basically that's how I discovered this error — tried to broadcast a transaction with my script.

@apoelstra
Copy link
Contributor

Are you saying that in the Elements node simplicity_mallocTypeInference is failing on your program? That sounds like our code is outputting broken Simplicity. Are you able to post the raw Simplicity code (in hex, or base64, or whatever format seems convenient ... there isn't really a standard)?

@m-kus
Copy link

m-kus commented Mar 24, 2025

Yes, SIMPLICITY_ERR_TYPE_INFERENCE_UNIFICATION to be specific — here

I tried to disassemble, but I got a decoder error
failed to apply bound1to existing bound ... comp combinator: left target = right source

@apoelstra
Copy link
Contributor

Ok, so at least rust-simplicity and the C code agree that the code is malformed :). But how did you produce it?

If you can get some hex/base64 output I can maybe try to pull it apart and see what's going on.

@m-kus
Copy link

m-kus commented Mar 24, 2025

Oh sorry, I misunderstood 😅

Here is the encoded output (of the minimal reproducible program from the issue):

4/TZAAAAAAIsgAAAAEGAVIFCSEGGAx2CgWTNuJzXXcvB6E6noyBxnL/G3JXlGU+eypltVaey12jFEeKjEOGAYhbGDmcVRCRXQmYAIq4WDF4UsJ7AwqF1hL9cVIyFlhwCtu/AEMAxWQAAAAEDgiyAAAAAwcGCpAoFwbIXCjBEX+oDjSJpgMLm9+S+nolYSNH9l/IQDbQwBMtOrd78UHggFC4cYF3vtQo+60Po4ukCQ0VtLxJhSxmV3EYSgDejbdP5dgAw8CAo/EJgm8XEpvE6GEjgGe+I3i56PBVh0YKLO+DykN75/uv1TalCSUcsDw8ChcUmfgqtZsgmWOwMfypaLMOMP2GokqzQ2joTP/nq1miHPcYPDQKE4uPxiCBbwFBwoLiIBkDjcA==

Hex

e3f4d900000000022c800000004180548142484186031d828164cdb89cd75dcbc1e84ea7a320719cbfc6dc95e5194f9eca996d55a7b2d768c511e2a310e1806216c60e671544245742660022ae160c5e14b09ec0c2a17584bf5c548c85961c02b6efc010c031590000000103822c80000000c1c182a40a05c1b2170a30445fea038d226980c2e6f7e4be9e895848d1fd97f2100db43004cb4eaddefc507820142e1c605defb50a3eeb43e8e2e90243456d2f12614b1995dc46128037a36dd3f9760030f02028fc42609bc5c4a6f13a1848e019ef88de2e7a3c1561d1828b3be0f290def9feebf54da94249472c0f0f0285c5267e0aad66c82658ec0c7f2a5a2cc38c3f61a892acd0da3a133ff9ead668873dc60f0d0284e2e3f188205bc05070a0b8880640e370

@uncomputable
Copy link
Collaborator Author

uncomputable commented Mar 25, 2025

Let's track the issue somewhere else because it is unrelated to this PR.

@uncomputable uncomputable force-pushed the 2025-03-update-simplicity branch from a933e66 to ebb4c95 Compare March 25, 2025 04:16
@uncomputable uncomputable marked this pull request as ready for review March 25, 2025 04:17
@uncomputable uncomputable requested a review from apoelstra March 25, 2025 04:30
@uncomputable uncomputable marked this pull request as draft March 26, 2025 06:03
@uncomputable
Copy link
Collaborator Author

Let's get BlockstreamResearch/rust-simplicity#270 and BlockstreamResearch/rust-simplicity#280 in before updating Simfony. Drafting the PR.

@uncomputable uncomputable force-pushed the 2025-03-update-simplicity branch from ebb4c95 to 4a9a20d Compare March 28, 2025 16:54
@uncomputable uncomputable marked this pull request as ready for review March 28, 2025 16:54
Rust-simplicity supports MacOS and Windows since the latest updates.
This commit enables CI for MacOS. I would enable Windows as well, but
the install-nix-action doesn't support it.
@uncomputable uncomputable force-pushed the 2025-03-update-simplicity branch from 4a9a20d to 0a974f1 Compare March 28, 2025 17:01
@uncomputable
Copy link
Collaborator Author

Updated rust-simplicity to the latest version. This should bring support for both Mac OS and for Windows. This PR is ready to be reviewed and merged.

Copy link
Contributor

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 0a974f1; successfully ran local tests

@apoelstra apoelstra merged commit 45c34f9 into BlockstreamResearch:master Mar 31, 2025
13 checks passed
@uncomputable uncomputable deleted the 2025-03-update-simplicity branch March 31, 2025 15:17
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.

TypeInferenceUnification error when unpacking two pairs
3 participants