Skip to content

feat: L2ToL2CDM SentMessage originContext #15844

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

Closed

Conversation

hamdiallam
Copy link
Contributor

Implementation of Design Doc.

l2tol2cdm.sentmessage.ctx
@hamdiallam hamdiallam requested a review from a team as a code owner May 12, 2025 15:48
@hamdiallam hamdiallam requested a review from AmadiMichael May 12, 2025 15:48
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.99%. Comparing base (23c1fef) to head (b22f083).
Report is 129 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #15844      +/-   ##
===========================================
- Coverage    46.86%   45.99%   -0.87%     
===========================================
  Files         1338     1283      -55     
  Lines       108127   103891    -4236     
===========================================
- Hits         50672    47788    -2884     
+ Misses       53847    52630    -1217     
+ Partials      3608     3473     -135     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 96.06% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...acts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol 100.00% <100.00%> (ø)
...ckages/contracts-bedrock/src/libraries/Hashing.sol 95.83% <100.00%> (ø)

... and 62 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -55,17 +55,12 @@ contract L2ToL2CrossDomainMessenger is ISemver, TransientReentrancyAware {
bytes32 internal constant CROSS_DOMAIN_MESSAGE_SOURCE_SLOT =
0x711dfa3259c842fffc17d6e1f1e0fc5927756133a2345ca56b4cb8178589fee7;

/// @notice Event selector for the SentMessage event. Will be removed in favor of reading
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed with the merged bugfix

/// @return Hash of the encoded message parameters, used to uniquely identify the message.
function hashL2toL2CrossDomainMessage(
uint256 _destination,
uint256 _source,
uint256 _nonce,
address _sender,
address _target,
bytes memory _message
bytes memory _message,
bytes memory _context
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical to include here so that resendMessage works as intended

@@ -16,7 +16,7 @@ import { ISuperchainTokenBridge } from "interfaces/L2/ISuperchainTokenBridge.sol
/// @notice Integration test that checks that the `ExecutingMessage` event is emitted on crosschain mints.
contract ExecutingMessageEmittedTest is CommonTest {
bytes32 internal constant SENT_MESSAGE_EVENT_SELECTOR =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the selector property on the event itself rather than hardcoding it and needing it to change?

@@ -145,19 +146,22 @@ contract L2ToL2CrossDomainMessenger is ISemver, TransientReentrancyAware {
if (_target == Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER) revert MessageTargetL2ToL2CrossDomainMessenger();

uint256 nonce = messageNonce();
bytes memory context = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused, should there be a sendMessage(uint,address,bytes,bytes) in addition where the context can be set?

@tynes
Copy link
Contributor

tynes commented May 12, 2025

Can you link the specs PR to this PR?

edit: I see ethereum-optimism/specs#700

@opgitgovernance opgitgovernance added the S-stale Status: Will be closed unless there is activity label May 27, 2025
@opgitgovernance
Copy link

This pr has been automatically marked as stale and will be closed in 5 days if no updates

@hamdiallam hamdiallam changed the title feat: L2ToL2CDM SentMessage ctx field feat: L2ToL2CDM SentMessage originContext May 29, 2025
@hamdiallam
Copy link
Contributor Author

Closing in favor of #16150

@hamdiallam hamdiallam closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-stale Status: Will be closed unless there is activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants