From de3ed12cb849cbc7210ef35b9b476e877fc90ff4 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Sun, 17 Nov 2024 14:10:13 +0100 Subject: [PATCH 1/5] Add policy expiration --- src/tx-format/policy.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tx-format/policy.md b/src/tx-format/policy.md index fb4a1a5a..1b7532a8 100644 --- a/src/tx-format/policy.md +++ b/src/tx-format/policy.md @@ -7,12 +7,13 @@ enum PolicyType : uint32 { WitnessLimit = 2, Maturity = 4, MaxFee = 8, + Expiration = 16, } ``` | name | type | description | |--------|-----------------------------------------------------------------------------------|--------------| -| `data` | One of [`Tip`](#tip), [`WitnessLimit`](#witnesslimit), or [`Maturity`](#maturity) | Policy data. | +| `data` | One of [`Tip`](#tip), [`WitnessLimit`](#witnesslimit), [`Maturity`](#maturity) or [`Expiration`](#expiration) | Policy data. | ## `Tip` @@ -42,6 +43,16 @@ Transaction is invalid if: - `blockheight() < maturity` +## `Expiration` + +| name | type | description | +|--------------|----------|------------------------------------------| +| `expiration` | `uint32` | Block after which the transaction cannot be included. | + +Transaction is invalid if: + +- `blockheight() > expiration` + ## `MaxFee` | name | type | description | From 8f83755b74e38fa605819bf35f89c0548a9bcc98 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Tue, 19 Nov 2024 15:18:41 +0100 Subject: [PATCH 2/5] Add owner policy --- src/tx-format/policy.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/tx-format/policy.md b/src/tx-format/policy.md index 1b7532a8..8c58e5a5 100644 --- a/src/tx-format/policy.md +++ b/src/tx-format/policy.md @@ -8,12 +8,13 @@ enum PolicyType : uint32 { Maturity = 4, MaxFee = 8, Expiration = 16, + Owner = 32, } ``` | name | type | description | |--------|-----------------------------------------------------------------------------------|--------------| -| `data` | One of [`Tip`](#tip), [`WitnessLimit`](#witnesslimit), [`Maturity`](#maturity) or [`Expiration`](#expiration) | Policy data. | +| `data` | One of [`Tip`](#tip), [`WitnessLimit`](#witnesslimit), [`Maturity`](#maturity), [`Expiration`](#expiration) or [`Owner`](#owner) | Policy data. | ## `Tip` @@ -63,3 +64,13 @@ Transaction is invalid if: - `max_fee > sum_inputs(tx, BASE_ASSET_ID) - sum_outputs(tx, BASE_ASSET_ID)` - `max_fee < max_fee(tx, BASE_ASSET_ID, gas_price)` + +## `Owner` + +| name | type | description | +|---------|----------|----------------------------------------------------------| +| `owner` | `uint64` | Index of the transaction input that we nominate as owner | + +Transaction is invalid if: + +- `owner >= inputs.len()` \ No newline at end of file From 53f21791ced86332657d099570b4334417bb505b Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Tue, 19 Nov 2024 15:21:59 +0100 Subject: [PATCH 3/5] fix markdown fmt --- src/tx-format/policy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tx-format/policy.md b/src/tx-format/policy.md index 8c58e5a5..22ff3ea0 100644 --- a/src/tx-format/policy.md +++ b/src/tx-format/policy.md @@ -73,4 +73,4 @@ Transaction is invalid if: Transaction is invalid if: -- `owner >= inputs.len()` \ No newline at end of file +- `owner >= inputs.len()` From a843a2bb473a05e2a43607189c9a4fccd7636b4e Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Wed, 20 Nov 2024 11:15:04 +0100 Subject: [PATCH 4/5] Edit spec --- src/tx-format/policy.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tx-format/policy.md b/src/tx-format/policy.md index 22ff3ea0..39af7fbd 100644 --- a/src/tx-format/policy.md +++ b/src/tx-format/policy.md @@ -74,3 +74,4 @@ Transaction is invalid if: Transaction is invalid if: - `owner >= inputs.len()` +- `inputs[owner] != InputType::Message && inputs[owner] != InputType::Coin` (owner need to points to an input which has an owner field) From 0e9244a4380596fec10a6c0c0313ef9aec8b2592 Mon Sep 17 00:00:00 2001 From: AurelienFT <32803821+AurelienFT@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:15:26 +0100 Subject: [PATCH 5/5] Update src/tx-format/policy.md Co-authored-by: Brandon Kite --- src/tx-format/policy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tx-format/policy.md b/src/tx-format/policy.md index 39af7fbd..b97d8b33 100644 --- a/src/tx-format/policy.md +++ b/src/tx-format/policy.md @@ -74,4 +74,4 @@ Transaction is invalid if: Transaction is invalid if: - `owner >= inputs.len()` -- `inputs[owner] != InputType::Message && inputs[owner] != InputType::Coin` (owner need to points to an input which has an owner field) +- `inputs[owner] != InputType::Message && inputs[owner] != InputType::Coin` (must point to an input type that supports ownership)