-
Notifications
You must be signed in to change notification settings - Fork 157
Subgraph split signal to multiple versions #526
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
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.
Some partial comments, I'll keep adding as I keep reviewing
@@ -1,9 +1,9 @@ | |||
{ | |||
"compilerOptions": { | |||
"lib": ["ES2018", "dom"], | |||
"lib": ["ES2020", "dom"], |
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.
What is this changing?
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.
Its to allow the usage of BigInt
literals in the tests
contracts/discovery/GNS.sol
Outdated
uint256 tokens; | ||
|
||
// Burn signal | ||
tokens = curation.burn( |
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.
In this case, can we just burn the shares for the current
version to save some gas?
* curation: use a minimal proxy to save gas when minting for first time * curation: use token utils for transfers * tests: remove unnecessary block advance in test * curation: add external function to set token master copy and avoid re-deploy the clone on minting reset * chore: add graph curation master copy token to deployment config
Codecov Report
@@ Coverage Diff @@
## dev #526 +/- ##
==========================================
+ Coverage 90.60% 90.61% +0.01%
==========================================
Files 35 35
Lines 1703 1780 +77
Branches 282 292 +10
==========================================
+ Hits 1543 1613 +70
- Misses 160 167 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Summary
When a new subgraph version is published, it burns all signal on the past deployment and mints on the new deployment. This incentivizes indexers to stop indexing the past deployment therefore causing a disruption of service. This PR seeks to fix that by splitting signal in half between both deployments and allow usage to be migrated to the new deployment.
Current Behavior
When
publishNewVersion
is called, signal is burned on the old deployment and signal is minted on the new deployment through the Curation contract.Solution
publishNewVersion
is called, split the signal in half between the old and new versions.mint
orburn
are called in theGNS
contract, split themint/burn
equally amongst the versions.finalizeSubgraphUpgrade
once the old version is no longer needed.