Skip to content

Conversation

@LePremierHomme
Copy link
Contributor

@LePremierHomme LePremierHomme commented Jan 18, 2026

Closes #1522

This is a simplified version of the task, where all non-direct message routing support is removed, including sibling-to-sibling.

Rationale

Removes untested complexity before refactoring the IPC contracts codebase. Multi-hop routing was complex, untested, and not currently used in production.


Note

Refactors cross-net messaging to support only direct parent–child hops; removes multi-hop routing and the postbox/propagation flow.

  • Deletes postbox storage, events, getters, and all propagate* code; removes IGateway.propagateAll and related facet methods/selectors
  • Enforces direct-only routing: LibGateway.checkCrossMessage rejects non-direct paths with new InvalidXnetMessageReason.NonDirect; applyMsg reverts on non-local destinations
  • Simplifies validation by dropping LCA/supply-compat checks; removes LCA inversion in commitValidatedCrossMessage
  • Adds NonDirect error enum; cleans up unused errors and methods
  • Router/getter facets and checkpointing no longer trigger propagation side-effects
  • Tests updated to reflect direct-only behavior (expect reverts for L1↔L3 and sibling↔sibling), adjust token path usage, fix assumptions, and skip multi-hop scenarios
  • Selector tables updated to match removed functions

Written by Cursor Bugbot for commit 6ab7712. This will update automatically on new commits. Configure here.

@LePremierHomme LePremierHomme requested a review from a team as a code owner January 18, 2026 15:38
@LePremierHomme LePremierHomme marked this pull request as draft January 18, 2026 15:40
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if (!supplySourcesCompatible) {
return (false, InvalidXnetMessageReason.IncompatibleSupplySource, applyType);
if (!isDirect) {
return (false, InvalidXnetMessageReason.NonDirect, applyType);
Copy link

Choose a reason for hiding this comment

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

Direct message validation allows cross-branch messages

Medium Severity

The isDirect validation in checkCrossMessage only checks that route lengths differ by exactly 1, but doesn't verify the subnets are actually in a parent-child relationship. A message from /root/A/B to /root/X (different branch, not the actual parent /root/A) would pass validation because both have route length difference of 1. For BottomUp messages, this would allow the message to be committed to the checkpoint. When the parent /root/A processes it, applyMsg sees destination /root/X doesn't equal current network and triggers a hard revert("Only direct messaging supported"), potentially failing the entire message batch execution.

Fix in Cursor Fix in Web

@LePremierHomme LePremierHomme marked this pull request as ready for review January 19, 2026 14:04
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

Successfully merging this pull request may close these issues.

Remove code related to non-direct messaging

4 participants