Skip to content

Docs: invalid-hereafter upper limit #83

@fallen-icarus

Description

@fallen-icarus

This idea pertains to the aiken documentation's What I Wish I Knew section, specifically the Validity Intervals sub-section.

There is a maximum upper-bound allowed for validity intervals of 1.5 days (129600 slots) past the current slot. If you set an invalid-hereafter to be later than this bound, you will get a PastHorizon error message when submitting the transaction. It took me a while to figure this out and I wish I knew it before 😅

The value of 1.5 days is calculated by: stability_window_network_parameter * 2 (source). From the comment in the code (a few lines below the linked source code line):

-- | Zone in which it is guaranteed that no hard fork can take place

Hardforks can alter the slot <--> POSIXTime conversions and so the node rejects conversions that are too far into the future.

Users can still set expirations (in datums) for things that exceed the current 1.5 days bound; but when actually specifying the validity interval for a transaction, the upper bound must currently bemin(129600 + current_slot, expiration_slot).

An example use case is a loan's expiration: the upper-bound can be used to prove the loan's expiration has not passed yet, but loans can last for months. So when trying to prove the loan is not expired, the transaction must use current_slot + 129600 for the upper bound until the actual expiration is within 1.5 days of the current slot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🪣 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions