-
Notifications
You must be signed in to change notification settings - Fork 49
Partial Fast Bridge #36
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
Conversation
fae6471
to
dfe5ee8
Compare
- sendFast() doesn't need to call the SafeBridge, we can let an incentivized party do it. - Moved the call to the SafeBridge to a separate sendSafe() function, payable in case any bridging fee is needed. - ForeignGateway.relayRuling() may be called twice (by both the safe and fast bridges) without issue because we mark the ruling as relayed the first time and check it.
contract SafeArbitrumBridge --> SafeBridgeArbitrum contract SafeGnosisBridge --> SafeBridgeGnosis function sendCrossDomainMessage() --> sendSafe() event DisputeHash --> OutgoingDispute event OutboxMessage --> OutgoingMessage event ClaimMade --> ClaimReceived parameter messagePreImage --> message
Code Climate has analyzed commit 4adff44 and detected 0 issues on this pull request. View more on Code Climate. |
// The safe bridge sends the encoded data to the FastBridgeReceiver | ||
// in order for the FastBridgeReceiver to resolve any potential | ||
// challenges and then forwards the message to the actual | ||
// intended recipient encoded in `data` | ||
// TODO: For this encodedData needs to be wrapped into an | ||
// IFastBridgeReceiver function. | ||
// TODO: add access checks for this on the FastBridgeReceiver. | ||
safebridge.sendCrossDomainMessage(address(fastBridgeReceiver), encodedData); | ||
// TODO: how much ETH should be provided for bridging? add an ISafeBridge.bridgingCost() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bridging from L2 to L1 does not need any bridging cost/fees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Given the existing native bridges, the fees would be required only for L1 to L2, and we are not using the SafeBridge for it right now. So it's more for future proofing.
* @param _receiver The L1 contract address who will receive the calldata | ||
* @param _calldata The receiving domain encoded message data. | ||
*/ | ||
function sendFast(address _receiver, bytes memory _calldata) external { | ||
require(msg.sender == fastSender, "Access not allowed: Fast Sender only."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I didn't add this initially was to make the fast bridge app-agnostic.
This still needs access control around the fast bridge, but It shouldn't be a blocker for the demo.