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

Closed
dmihal opened this issue Jun 25, 2024 · 1 comment
Closed

Add "expiration" to transaction policies #593

dmihal opened this issue Jun 25, 2024 · 1 comment
Assignees

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.

@AurelienFT AurelienFT self-assigned this Nov 17, 2024
AurelienFT added a commit that referenced this issue Nov 28, 2024
#593

VM PR : FuelLabs/fuel-vm#871

### Before requesting review
- [x] I have reviewed the code myself

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?
@AurelienFT
Copy link
Contributor

Done in #616

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

2 participants