Skip to content

haskell-generate: add bitcoin cJetEnvType - #351

Merged
apoelstra merged 1 commit into
BlockstreamResearch:masterfrom
delta1:haskell-bitcoin
Oct 16, 2026
Merged

apoelstra merged 1 commit into
BlockstreamResearch:masterfrom
delta1:haskell-bitcoin

Conversation

@delta1

@delta1 delta1 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds Bitcoin for rustJetCJetPtr and cJetEnvType

I found I needed this when trying to re-run vendor and update_jets for BlockstreamResearch/rust-simplicity#385

@stringhandler stringhandler left a comment

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.

utACK 9f7f367

@stringhandler

Copy link
Copy Markdown
Collaborator

ACK 9f7f367

ran tests locally

@apoelstra apoelstra left a comment

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.

ACK 9f7f367; successfully ran local tests

@apoelstra
apoelstra merged commit 3f0bb69 into BlockstreamResearch:master Oct 16, 2026
14 checks passed
delta1 added a commit to delta1/rust-simplicity that referenced this pull request Oct 21, 2026
Re-vendors libsimplicity at
BlockstreamResearch/simplicity@3f0bb69
(upstream master), which includes the merge of
BlockstreamResearch/simplicity#324 ("Bitcoin
Application for Simplicity") and of
BlockstreamResearch/simplicity#351, whose
GenRustJets change emits `CBitcoinTxEnv` as the Bitcoin `c_jet_ptr`
environment type.

This commit does a couple things simultaneously:

* Runs vendor-simplicity.sh and update_jets.sh
* Updates the `Jet` trait to have associated transaction and environment types,
  and for the environment to be paramterized by the transaction type.
* Changes the Core environment from () to CoreEnv::<Infallible>
* Updates some fixed Core CMR/IHR vectors (this update to libsimplicity changes
  the benchmarks for the Core jets and thus changes these vectors)
* Uncomments the commented-out symbols in simplicity-sys/src/c_jets/c_env/bitcoin.rs
* Adds the "build bitcoin" lines to simplicity-sys/build.rs

The update to the `Jet` trait is a bit noisy but ultimately mechanical: everywhere
that we're generic over all J: Jet, we now also have to be generic over all
T: Borrow<J::Transaction>, which leads to some extra line noise especially in
unit tests where we have assert_* helper functions.

The last four points are tiny diffs, thanks to the previous preparatory commits.

The use of CoreEnv::<Infallible> as the core environment type is kinda fun. It
means that it is impossible to execute any code which attempts to access the
transaction in the environment. (No such code exists, since it would be nonsensical,
but now we have some assurance that it won't exist by accident in the future.)

Unfortunately this mixes mechanical and non-mechanical things in one commit. But
the mechanical changes are exclusively in simplicity-sys/depend/ and src/jet/init/
and the non-mechanical changes are exclusively outside of those files, so it
should be possible to review this.
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.

3 participants