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

Arbitrum bridge + rewards distribution #552

Closed
wants to merge 74 commits into from
Closed

Conversation

pcarranzav
Copy link
Member

@pcarranzav pcarranzav commented Mar 24, 2022

Motivation

Based on discussions that have been going on in the past few months (see this Forum discussion), it seems that there is interest in the community for scaling through a Layer 2 network. Conversations between core dev teams point towards an Arbitrum Graph devnet as the most viable first step in this direction.

This devnet would require, among other things, a way to bridge GRT from L1 into L2 and back. This bridge should be the canonical way to send GRT into Arbitrum, but it should be extensible to support any protocol-specific behavior that may be necessary, both for the initial devnet deployment and the eventual "mainnet” release. This GIP covers the specification of such bridge.

GIPs for discussions in the forum:

Changes

  • We add the following contracts L1GraphTokenGateway, BridgeEscrow, L2GraphTokenGateway and L2GraphToken
  • Deployment commands in the CLI are updated to include an L2 deployment
  • Configuration and address book entries for Arbitrum are added as well.
  • L1Reservoir and L2Reservoir are introduced, changing the RewardsManager to pull. rewards from them instead of minting.

(Edited to add the changes from #556 and #571 as these were merged on top of this PR)

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #552 (df5599f) into dev (7c6e27d) will increase coverage by 1.61%.
The diff coverage is 99.72%.

❗ Current head df5599f differs from pull request most recent head b99d31f. Consider uploading reports for the commit b99d31f to get more accurate results

@@            Coverage Diff             @@
##              dev     #552      +/-   ##
==========================================
+ Coverage   90.35%   91.96%   +1.61%     
==========================================
  Files          35       44       +9     
  Lines        1762     2092     +330     
  Branches      296      361      +65     
==========================================
+ Hits         1592     1924     +332     
+ Misses        170      168       -2     
Flag Coverage Δ
unittests 91.96% <99.72%> (+1.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
contracts/tests/ReservoirMock.sol 66.66% <66.66%> (ø)
contracts/gateway/BridgeEscrow.sol 100.00% <100.00%> (ø)
contracts/gateway/GraphTokenGateway.sol 100.00% <100.00%> (ø)
contracts/gateway/L1GraphTokenGateway.sol 100.00% <100.00%> (ø)
contracts/governance/Managed.sol 100.00% <100.00%> (+1.92%) ⬆️
contracts/l2/gateway/L2GraphTokenGateway.sol 100.00% <100.00%> (ø)
contracts/l2/reservoir/L2Reservoir.sol 100.00% <100.00%> (ø)
contracts/l2/token/GraphTokenUpgradeable.sol 100.00% <100.00%> (ø)
contracts/l2/token/L2GraphToken.sol 100.00% <100.00%> (ø)
contracts/reservoir/L1Reservoir.sol 100.00% <100.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member Author

@pcarranzav pcarranzav left a comment

Choose a reason for hiding this comment

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

Some notes and open questions.

arbitrum-graph.config.yml Outdated Show resolved Hide resolved
contracts/gateway/GraphTokenGateway.sol Show resolved Hide resolved
contracts/gateway/L1GraphTokenGateway.sol Outdated Show resolved Hide resolved
.solcover.js Show resolved Hide resolved
contracts/l2/token/L2GraphToken.sol Outdated Show resolved Hide resolved
// For some reason the call count doesn't work properly,
// and each function call is counted 12 times.
// Possibly related to https://github.com/defi-wonderland/smock/issues/85 ?
//expect(arbSysMock.sendTxToL1).to.have.been.calledOnce
Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to investigate why this doesn't work, as it would be nice to explicitly check we only call this once...

Copy link
Contributor

Choose a reason for hiding this comment

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

The error looks very similar to what they reported, and the number being 12 looks really fixed. I haven't used that feature from waffle yet.

@pcarranzav
Copy link
Member Author

pcarranzav commented Apr 5, 2022

I've deployed this to a new deployment on Rinkeby and I'm working on some CLI commands to configure the new contracts and interact with them, but doing this in a separate PR, see #556

@pcarranzav pcarranzav changed the title WIP: Arbitrum bridge implementation Arbitrum bridge implementation Apr 28, 2022
@pcarranzav pcarranzav marked this pull request as ready for review April 28, 2022 21:32
@pcarranzav pcarranzav force-pushed the pcv/arb-bridge branch 2 times, most recently from 822e1da to bcee887 Compare May 17, 2022 18:43
@pcarranzav pcarranzav force-pushed the pcv/arb-bridge branch 3 times, most recently from e60da74 to f80cad3 Compare May 31, 2022 14:54
Deployment commands in the CLI are also updated to include an L2 deployment.
Configuration and address book entries for Arbitrum are added as well.
@socket-security
Copy link

socket-security bot commented Jul 27, 2022

Socket Security Report

👍 No new dependency issues detected in pull request

Socket.dev scan summary
Issue Status
Did you mean? ✅ no new possible package typos
Install scripts ✅ no new install scripts
Telemetry ✅ no new telemetry
Troll package ✅ no new troll packages
Malware ✅ no new malware
Native code ✅ no new native modules

Powered by socket.dev

@pcarranzav pcarranzav mentioned this pull request Jul 28, 2022
@pcarranzav
Copy link
Member Author

Superseded by #699 so closing

@pcarranzav pcarranzav closed this Dec 21, 2022
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.

3 participants