Replace the deprecated relative distance timelock - #395
Open
schoen wants to merge 3 commits into
Open
Conversation
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.
Collaborator
|
The CI fix (tests) is necessary before we can merge it |
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.
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 |
delta1
reviewed
Aug 26, 2026
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; |
Collaborator
There was a problem hiding this comment.
Since we're touching this and it's supposed to be for inheritance, what's the maximum possible value we could use here?
Collaborator
There was a problem hiding this comment.
Maybe a nice to have in the future would be Distance::MAX
Contributor
There was a problem hiding this comment.
This is more like a dead man's switch where the funds unlock after 180 days of inactivity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.