From 699eb78f04dd67186cb3e39407c4bedf44b93f22 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 4 Jul 2025 10:38:45 -0600 Subject: [PATCH 01/14] Add Gateway Attributes for Message Control --- ERCS/erc-xxxx.md | 111 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 ERCS/erc-xxxx.md diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md new file mode 100644 index 00000000000..924e9d95900 --- /dev/null +++ b/ERCS/erc-xxxx.md @@ -0,0 +1,111 @@ +--- +eip: XXXX +title: Gateway Attributes for Message Control +description: Gateway attributes for cancellation, timeout, retry, dependencies, and execution control in cross-chain messaging. +author: Ernesto García (@ernestognw), Kalman Lajko (@LajkoKalman), Valera Grinenko (@0xValera) +discussions-to: TODO +status: Draft +type: Standards Track +category: ERC +created: 2024-XX-XX +requires: 7786 +--- + +## Abstract + +This ERC defines standard attributes for ERC-7786 cross-chain messaging gateways to enable consistent cancellation, timeout, retry, dependency, and execution control mechanisms across implementations. These attributes provide applications with predictable control over message lifecycle, ordering, and execution requirements. + +## Motivation + +ERC-7786 introduces an extensible attribute system for cross-chain messaging, but leaves attribute standardization to follow-up specifications. As cross-chain applications mature, consistent patterns for message control have emerged as essential requirements: + +1. **Cancellation**: Applications need to cancel pending messages due to changed conditions +2. **Timeouts**: Automatic cancellation prevents indefinite pending states +3. **Retry Logic**: Standardized failure handling improves reliability +4. **Revert Behavior**: Consistent error semantics across gateways +5. **Message Dependencies**: Ensuring correct ordering when messages must execute in sequence +6. **Gas Requirements**: Preventing execution failures due to insufficient gas +7. **Execution Timing**: Controlling when messages can be executed for scheduling and coordination + +Without standardized attributes, each gateway implements these features differently, fragmenting the ecosystem and requiring application-specific integration logic. + +## Specification + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. + +### Standard Attributes + +This specification defines standard attributes for ERC-7786 cross-chain messaging gateways. + +Gateways MAY implement attributes independently. Gateways MUST validate the attribute's encoding for each attribute they implement and revert the transaction if the encoding is invalid. + +#### `cancellable(bool)` + +Indicates whether a message can be cancelled after submission. This attribute uses selector `0xde986d7f`, which represents the first 4 bytes of `keccak256("cancellable(bool)")`. + +The attribute value is encoded as an ABI-encoded boolean, and COULD default to `false` when not specified. When set to `true`, gateways MUST provide a cancellation mechanism to allow applications to cancel pending messages due to changed conditions or requirements. + +#### `timeout(uint256)` + +Specifies a timestamp after which the message is automatically cancelled. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. + +The value is encoded as an ABI-encoded Unix timestamp, and COULD default to `0` when not specified. Gateways MUST NOT execute messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. + +#### `earliestExecTime(uint256)` + +Specifies the earliest timestamp at which the message can be executed. This attribute uses selector `0x6c5875a2`, derived from the first 4 bytes of `keccak256("earliestExecTime(uint256)")`. + +The value is encoded as an ABI-encoded Unix timestamp, and COULD default to `0` when not specified. Gateways MUST NOT execute messages before the earliestExecTime timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `timeout(uint256)`, this creates an execution time window. + +#### `retryPolicy(bytes)` + +Defines retry behavior for failed message execution. Using selector `0xf002c055` from the first 4 bytes of `keccak256("retryPolicy(bytes)")`, this attribute encodes retry parameters as ABI-encoded bytes. + +The format follows `abi.encodePacked(uint16(maxRetries), uint32(retryDelay), uint32(backoffMultiplier))`, where `maxRetries` specifies the maximum number of retry attempts (with 0 indicating no retries), `retryDelay` defines the initial delay between retries in seconds, and `backoffMultiplier` provides the multiplier for exponential backoff in basis points (with 10000 representing 1x multiplier). + +The attribute value COULD default to `0x` when not specified, equivalent to infinite retries, no delay, and no backoff (or `maxRetries = 0`, `retryDelay = 0`, and `backoffMultiplier = 0`). + +#### `revertBehavior(uint8)` + +Specifies how execution failures MUST be handled. This attribute uses selector `0x9e521a77`, representing the first 4 bytes of `keccak256("revertBehavior(uint8)")`. + +The value is encoded as an ABI-encoded uint8 with three possible values: `0` for silent failure (the default behavior), `1` for reverting the transaction, and `2` for emitting a failure event and continuing execution. When not specified, the attribute defaults to `0`. + +#### `dependsOn(bytes32[])` + +Specifies message dependencies that must be executed before this message. This attribute uses selector `0xa9fed7b9`, derived from the first 4 bytes of `keccak256("dependsOn(bytes32[])")`. + +The value is encoded as an ABI-encoded array of message identifiers. Gateways MUST NOT execute a message until all messages specified in the `dependsOn` array have been successfully executed. When not specified or empty, the message has no dependencies. This ensures correct ordering and prevents out-of-order delivery issues. + +#### `minGasLimit(uint256)` + +Specifies the minimum gas limit required for message execution. This attribute uses selector `0x39f87ba1`, derived from the first 4 bytes of `keccak256("minGasLimit(uint256)")`. + +The value is encoded as an ABI-encoded uint256 representing the minimum gas units required. Gateways MUST ensure at least this amount of gas is available before attempting message execution. When not specified, gateways MAY use their default gas allocation strategies. + +## Rationale + +These attributes address the most common cross-chain message control requirements: + +- **Lifecycle control** via cancellation and timeout mechanisms +- **Execution timing** through earliest execution time and timeout windows +- **Failure handling** via retry policies and revert behavior +- **Message ordering** through dependency chains +- **Execution guarantees** via minimum gas requirements + +The byte-encoded retry policy allows for extensible parameters without requiring additional attributes. The dependency mechanism enables complex multi-message workflows while maintaining simplicity for single-message scenarios. + +## Backwards Compatibility + +This specification extends ERC-7786 without breaking changes. Gateways not supporting these attributes will operate normally per the base specification's requirement to handle unknown attributes gracefully. + +## Security Considerations + + + + + + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). From 6274a9c698e9d91cc3abe4b616fc651433e656ef Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 4 Jul 2025 15:19:20 -0600 Subject: [PATCH 02/14] Reorder enum values so 0 (default) means revert instead of silent failure --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 924e9d95900..0446930ffb3 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -69,7 +69,7 @@ The attribute value COULD default to `0x` when not specified, equivalent to infi Specifies how execution failures MUST be handled. This attribute uses selector `0x9e521a77`, representing the first 4 bytes of `keccak256("revertBehavior(uint8)")`. -The value is encoded as an ABI-encoded uint8 with three possible values: `0` for silent failure (the default behavior), `1` for reverting the transaction, and `2` for emitting a failure event and continuing execution. When not specified, the attribute defaults to `0`. +The value is encoded as an ABI-encoded uint8 with three possible values: `0` for reverting the transaction (the default behavior), `1` for emitting a failure event and continuing execution, and `2` for silent failure. When not specified, the attribute defaults to `0`. #### `dependsOn(bytes32[])` From be754a5befa426cb6c24aa5d0cc57d61c1742929 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 4 Jul 2025 15:20:48 -0600 Subject: [PATCH 03/14] Address ERC feedback --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 0446930ffb3..a6f288b2e29 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -47,7 +47,7 @@ The attribute value is encoded as an ABI-encoded boolean, and COULD default to ` #### `timeout(uint256)` -Specifies a timestamp after which the message is automatically cancelled. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. +Specifies a timestamp after which the message cannot be executed. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. The value is encoded as an ABI-encoded Unix timestamp, and COULD default to `0` when not specified. Gateways MUST NOT execute messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. From b5d8ca7fb0a47791234cb497f97f88775dbd0df5 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 11:44:28 -0600 Subject: [PATCH 04/14] Review feedback --- ERCS/erc-xxxx.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index a6f288b2e29..8eaeca815e7 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -43,19 +43,19 @@ Gateways MAY implement attributes independently. Gateways MUST validate the attr Indicates whether a message can be cancelled after submission. This attribute uses selector `0xde986d7f`, which represents the first 4 bytes of `keccak256("cancellable(bool)")`. -The attribute value is encoded as an ABI-encoded boolean, and COULD default to `false` when not specified. When set to `true`, gateways MUST provide a cancellation mechanism to allow applications to cancel pending messages due to changed conditions or requirements. +The attribute value is encoded as an ABI-encoded boolean, and MAY default to `false` when not specified. When set to `true`, gateways MUST provide a cancellation mechanism to allow applications to cancel pending messages due to changed conditions or requirements. #### `timeout(uint256)` Specifies a timestamp after which the message cannot be executed. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. -The value is encoded as an ABI-encoded Unix timestamp, and COULD default to `0` when not specified. Gateways MUST NOT execute messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. +The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT execute messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. #### `earliestExecTime(uint256)` Specifies the earliest timestamp at which the message can be executed. This attribute uses selector `0x6c5875a2`, derived from the first 4 bytes of `keccak256("earliestExecTime(uint256)")`. -The value is encoded as an ABI-encoded Unix timestamp, and COULD default to `0` when not specified. Gateways MUST NOT execute messages before the earliestExecTime timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `timeout(uint256)`, this creates an execution time window. +The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT execute messages before the earliestExecTime timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `timeout(uint256)`, this creates an execution time window. #### `retryPolicy(bytes)` @@ -63,13 +63,30 @@ Defines retry behavior for failed message execution. Using selector `0xf002c055` The format follows `abi.encodePacked(uint16(maxRetries), uint32(retryDelay), uint32(backoffMultiplier))`, where `maxRetries` specifies the maximum number of retry attempts (with 0 indicating no retries), `retryDelay` defines the initial delay between retries in seconds, and `backoffMultiplier` provides the multiplier for exponential backoff in basis points (with 10000 representing 1x multiplier). -The attribute value COULD default to `0x` when not specified, equivalent to infinite retries, no delay, and no backoff (or `maxRetries = 0`, `retryDelay = 0`, and `backoffMultiplier = 0`). +The attribute value MAY default to `0x` when not specified, equivalent to infinite retries, no delay, and no backoff (or `maxRetries = 0`, `retryDelay = 0`, and `backoffMultiplier = 0`). #### `revertBehavior(uint8)` Specifies how execution failures MUST be handled. This attribute uses selector `0x9e521a77`, representing the first 4 bytes of `keccak256("revertBehavior(uint8)")`. -The value is encoded as an ABI-encoded uint8 with three possible values: `0` for reverting the transaction (the default behavior), `1` for emitting a failure event and continuing execution, and `2` for silent failure. When not specified, the attribute defaults to `0`. +The value is encoded as an ABI-encoded uint8 with the following possible values: + +**`0` – Revert on Failure** + +- Gateways MUST revert the entire message execution when any failure occurs. +- Gateways SHOULD propagate the original failure reason when reverting. + +**`1` – Emit-and-Continue** + +- Gateways MUST emit a `MessageFailed(bytes32 messageId, string reason)` event upon failure. +- Gateways MUST continue execution of subsequent messages or operations. + +**`2` – Silent Failure** + +- Gateways MUST NOT revert the transaction +- Gateways MUST NOT emit any failure-related events. + +When not specified, the attribute MUST default to `0`. #### `dependsOn(bytes32[])` @@ -85,6 +102,8 @@ The value is encoded as an ABI-encoded uint256 representing the minimum gas unit ## Rationale +These attributes build upon ERC-7786's fundamental message lifecycle (posted via `MessagePosted` event, then executed via `executeMessage` call) by adding execution control and lifecycle management. While status tracking implementation is gateway-specific, gateways implementing these attributes must maintain sufficient state to enforce behavioral requirements such as cancellation state, dependency completion, retry attempts, and execution timing constraints. + These attributes address the most common cross-chain message control requirements: - **Lifecycle control** via cancellation and timeout mechanisms From 25dc0d30287041e039071599f10fd1eddda463eb Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 12:03:52 -0600 Subject: [PATCH 05/14] update --- ERCS/erc-xxxx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 8eaeca815e7..d886ca336fe 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -78,7 +78,7 @@ The value is encoded as an ABI-encoded uint8 with the following possible values: **`1` – Emit-and-Continue** -- Gateways MUST emit a `MessageFailed(bytes32 messageId, string reason)` event upon failure. +- Gateways MUST emit a `MessageFailed(bytes32 sendId, string reason)` event upon failure. - Gateways MUST continue execution of subsequent messages or operations. **`2` – Silent Failure** @@ -102,7 +102,7 @@ The value is encoded as an ABI-encoded uint256 representing the minimum gas unit ## Rationale -These attributes build upon ERC-7786's fundamental message lifecycle (posted via `MessagePosted` event, then executed via `executeMessage` call) by adding execution control and lifecycle management. While status tracking implementation is gateway-specific, gateways implementing these attributes must maintain sufficient state to enforce behavioral requirements such as cancellation state, dependency completion, retry attempts, and execution timing constraints. +These attributes build upon ERC-7786's fundamental message lifecycle (sent via `MessageSent` event, then delivered via `receiveMessage` call) by adding execution control and lifecycle management. While status tracking implementation is gateway-specific, gateways implementing these attributes must maintain sufficient state to enforce behavioral requirements such as cancellation state, dependency completion, retry attempts, and execution timing constraints. These attributes address the most common cross-chain message control requirements: From 1435b9da72508ec69c2269c6507df48bc1ce3f81 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 12:04:28 -0600 Subject: [PATCH 06/14] Execute -> Deliver --- ERCS/erc-xxxx.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index d886ca336fe..31676ddd610 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -1,7 +1,7 @@ --- eip: XXXX title: Gateway Attributes for Message Control -description: Gateway attributes for cancellation, timeout, retry, dependencies, and execution control in cross-chain messaging. +description: Gateway attributes for cancellation, timeout, retry, dependencies, and delivery control in cross-chain messaging. author: Ernesto García (@ernestognw), Kalman Lajko (@LajkoKalman), Valera Grinenko (@0xValera) discussions-to: TODO status: Draft @@ -13,7 +13,7 @@ requires: 7786 ## Abstract -This ERC defines standard attributes for ERC-7786 cross-chain messaging gateways to enable consistent cancellation, timeout, retry, dependency, and execution control mechanisms across implementations. These attributes provide applications with predictable control over message lifecycle, ordering, and execution requirements. +This ERC defines standard attributes for ERC-7786 cross-chain messaging gateways to enable consistent cancellation, timeout, retry, dependency, and delivery control mechanisms across implementations. These attributes provide applications with predictable control over message lifecycle, ordering, and delivery requirements. ## Motivation @@ -23,9 +23,9 @@ ERC-7786 introduces an extensible attribute system for cross-chain messaging, bu 2. **Timeouts**: Automatic cancellation prevents indefinite pending states 3. **Retry Logic**: Standardized failure handling improves reliability 4. **Revert Behavior**: Consistent error semantics across gateways -5. **Message Dependencies**: Ensuring correct ordering when messages must execute in sequence -6. **Gas Requirements**: Preventing execution failures due to insufficient gas -7. **Execution Timing**: Controlling when messages can be executed for scheduling and coordination +5. **Message Dependencies**: Ensuring correct ordering when messages must deliver in sequence +6. **Gas Requirements**: Preventing delivery failures due to insufficient gas +7. **Execution Timing**: Controlling when messages can be delivered for scheduling and coordination Without standardized attributes, each gateway implements these features differently, fragmenting the ecosystem and requiring application-specific integration logic. @@ -47,19 +47,19 @@ The attribute value is encoded as an ABI-encoded boolean, and MAY default to `fa #### `timeout(uint256)` -Specifies a timestamp after which the message cannot be executed. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. +Specifies a timestamp after which the message cannot be delivered. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. -The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT execute messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. +The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT deliver messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. #### `earliestExecTime(uint256)` -Specifies the earliest timestamp at which the message can be executed. This attribute uses selector `0x6c5875a2`, derived from the first 4 bytes of `keccak256("earliestExecTime(uint256)")`. +Specifies the earliest timestamp at which the message can be delivered. This attribute uses selector `0x6c5875a2`, derived from the first 4 bytes of `keccak256("earliestExecTime(uint256)")`. -The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT execute messages before the earliestExecTime timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `timeout(uint256)`, this creates an execution time window. +The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT deliver messages before the earliestExecTime timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `timeout(uint256)`, this creates an delivery time window. #### `retryPolicy(bytes)` -Defines retry behavior for failed message execution. Using selector `0xf002c055` from the first 4 bytes of `keccak256("retryPolicy(bytes)")`, this attribute encodes retry parameters as ABI-encoded bytes. +Defines retry behavior for failed message delivery. Using selector `0xf002c055` from the first 4 bytes of `keccak256("retryPolicy(bytes)")`, this attribute encodes retry parameters as ABI-encoded bytes. The format follows `abi.encodePacked(uint16(maxRetries), uint32(retryDelay), uint32(backoffMultiplier))`, where `maxRetries` specifies the maximum number of retry attempts (with 0 indicating no retries), `retryDelay` defines the initial delay between retries in seconds, and `backoffMultiplier` provides the multiplier for exponential backoff in basis points (with 10000 representing 1x multiplier). @@ -67,19 +67,19 @@ The attribute value MAY default to `0x` when not specified, equivalent to infini #### `revertBehavior(uint8)` -Specifies how execution failures MUST be handled. This attribute uses selector `0x9e521a77`, representing the first 4 bytes of `keccak256("revertBehavior(uint8)")`. +Specifies how delivery failures MUST be handled. This attribute uses selector `0x9e521a77`, representing the first 4 bytes of `keccak256("revertBehavior(uint8)")`. The value is encoded as an ABI-encoded uint8 with the following possible values: **`0` – Revert on Failure** -- Gateways MUST revert the entire message execution when any failure occurs. +- Gateways MUST revert the entire message delivery when any failure occurs. - Gateways SHOULD propagate the original failure reason when reverting. **`1` – Emit-and-Continue** - Gateways MUST emit a `MessageFailed(bytes32 sendId, string reason)` event upon failure. -- Gateways MUST continue execution of subsequent messages or operations. +- Gateways MUST continue delivery of subsequent messages or operations. **`2` – Silent Failure** @@ -90,27 +90,27 @@ When not specified, the attribute MUST default to `0`. #### `dependsOn(bytes32[])` -Specifies message dependencies that must be executed before this message. This attribute uses selector `0xa9fed7b9`, derived from the first 4 bytes of `keccak256("dependsOn(bytes32[])")`. +Specifies message dependencies that must be delivered before this message. This attribute uses selector `0xa9fed7b9`, derived from the first 4 bytes of `keccak256("dependsOn(bytes32[])")`. -The value is encoded as an ABI-encoded array of message identifiers. Gateways MUST NOT execute a message until all messages specified in the `dependsOn` array have been successfully executed. When not specified or empty, the message has no dependencies. This ensures correct ordering and prevents out-of-order delivery issues. +The value is encoded as an ABI-encoded array of message identifiers. Gateways MUST NOT deliver a message until all messages specified in the `dependsOn` array have been successfully delivered. When not specified or empty, the message has no dependencies. This ensures correct ordering and prevents out-of-order delivery issues. #### `minGasLimit(uint256)` -Specifies the minimum gas limit required for message execution. This attribute uses selector `0x39f87ba1`, derived from the first 4 bytes of `keccak256("minGasLimit(uint256)")`. +Specifies the minimum gas limit required for message delivery. This attribute uses selector `0x39f87ba1`, derived from the first 4 bytes of `keccak256("minGasLimit(uint256)")`. -The value is encoded as an ABI-encoded uint256 representing the minimum gas units required. Gateways MUST ensure at least this amount of gas is available before attempting message execution. When not specified, gateways MAY use their default gas allocation strategies. +The value is encoded as an ABI-encoded uint256 representing the minimum gas units required. Gateways MUST ensure at least this amount of gas is available before attempting message delivery. When not specified, gateways MAY use their default gas allocation strategies. ## Rationale -These attributes build upon ERC-7786's fundamental message lifecycle (sent via `MessageSent` event, then delivered via `receiveMessage` call) by adding execution control and lifecycle management. While status tracking implementation is gateway-specific, gateways implementing these attributes must maintain sufficient state to enforce behavioral requirements such as cancellation state, dependency completion, retry attempts, and execution timing constraints. +These attributes build upon ERC-7786's fundamental message lifecycle (sent via `MessageSent` event, then delivered via `receiveMessage` call) by adding delivery control and lifecycle management. While status tracking implementation is gateway-specific, gateways implementing these attributes must maintain sufficient state to enforce behavioral requirements such as cancellation state, dependency completion, retry attempts, and delivery timing constraints. These attributes address the most common cross-chain message control requirements: - **Lifecycle control** via cancellation and timeout mechanisms -- **Execution timing** through earliest execution time and timeout windows +- **Delivery timing** through earliest delivery time and timeout windows - **Failure handling** via retry policies and revert behavior - **Message ordering** through dependency chains -- **Execution guarantees** via minimum gas requirements +- **Delivery guarantees** via minimum gas requirements The byte-encoded retry policy allows for extensible parameters without requiring additional attributes. The dependency mechanism enables complex multi-message workflows while maintaining simplicity for single-message scenarios. From 72aff2b19ff9299f1a549a7a30522fbd92526a18 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 12:07:45 -0600 Subject: [PATCH 07/14] reword --- ERCS/erc-xxxx.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 31676ddd610..8bf96125f65 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -35,7 +35,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S ### Standard Attributes -This specification defines standard attributes for ERC-7786 cross-chain messaging gateways. +This specification defines standard attributes for ERC-7786 cross-chain messaging gateways. The word "delivery" (or "deliver") is used to refer to the process of delivering a message to the destination chain, similar to its usage in ERC-7786. Gateways MAY implement attributes independently. Gateways MUST validate the attribute's encoding for each attribute they implement and revert the transaction if the encoding is invalid. @@ -102,8 +102,6 @@ The value is encoded as an ABI-encoded uint256 representing the minimum gas unit ## Rationale -These attributes build upon ERC-7786's fundamental message lifecycle (sent via `MessageSent` event, then delivered via `receiveMessage` call) by adding delivery control and lifecycle management. While status tracking implementation is gateway-specific, gateways implementing these attributes must maintain sufficient state to enforce behavioral requirements such as cancellation state, dependency completion, retry attempts, and delivery timing constraints. - These attributes address the most common cross-chain message control requirements: - **Lifecycle control** via cancellation and timeout mechanisms From be13dfdc5a0195d0ecbeb577d48160bab3f0f8af Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 12:08:28 -0600 Subject: [PATCH 08/14] up --- ERCS/erc-xxxx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 8bf96125f65..15d8963afe3 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -25,7 +25,7 @@ ERC-7786 introduces an extensible attribute system for cross-chain messaging, bu 4. **Revert Behavior**: Consistent error semantics across gateways 5. **Message Dependencies**: Ensuring correct ordering when messages must deliver in sequence 6. **Gas Requirements**: Preventing delivery failures due to insufficient gas -7. **Execution Timing**: Controlling when messages can be delivered for scheduling and coordination +7. **Delivery Timing**: Controlling when messages can be delivered for scheduling and coordination Without standardized attributes, each gateway implements these features differently, fragmenting the ecosystem and requiring application-specific integration logic. From a17a1e82b4ec74929052d38973cbbb07fc422329 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 12:13:21 -0600 Subject: [PATCH 09/14] timeout and earliestExecTime -> deliverBefore and deliverAfter --- ERCS/erc-xxxx.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index 15d8963afe3..eed5368ef02 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -45,17 +45,17 @@ Indicates whether a message can be cancelled after submission. This attribute us The attribute value is encoded as an ABI-encoded boolean, and MAY default to `false` when not specified. When set to `true`, gateways MUST provide a cancellation mechanism to allow applications to cancel pending messages due to changed conditions or requirements. -#### `timeout(uint256)` +#### `deliverBefore(uint256)` -Specifies a timestamp after which the message cannot be delivered. This attribute uses selector `0x08148f7a`, derived from the first 4 bytes of `keccak256("timeout(uint256)")`. +Specifies a timestamp after which the message cannot be delivered. This attribute uses selector `0x3e97d7ee`, derived from the first 4 bytes of `keccak256("deliverBefore(uint256)")`. -The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT deliver messages after the timeout timestamp unless `0` is specified, which MUST be interpreted as no timeout. +The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT deliver messages after the expiration timestamp unless `0` is specified, which MUST be interpreted as no expiration. -#### `earliestExecTime(uint256)` +#### `deliverAfter(uint256)` -Specifies the earliest timestamp at which the message can be delivered. This attribute uses selector `0x6c5875a2`, derived from the first 4 bytes of `keccak256("earliestExecTime(uint256)")`. +Specifies the earliest timestamp at which the message can be delivered. This attribute uses selector `0x745910eb`, derived from the first 4 bytes of `keccak256("deliverAfter(uint256)")`. -The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT deliver messages before the earliestExecTime timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `timeout(uint256)`, this creates an delivery time window. +The value is encoded as an ABI-encoded Unix timestamp, and MAY default to `0` when not specified. Gateways MUST NOT deliver messages before the delivery timestamp unless `0` is specified, which MUST be interpreted as no delay. When combined with `deliverBefore(uint256)`, this creates a delivery time window. #### `retryPolicy(bytes)` @@ -105,7 +105,7 @@ The value is encoded as an ABI-encoded uint256 representing the minimum gas unit These attributes address the most common cross-chain message control requirements: - **Lifecycle control** via cancellation and timeout mechanisms -- **Delivery timing** through earliest delivery time and timeout windows +- **Delivery timing** through delivery time windows - **Failure handling** via retry policies and revert behavior - **Message ordering** through dependency chains - **Delivery guarantees** via minimum gas requirements From 7568b07326de510f11c59ebee759700c2496243e Mon Sep 17 00:00:00 2001 From: ernestognw Date: Mon, 7 Jul 2025 17:03:37 -0600 Subject: [PATCH 10/14] up --- ERCS/erc-xxxx.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-xxxx.md index eed5368ef02..b6382188e81 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-xxxx.md @@ -13,11 +13,13 @@ requires: 7786 ## Abstract -This ERC defines standard attributes for ERC-7786 cross-chain messaging gateways to enable consistent cancellation, timeout, retry, dependency, and delivery control mechanisms across implementations. These attributes provide applications with predictable control over message lifecycle, ordering, and delivery requirements. +This ERC defines standard attributes for [ERC-7786] cross-chain messaging gateways to enable consistent cancellation, timeout, retry, dependency, and delivery control mechanisms across implementations. These attributes provide applications with predictable control over message lifecycle, ordering, and delivery requirements. + +[ERC-7786]: ./erc-7786.md ## Motivation -ERC-7786 introduces an extensible attribute system for cross-chain messaging, but leaves attribute standardization to follow-up specifications. As cross-chain applications mature, consistent patterns for message control have emerged as essential requirements: +[ERC-7786] introduces an extensible attribute system for cross-chain messaging, but leaves attribute standardization to follow-up specifications. As cross-chain applications mature, consistent patterns for message control have emerged as essential requirements: 1. **Cancellation**: Applications need to cancel pending messages due to changed conditions 2. **Timeouts**: Automatic cancellation prevents indefinite pending states @@ -35,7 +37,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S ### Standard Attributes -This specification defines standard attributes for ERC-7786 cross-chain messaging gateways. The word "delivery" (or "deliver") is used to refer to the process of delivering a message to the destination chain, similar to its usage in ERC-7786. +This specification defines standard attributes for [ERC-7786] cross-chain messaging gateways. The word "delivery" (or "deliver") is used to refer to the process of delivering a message to the destination chain, similar to its usage in [ERC-7786]. Gateways MAY implement attributes independently. Gateways MUST validate the attribute's encoding for each attribute they implement and revert the transaction if the encoding is invalid. @@ -114,7 +116,7 @@ The byte-encoded retry policy allows for extensible parameters without requiring ## Backwards Compatibility -This specification extends ERC-7786 without breaking changes. Gateways not supporting these attributes will operate normally per the base specification's requirement to handle unknown attributes gracefully. +This specification extends [ERC-7786] without breaking changes. Gateways not supporting these attributes will operate normally per the base specification's requirement to handle unknown attributes gracefully. ## Security Considerations From 868110c2a5a55a88db6e9059e98d6516457de344 Mon Sep 17 00:00:00 2001 From: Sam Wilson <57262657+SamWilsn@users.noreply.github.com> Date: Thu, 10 Jul 2025 15:06:23 -0400 Subject: [PATCH 11/14] Update and rename erc-xxxx.md to erc-7985.md --- ERCS/{erc-xxxx.md => erc-7985.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ERCS/{erc-xxxx.md => erc-7985.md} (99%) diff --git a/ERCS/erc-xxxx.md b/ERCS/erc-7985.md similarity index 99% rename from ERCS/erc-xxxx.md rename to ERCS/erc-7985.md index b6382188e81..6144a701fd7 100644 --- a/ERCS/erc-xxxx.md +++ b/ERCS/erc-7985.md @@ -1,5 +1,5 @@ --- -eip: XXXX +eip: 7985 title: Gateway Attributes for Message Control description: Gateway attributes for cancellation, timeout, retry, dependencies, and delivery control in cross-chain messaging. author: Ernesto García (@ernestognw), Kalman Lajko (@LajkoKalman), Valera Grinenko (@0xValera) From f91476a1f69f2ed476fd1815839dd328cfbdc7d3 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 11 Jul 2025 08:56:22 -0600 Subject: [PATCH 12/14] up --- ERCS/erc-7985.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-7985.md b/ERCS/erc-7985.md index 6144a701fd7..00b3acd09b8 100644 --- a/ERCS/erc-7985.md +++ b/ERCS/erc-7985.md @@ -3,11 +3,11 @@ eip: 7985 title: Gateway Attributes for Message Control description: Gateway attributes for cancellation, timeout, retry, dependencies, and delivery control in cross-chain messaging. author: Ernesto García (@ernestognw), Kalman Lajko (@LajkoKalman), Valera Grinenko (@0xValera) -discussions-to: TODO +discussions-to: https://ethereum-magicians.org/t/new-erc-attributes-for-message-control-in-erc-7786-gateways status: Draft type: Standards Track category: ERC -created: 2024-XX-XX +created: 2024-07-04 requires: 7786 --- From a213526ef69e322372df2f621e82e2429a8debcf Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 11 Jul 2025 08:57:25 -0600 Subject: [PATCH 13/14] up --- ERCS/erc-7985.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-7985.md b/ERCS/erc-7985.md index 00b3acd09b8..f92fdb6efa3 100644 --- a/ERCS/erc-7985.md +++ b/ERCS/erc-7985.md @@ -3,7 +3,7 @@ eip: 7985 title: Gateway Attributes for Message Control description: Gateway attributes for cancellation, timeout, retry, dependencies, and delivery control in cross-chain messaging. author: Ernesto García (@ernestognw), Kalman Lajko (@LajkoKalman), Valera Grinenko (@0xValera) -discussions-to: https://ethereum-magicians.org/t/new-erc-attributes-for-message-control-in-erc-7786-gateways +discussions-to: https://ethereum-magicians.org/t/new-erc-attributes-for-message-control-in-erc-7786-gateways/24734 status: Draft type: Standards Track category: ERC From 4d7ae350db0d055978c50895cbec12106d9d6260 Mon Sep 17 00:00:00 2001 From: ernestognw Date: Fri, 11 Jul 2025 10:32:57 -0600 Subject: [PATCH 14/14] up --- ERCS/erc-7985.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-7985.md b/ERCS/erc-7985.md index f92fdb6efa3..053e3e89196 100644 --- a/ERCS/erc-7985.md +++ b/ERCS/erc-7985.md @@ -15,7 +15,7 @@ requires: 7786 This ERC defines standard attributes for [ERC-7786] cross-chain messaging gateways to enable consistent cancellation, timeout, retry, dependency, and delivery control mechanisms across implementations. These attributes provide applications with predictable control over message lifecycle, ordering, and delivery requirements. -[ERC-7786]: ./erc-7786.md +[ERC-7786]: ./eip-7786.md ## Motivation