Skip to content
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

Partial Fast Bridge #36

Merged
merged 9 commits into from
Feb 8, 2022
Merged

Partial Fast Bridge #36

merged 9 commits into from
Feb 8, 2022

Conversation

shalzz
Copy link
Contributor

@shalzz shalzz commented Feb 4, 2022

This still needs access control around the fast bridge, but It shouldn't be a blocker for the demo.

@shalzz shalzz marked this pull request as ready for review February 4, 2022 10:32
@jaybuidl jaybuidl self-requested a review February 4, 2022 10:42
@jaybuidl jaybuidl assigned shalzz and unassigned shalzz and jaybuidl Feb 4, 2022
@jaybuidl jaybuidl linked an issue Feb 4, 2022 that may be closed by this pull request
@jaybuidl jaybuidl added this to the prealpha-1 milestone Feb 4, 2022
@jaybuidl jaybuidl changed the title Feature/fast bridge Partial Fast Bridge Feb 4, 2022
- 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.
@jaybuidl jaybuidl assigned jaybuidl and unassigned jaybuidl Feb 7, 2022
contract SafeArbitrumBridge --> SafeBridgeArbitrum
contract SafeGnosisBridge --> SafeBridgeGnosis
function sendCrossDomainMessage() --> sendSafe()
event DisputeHash --> OutgoingDispute
event OutboxMessage --> OutgoingMessage
event ClaimMade --> ClaimReceived
parameter messagePreImage --> message
@codeclimate
Copy link

codeclimate bot commented Feb 8, 2022

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()
Copy link
Contributor Author

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.

Copy link
Member

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.");
Copy link
Contributor Author

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.

@jaybuidl jaybuidl deleted the feature/fast-bridge branch February 16, 2022 11:33
@jaybuidl jaybuidl restored the feature/fast-bridge branch November 24, 2022 02:59
@jaybuidl jaybuidl deleted the feature/fast-bridge branch November 24, 2022 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partial Fast Bridge - happy path only, no Merkle tree
2 participants