Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Bridge Relayer Integration Summary
📋 Overview
Adds a node-integrated bridge relayer that listens for
BridgeOut::BridgeToL1Lockedevents and calls the L1 BridgeMinter on Ethereum (Sepolia) to mint and deposit to Base L2 via the canonical bridge.🔑 Key Changes
Enables relayer when
BRIDGE_ENABLEis true; merges env config.Reads
System::Eventsfrom storage each imported block.Matches
RuntimeEvent::BridgeOut(BridgeToL1Locked { … }).Scales native amount → ERC20 using
BRIDGE_SUBSTRATE_DECIMALSandBRIDGE_ERC20_DECIMALS.Builds
eventIdand invokesBridgeMinter.mintAndBridgevia Foundry cast.Adds
pallet-bridge-outdependency for event type matching.⚙️ Configuration
Environment Variables:
BRIDGE_ENABLE=trueBRIDGE_L1_RPCBRIDGE_MINTERBRIDGE_PKBRIDGE_L1_TOKENBRIDGE_L2_GASBRIDGE_SUBSTRATE_DECIMALSBRIDGE_ERC20_DECIMALSDependencies:
PATHon the node host.🛠️ How It Works
BridgeOut.lock_for_base(amount, l2_recipient), the relayer:eventId = keccak256(block_hash || nonce_le || l2_recipient).amountto ERC20 units.mintAndBridge(eventId, to, amountWei, l2Gas).BridgeMinter.consumed(eventId).🧪 Testing
BridgeOut.lock_for_basefrom Polkadot.js Apps.Consumed/Bridged).🔮 Follow-ups
📚 Quick Reviewer References
subspace/node/src/relayer.rscargo.toml