Skip to content

Show error if using deprecated jets#228

Draft
stringhandler wants to merge 2 commits intoBlockstreamResearch:masterfrom
stringhandler:feat/add-error-for-deprecated-jet
Draft

Show error if using deprecated jets#228
stringhandler wants to merge 2 commits intoBlockstreamResearch:masterfrom
stringhandler:feat/add-error-for-deprecated-jet

Conversation

@stringhandler
Copy link

@stringhandler stringhandler commented Mar 5, 2026

Background:

The jets check_lock_distance, check_lock_duration, tx_lock_distance, tx_lock_duration have recently been deprecated. In simplicity, the elements jets were renamed with the prefix broken_do_not_use_.

This PR

My aim when I started this was to have simc generate warnings if you used a deprecated jet, with the option of forcing errors via -D warnings or something similar. However, adding warnings would require a large amount of changes and that would be better suited to be it's own PR.

This PR, (along with sibling PRs in rust-simplicity#350 and simplicity#333, updates the jets to the new names, which should be enough of a warning to developers. It also returns an error if a deprecated jet is used.

Notably, the example escrow_with_delay.simf was using the deprecated jet. At present, I am not sure the correct path to fix this example, so for this PR it just renames the jet.

Before:

     Running `target\debug\simc.exe .\examples\escrow_with_delay.simf`
Program:
5wHQKEGJtLzfMz987l3WKtAxSudDhYOBTf5tlucUbKz5QK2LfAvMAgTFNpxgR/lEHtfW0wRUBulcB82Fx3jkuM7zynq6wJuVxwnuUEIFCbT8mEUAySxhiCSaJ8L8TqkU2pjkIsG3zNhDAPiJ3nAbfIIQKEGHHGwONkKBYj8JOOFgQYgUH4hOQKE2AACDcIMOQYYLALQPicgUIMONxOccgwVJ4CBOIz8JNxkKD6jhVsYCEig/I0EA2gcCH4VpjQQgUIMMzADACsAg/FBgqPxWCAbguCAMA8XAcZAcbkCg3GpuTRxhxxuQhxhwsQtYDgCBQbkIflScYcccfkocYccLILaA4hQKE2AECECg3Jo43JwUZtoIA46SKAORgNYHAQOIwOMwOXAHL0DmCJFAHJYHMmBzMgcz4HNINysSBzSicrxcwXKYDk9YgfQDlgE5kUGeUEJFAHKoGgLYA5Wg4ABwQHgwHN6A

After

     Running `target\debug\simc.exe .\examples\escrow_with_delay.simf`
   |
54 |     jet::broken_do_not_use_check_lock_distance(timeout);
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Jet `broken_do_not_use_check_lock_distance` has been deprecrated.
error: process didn't exit successfully: `target\debug\simc.exe .\examples\escrow_with_delay.simf` (exit code: 1)

NOTE: This pr requires PRs in rust-simplicity#350 and simplicity #333 to be merged first.

),
Error::JetIsDeprecated(name) => write!(
f,
"Jet `{name}` has been deprecrated."
Copy link
Author

Choose a reason for hiding this comment

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

Suggested change
"Jet `{name}` has been deprecrated."
"Jet `{name}` has been deprecated."

@stringhandler stringhandler changed the title add error for using deprecated jets Show error if using deprecated jets Mar 5, 2026
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.

1 participant