Skip to content

Replace the deprecated relative distance timelock - #395

Open
schoen wants to merge 3 commits into
BlockstreamResearch:masterfrom
schoen:feat/fix-last-will-timelock
Open

Replace the deprecated relative distance timelock#395
schoen wants to merge 3 commits into
BlockstreamResearch:masterfrom
schoen:feat/fix-last-will-timelock

Conversation

@schoen

@schoen schoen commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Switch the deprecated relative distance timelock call in the example contract examples/last_will.simf out, replacing it with a (proposed) stdlib function that enforces the same timelock policy correctly.

Switch the deprecated relative distance timelock call in the example
contract examples/last_will.simf out, replacing it with a (proposed)
stdlib function that enforces the same timelock policy correctly.
@schoen
schoen requested a review from delta1 as a code owner August 24, 2026 20:40

@stringhandler stringhandler left a comment

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.

utACK eef3ece

@KyrylR

KyrylR commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

The CI fix (tests) is necessary before we can merge it

schoen added 2 commits August 25, 2026 16:41
The 180 days value is applicable to Bitcoin (with a 10-minute
blocktime), where we currently can't run this example contract.
On Liquid, it is only 18 days. Instead of trying to switch to
a Duration (which is the same unit for both), just add a comment
highlighting the issue.

This is already clearly discussed in the timelocks documentation,
and I'll also note it for the pitfalls documentation.

Fixed BlockstreamResearch#396.
@schoen

schoen commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@KyrylR Thanks, fixed. I also don't know exactly where the base64 data required for this test came from (I assume it's compiling from Rust but the results look extremely different from simc output).

Comment thread examples/last_will.simf
Comment on lines +46 to +47
// On Bitcoin, this Distance would be 180 days; on Liquid, it is 18 days.
let timelock_distance: Distance = 25920;

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.

Since we're touching this and it's supposed to be for inheritance, what's the maximum possible value we could use here?

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.

Maybe a nice to have in the future would be Distance::MAX

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.

This is more like a dead man's switch where the funds unlock after 180 days of inactivity.

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