Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "expiration" to transaction policies #593

Open
dmihal opened this issue Jun 25, 2024 · 0 comments
Open

Add "expiration" to transaction policies #593

dmihal opened this issue Jun 25, 2024 · 0 comments

Comments

@dmihal
Copy link
Contributor

dmihal commented Jun 25, 2024

Background:

Currently, each transaction in the Fuel VM can have a set of "transaction policies" attached to it. One such optional policy is "maturity," which ensures that a given transaction isn't valid until the provided block height is reached. This policy allows for delayed transaction validation.

Proposal:

To complement the "maturity" policy, I suggest adding an "expiration" policy. This new policy would specify a block height after which the transaction is no longer valid. This feature would enable developers to set both a start and end validity period for transactions, providing more granular control over transaction lifetimes.

Implementation Details:

Add a new optional field expiration to the transaction structure.
Update the transaction validation logic to check for the expiration policy.
If the current block height exceeds the expiration block height, the transaction should be deemed invalid.

Example:

A transaction with the following policies:

maturity: 1000
expiration: 2000

This transaction would be valid from block height 1000 to block height 2000. Before block 1000 and after block 2000, the transaction would be considered invalid.

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

No branches or pull requests

1 participant