From eec74000736a277646c68ebcdcabc9eab0d0003c Mon Sep 17 00:00:00 2001 From: hexshire Date: Thu, 22 May 2025 19:57:28 -0300 Subject: [PATCH] feat: update context --- ecosystem/l2tol2cdm-sentmsg-ctx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecosystem/l2tol2cdm-sentmsg-ctx.md b/ecosystem/l2tol2cdm-sentmsg-ctx.md index 13b20b50..d378ae04 100644 --- a/ecosystem/l2tol2cdm-sentmsg-ctx.md +++ b/ecosystem/l2tol2cdm-sentmsg-ctx.md @@ -47,7 +47,7 @@ is likely too low level. --> Introudce opaque context bytes field in `SentMessage`. This field MUST be versioned such that it can evolve with new or removed fields. ```solidity -event SentMessage(uint256 indexed destination, address indexed target, uint256 indexed messageNonce, address sender, bytes message, bytes context); +event SentMessage(uint256 indexed destination, address indexed target, uint256 indexed messageNonce, address sender, bytes message, bytes originContext); ``` This proposal simply includes this field without specifying the first versioned format. By leaving it as empty for now, we can populate the first version in a later @@ -56,7 +56,7 @@ design that requires it. - See [RelayedMessageGasReceipt](https://github.com/ethereum-optimism/design-docs/pull/282). - See [incentivized message delivery](https://github.com/ethereum-optimism/design-docs/pull/272). -**Note**: The context itself **MUST** be included in the pre-image of the cross domain message hash. While `CrossL2Inbox` validation ensures log integrity, we must include the context in the preimage in order for `resendMessage` which re-emits stale `SentMessage` event to gaurantee that context hasn't been tampered with. +**Note**: The context itself **MUST** be included in the pre-image of the cross domain message hash. While `CrossL2Inbox` validation ensures log integrity, we must include the context in the preimage in order for `resendMessage` which re-emits stale `SentMessage` event to gaurantee that context hasn't been tampered with. The pre-image hashing process begins by computing the messagePayloadHash from the core message payload. The originContext is then constructed by encoding the ORIGIN_CONTEXT_ENCODING_VERSION alongside the messagePayloadHash. Finally, the messageHash is derived by hashing the messagePayloadHash and the originContext together. ## Resource Usage