Skip to content

wip: native l2 bridge adapter#765

Open
0xOsiris wants to merge 1 commit into
mainfrom
osiris/native-l2-gateway-adapter
Open

wip: native l2 bridge adapter#765
0xOsiris wants to merge 1 commit into
mainfrom
osiris/native-l2-gateway-adapter

Conversation

@0xOsiris
Copy link
Copy Markdown
Contributor

@0xOsiris 0xOsiris commented May 30, 2026

Note

High Risk
Changes cross-chain state delivery and trust boundaries (dispute game + MPT on L1, rollup messenger auth on L2); misconfiguration of L1 sender/messenger or relay addresses could block or mis-route bridged state.

Overview
Adds a native OP Stack path to bridge World ID state to L2s (e.g. Base): World Chain is still proven on L1 via dispute game + MPT, then EthereumMPTGatewayAdapter.forwardToL2 re-verifies and sends the commitment delta through L1CrossDomainMessenger to a new OpStackGatewayAdapter on L2, which only trusts the messenger + configured L1 MPT adapter as xDomainMessageSender and a chainHead(bytes32) attribute.

Contracts: new OpStackGatewayAdapter, InvalidCrossDomainSender, deploy script wiring (opStackGateway config/salt, _l1GatewayAddr tracking, L1-before-L2 deploy guards), staging config for ethereum+base. Relay: op_stack_gateways config, OpStackSatellite, and L1 send_forward_to_l2_tx alongside existing satellite types. Tests: e2e + auth failure cases with MockCrossDomainMessenger.

Reviewed by Cursor Bugbot for commit 5a538c6. Configure here.

@0xOsiris 0xOsiris requested a review from a team as a code owner May 30, 2026 01:10
Copy link
Copy Markdown
Contributor

@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 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5a538c6. Configure here.

log_wallet_status(
l1_provider.as_ref(),
wallet_address,
config.source.chain_id,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong chain_id used for OP Stack wallet metrics

Medium Severity

log_wallet_status for OP Stack satellites passes config.source.chain_id (World Chain, e.g. 480) as the chain_id metric label, but the provider is the L1 provider. Every other satellite type correctly passes the chain ID matching the provider where transactions are sent (sat_config.destination_chain_id). This causes the L1 wallet balance metric to be recorded under the World Chain chain ID, making monitoring dashboards incorrect and potentially hiding low-balance alerts for the L1 relay wallet.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5a538c6. Configure here.

chain_id = sat_config.destination_chain_id,
"registered satellite"
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing periodic wallet metrics task for OP Stack

Low Severity

The OP Stack satellite setup calls log_wallet_status but never calls spawn_wallet_metrics_task, unlike every other satellite type (permissioned and Ethereum MPT). This means the L1 relay wallet balance won't be periodically updated in metrics after the initial log, potentially hiding a depleted wallet from monitoring.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5a538c6. Configure here.

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.

1 participant