Replace the deprecated relative distance timelock - #395
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.
|
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.
|
@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 |
| // On Bitcoin, this Distance would be 180 days; on Liquid, it is 18 days. | ||
| let timelock_distance: Distance = 25920; |
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?
There was a problem hiding this comment.
Maybe a nice to have in the future would be Distance::MAX
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.
There was a problem hiding this comment.
If someone wanted to actually use it for inheritance, the preferable thing would be to use Duration, which can be up to 65535 units of 512 seconds (about 1.06 years).
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.