Skip to content

chore: update rust-simplicity dependency#314

Merged
KyrylR merged 2 commits into
BlockstreamResearch:masterfrom
stringhandler:chore/update-rust-simplicity
May 21, 2026
Merged

chore: update rust-simplicity dependency#314
KyrylR merged 2 commits into
BlockstreamResearch:masterfrom
stringhandler:chore/update-rust-simplicity

Conversation

@stringhandler
Copy link
Copy Markdown
Contributor

Switch to latest master branch of rust-simplicity, which removes the Jet type parameter from nodes and renames broken lock distance/ duration jets. Update all call sites to match the new API and deprecate example files that use the renamed jets.

@apoelstra
Copy link
Copy Markdown
Contributor

@ivanlele in your opinion are we ready to just release a new version of rust-simplicity with these changes?

@ivanlele
Copy link
Copy Markdown

ivanlele commented May 6, 2026

@ivanlele in your opinion are we ready to just release a new version of rust-simplicity with these changes?

@apoelstra, looks like it, the remaining work for #224 is only on the HL side. I was actually about to ask you what we needed to make release myself

@apoelstra
Copy link
Copy Markdown
Contributor

Okay, dope. @ivanlele can you open a PR on rust-simplicity which bumps the version in Cargo.toml and the lockfiles, and adds whatever CHANGELOG.md entries you think are worth mentioning? Then I can merge that, and tag and publish it.

@stringhandler
Copy link
Copy Markdown
Contributor Author

Can we possibly also get BlockstreamResearch/rust-simplicity#362 merged before the tag?

@apoelstra
Copy link
Copy Markdown
Contributor

oops yes definitely. let me review it now.

@ivanlele
Copy link
Copy Markdown

ivanlele commented May 6, 2026

Okay, dope. @ivanlele can you open a PR on rust-simplicity which bumps the version in Cargo.toml and the lockfiles, and adds whatever CHANGELOG.md entries you think are worth mentioning? Then I can merge that, and tag and publish it.

On it, I'll make it a draft for now, before Mike's PR is reviewed

@ivanlele
Copy link
Copy Markdown

ivanlele commented May 6, 2026

@stringhandler stringhandler force-pushed the chore/update-rust-simplicity branch from 7d37b65 to e292d60 Compare May 19, 2026 14:04
KyrylR added a commit that referenced this pull request May 20, 2026
c3f0ce8 general: remove mention of the lsp and vscode (Kyryl R)
9d8c2d3 refactor: remove lsp and vscode (stringhandler)

Pull request description:

  Removes the LSP and VS Code extension from this repo and into https://github.com/BlockstreamResearch/simplicityhl-lsp

  # Motivation
  When trying to update `rust-simplicity` in #314 I am unable to get the full project to pass CI. This is because the LSP project references Simplicity via a crates version.

  As it stands, there are usually multiple PRs to update the LSP after code in the rest of the project is edited.

ACKs for top commit:
  KyrylR:
    ACK c3f0ce8; successfully ran local tests, docs and review

Tree-SHA512: ec7e94d95c0b21683ddeed46a9e678e176490690c96179be76c06e6cc578263ae7cba166700fe432421e8a344eea5a05c2b5b5c6dcfa71a01a7d5223b57fcd99
@stringhandler stringhandler force-pushed the chore/update-rust-simplicity branch from 7b44457 to f028068 Compare May 20, 2026 13:14
…ew API

Switch to master branch of rust-simplicity, which
removes the `Jet` type parameter from nodes and renames broken lock distance/
duration jets. Update all call sites to match the new API and deprecate example
files that use the renamed jets.
@stringhandler stringhandler force-pushed the chore/update-rust-simplicity branch from f8a1acf to 83f6c50 Compare May 20, 2026 13:40
@stringhandler stringhandler marked this pull request as ready for review May 20, 2026 14:05
@stringhandler stringhandler requested a review from delta1 as a code owner May 20, 2026 14:05
@stringhandler
Copy link
Copy Markdown
Contributor Author

Finally ready for review

@apoelstra
Copy link
Copy Markdown
Contributor

Hah, glad to see the new broken_ names for these jets highlight where we were using them.

@stringhandler
Copy link
Copy Markdown
Contributor Author

Yeah I originally moved these examples to a new deprecated folder, but I decided to do that in a follow up PR instead

Comment thread src/tracker.rs
// The reason we need to advance by a bit is that the AssertL combinator is actually a Case combinator,
// which takes a bit of input to decide which branch to take. But this bit is "meaningless" and
// is always 0 because it's an assertion.
let _ = input_frame.next();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In 83f6c50:

Why remove this from handle_jet here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar in parse_jet_result below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The tests fail with them. I suspect that the extra bit was actually a result of the Frame bug we fixed in rust-simplicity, and that @KyrylR (I suspect he added these) assumed it was the case that the jet had a wrapping case, when it did not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hah, fascinating! I think you are right -- it looks like all this code comes from PRs like #198 with the attitude "let's just patch this til it works for now, and eventually we'll replace this debug-wrapping stuff completely".

Comment thread src/tracker.rs
match node.inner() {
Inner::Jet(jet) => self.handle_jet(node, *jet, &input, &output),
Inner::Jet(jet) => {
if let Some(&elements_jet) = jet.as_any().downcast_ref::<Elements>() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In 83f6c50:

I guess we can do this as a followup but I suspect this downcast is unnecessary and we can do everything using the generic jet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, let me look at this again.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

handle_jet will be updated later to accept dynamic jets, so this downcast will disappear down the line.

Comment thread src/tracker.rs
Inner::Jet(jet) => {
if let Some(&elements_jet) = jet.as_any().downcast_ref::<Elements>() {
self.handle_jet(node, elements_jet, &input, &output);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In 83f6c50:

While we have the downcast, let's add an else { panic! } here so that we visibly crash rather than silently ignoring the jet, if we are given a non-elements program.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good idea

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Copy Markdown
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 361966d; successfully ran local tests

Comment thread src/docs/jet.rs
- The result of [`input_utxos_hash`] (32 bytes)."#,
// Time locks
Elements::CheckLockDistance => r#"**Deprecated; do not use.** Assert that the value returned by [`tx_lock_distance`] is greater than or equal to the given value.
Elements::BrokenDoNotUseCheckLockDistance => r#"**Deprecated; do not use.** Assert that the value returned by [`tx_lock_distance`] is greater than or equal to the given value.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: generated jet module docs still link to the old timelock jet names after the rename (i.e. to [tx_lock_distance], and to [tx_lock_duration] below)

Copy link
Copy Markdown
Collaborator

@KyrylR KyrylR left a comment

Choose a reason for hiding this comment

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

ACK 361966d; successfully ran local tests, review

@KyrylR KyrylR merged commit d596cb1 into BlockstreamResearch:master May 21, 2026
11 checks passed
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.

4 participants