Skip to content

Move the Jet codec and parser towards the object-safaty#358

Merged
apoelstra merged 1 commit intoBlockstreamResearch:masterfrom
ivanlele:feature/sail-jet-from-not-object-safe-supertraits
Apr 22, 2026
Merged

Move the Jet codec and parser towards the object-safaty#358
apoelstra merged 1 commit intoBlockstreamResearch:masterfrom
ivanlele:feature/sail-jet-from-not-object-safe-supertraits

Conversation

@ivanlele
Copy link
Copy Markdown
Contributor

@ivanlele ivanlele commented Apr 9, 2026

This PR moves the Jet::decode method to JetEnvironment::decode_jet, introduces a parse method for jets within that environment, and updates Jet::encode to comply with object safety. See #349 for details.

@ivanlele
Copy link
Copy Markdown
Contributor Author

ivanlele commented Apr 9, 2026

@apoelstra. Looks big at first glance, but it's mostly from moving the decoding tree into autogenerated files, once I revert those, it'll be tiny. Also the updated generation: BlockstreamResearch/simplicity#335

@ivanlele ivanlele force-pushed the feature/sail-jet-from-not-object-safe-supertraits branch 2 times, most recently from 701e61b to 4d89a8f Compare April 13, 2026 11:49
@apoelstra
Copy link
Copy Markdown
Collaborator

utACK 4d89a8f -- looking forward to getting the Simplicity PR in (I fixed my pinning so hopefully I can merge it today)

@ivanlele
Copy link
Copy Markdown
Contributor Author

@apoelstra with your ACK in BlockstreamResearch/simplicity/335, should I go ahead and revert the autogenerated files here?

@apoelstra
Copy link
Copy Markdown
Collaborator

@ivanlele yes -- sorry, the only reason I haven't merged it is because my local tests have been delayed.

apoelstra added a commit to BlockstreamResearch/simplicity that referenced this pull request Apr 17, 2026
00a62c3 make decode/parse methods sized (ivanlele)

Pull request description:

  This PR updates the Rust codegen to match the interface changes introduced in BlockstreamResearch/rust-simplicity#358


ACKs for top commit:
  apoelstra:
    ACK 00a62c3; successfully ran local tests


Tree-SHA512: 6e63531ba156009762e5f5408e24b10e1778b2af0f93df9f53bff722d4ffbdf72beaa3534647d50e7566c4af359279c50929f06b6e48d5545d3a0d57d65c253d
@ivanlele
Copy link
Copy Markdown
Contributor Author

@ivanlele yes -- sorry, the only reason I haven't merged it is because my local tests have been delayed.

Np! I reverted 4bef6bb, rolled back the autogenerated files, and temporarily reverted some logic to match the previous interfaces. The diff looks a bit funny:
https://github.com/ivanlele/rust-simplicity/pull/9/changes

I’m not sure it's worth merging this right now. Maybe we should keep it as a draft until the new version is ready? I can open a follow-up PR to remove the remaining not object safe supertraits, and then we can merge both PRs together after the new version comes. After these 2, Jet should be fully object safe

@apoelstra
Copy link
Copy Markdown
Collaborator

I’m not sure it's worth merging this right now. Maybe we should keep it as a draft until the new version is ready?

What do you mean by this. Other than merging 335 (which I did) what needs to be done?

@ivanlele
Copy link
Copy Markdown
Contributor Author

I’m not sure it's worth merging this right now. Maybe we should keep it as a draft until the new version is ready?

What do you mean by this. Other than merging 335 (which I did) what needs to be done?

After reverting autogen, the only changes in the diff are small updates to the encode functions to support dynamic dispatch (around 20 lines). I was thinking that this might be too little to justify a PR, but I may be overthinking it.

If this looks fine to you, I can squash the revert and these changes into a single commit, push it, and you can review and then merge

@apoelstra
Copy link
Copy Markdown
Collaborator

If this looks fine to you, I can squash the revert and these changes into a single commit, push it, and you can review and then merge

TBH I'm not sure what you're doing with the revert -- now that 335 is merged, you should update the vendored version of libsimplicity, which will pull in all the changes from there. This is the only allowed way to update the autogenerated files.

It's okay to squash any additional changes; I can just redo the revendoring on my end and then diff to see what you did.

@ivanlele
Copy link
Copy Markdown
Contributor Author

you should update the vendored version of libsimplicity

Can I just do that? I thought, we could only revendor and regenerate after a new version of rust-simplicity is released (maybe I'm was confused). If that's not the case, it simplifies things a lot.

Should I go ahead and include the revendoring and regeneration in this PR?

@apoelstra
Copy link
Copy Markdown
Collaborator

Can I just do that?

Yes :).

I thought, we could only revendor and regenerate after a new version of rust-simplicity is released

Nope. If we revendor/regenerate then we've committed to a major release (rather than a minor one) but we're not obligated to, and we don't need to do a release beforehand.

I think, last time we revendored we had some other changes that we really wanted to get into a minor release, so we did that minor release before revendoring. But that's not the case now.

Should I go ahead and include the revendoring and regeneration in this PR?

Yes please.

@ivanlele ivanlele marked this pull request as ready for review April 21, 2026 10:25
@ivanlele
Copy link
Copy Markdown
Contributor Author

@apoelstra lmk if the commit order looks good for you

@apoelstra
Copy link
Copy Markdown
Collaborator

@ivanlele I'm not sure what I'm looking at with 4bef6bb (the first "revert env removal" commit). Is this what happens when you update the upstream lib and revendor?

I would suggest squashing all three commits rather than worrying about their order. I will do the revendoring on my end and then run git diff against your commit to see what non-mechanical changes you made.

@ivanlele ivanlele force-pushed the feature/sail-jet-from-not-object-safe-supertraits branch from bb47232 to bb63bff Compare April 21, 2026 18:13
@ivanlele
Copy link
Copy Markdown
Contributor Author

I would suggest squashing all three commits rather than worrying about their order. I will do the revendoring on my end and then run git diff against your commit to see what non-mechanical changes you made.

done

Copy link
Copy Markdown
Collaborator

@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 bb63bff; successfully ran local tests

@apoelstra apoelstra merged commit 41685f6 into BlockstreamResearch:master Apr 22, 2026
24 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.

2 participants