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

Feat/challenge path 4 with merkle root #81

Merged
merged 23 commits into from
Jul 27, 2022

Conversation

shotaronowhere
Copy link
Contributor

Implements unhappy path of fast bridge with batching via merkle roots. Batching is divided across epochs which are defined by an epoch period.

Each chain requires a FastBridgeSender, FastBridgeReceiver pair. Chains which require intermediation for bridging require a SafeBridgeRouter contract deployment. The safe routers are unique to each connecting pair of chains and the verifySafe, _sendSafe, and isSentBySafeBridge funcitons should be rewritten for each chain's canonical bridge. The same FastBridgeSender contract can be deployed for different receiving chains by passing the appropriate safeBridgeReceiver argument in the constructor.

All governance is removed from the FastBridge-Sender/Receiver pair contracts. Governance is pushed into the gateways. The Gateways must validate the msg.sender of calls from the fast bridge. The msg.sender on the sending chain is encoded as the first argument of any call from the fastBridgeReceiver on the receiving chain.

Tests are updated from the pre-alpha-2 single message passing bridge milestone.

TODO: Gnosis chain deployment scripts and test scripts

@netlify
Copy link

netlify bot commented Jun 9, 2022

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit 121ce42
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/62e1b634496eed00083e5b72
😎 Deploy Preview https://deploy-preview-81--kleros-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

shotaronowhere and others added 9 commits June 10, 2022 11:21
Moved to a dedicated "canonical" subfolder.
The previous folder "interfaces" was inacurrate as there were
abstracts and libraries as well.
Made the receiver verify function names more explicit:
- verify() ➝ verifyBatch()
- verifySafe() ➝ verifyBatchSafe()
- verifyAndRelay() ➝ verifyAndRelayMessage()
Added new events in FB receiver: BatchVerified and BatchNotVerified.
Added claim.verificationAttempted to prevent multiple executions of verifyBatch()
Added guards in FB receiver withdraw() against potential ETH leaks (undiscovered corner cases).
Renamed the FB sender event SendBatch  ➝ BatchOutgoing for consistency.
Introduced a SafeBridgeRouter abstraction.
Moved 3rd party bridge code to a dedicated "canonical" folder.
Consolidated the polygon-specific 3rd party dependencies.
Moved Merkle*Exposed to bridge/test/merkle and flipped the "_" function prefix.
Made it explicit that FastBridgeReceiverOnPolygon is WIP.
Updated the @authors pragma where needed.
…sts, found some testing issues

Also disabled gas reporter by default.
@jaybuidl jaybuidl force-pushed the feat/challenge-path-4-with-merkle-root branch from 380f59f to 81e6621 Compare July 16, 2022 23:33
@codeclimate
Copy link

codeclimate bot commented Jul 16, 2022

Code Climate has analyzed commit 81e6621 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 3

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Jul 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jaybuidl jaybuidl merged commit 58794e7 into master Jul 27, 2022
@jaybuidl jaybuidl deleted the feat/challenge-path-4-with-merkle-root branch July 27, 2022 22:09
@jaybuidl jaybuidl linked an issue Jul 27, 2022 that may be closed by this pull request
@jaybuidl jaybuidl added the Compatibility: ABI change 🗯 Smart contract ABI is changing. label Aug 8, 2022
@jaybuidl jaybuidl restored the feat/challenge-path-4-with-merkle-root branch November 24, 2022 03:00
@jaybuidl jaybuidl deleted the feat/challenge-path-4-with-merkle-root branch November 24, 2022 03:10
Params10 pushed a commit that referenced this pull request Feb 3, 2023
…root

Feat/challenge path 4 with merkle root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fast Bridging: message batching
3 participants