Skip to main content

GRT $0.02018 up 2.79% Market cap $222.6M

Save gas when initializing a subgraph deployment

GGP-0009 · Council vote #9 on The Graph

Overview

Updated

Approved

Voting ended
Dec 7, 2021
Opened Dec 2, 2021
Submitted
Dec 2, 2021
Dec 2, 17:39 UTC
Members voted
6
One vote each, on Snapshot

Put to the Council by 0x7ebe59…0385

Votes

  • Yes 6 votes
  • No 0 votes

How BitBasic reads the result

  • Approved when more Council members chose Yes than No.
  • Each member has one vote, and Snapshot keeps a member's last.

Description

GGP: 0009 Scope: Smart Contracts Created: 2021-12-01 GIPs-Repo-Latest-Commit: 2e84093ed32024530e77a5e862eea46f491a322f

GIPs

GIP: 0019 Title: Save gas when initializing a subgraph deployment Authors: Ariel Barmat ariel@edgeandnode.com Created: 2021-09-25 Stage: Candidate Discussions-To: https://forum.thegraph.com/t/gip-0019-save-gas-when-initializing-a-subgraph-deployment/2590

Motivation

Reduce the gas cost for anyone initializing a subgraph deployment. This update is particularly beneficial for subgraph/app developers who do the first signal.

Implementation

Use a Minimal Proxy to clone the Graph Curation Token (ERC20) based on an implementation contract deployed just once. The implementation bytecode is also called master copy.

The benefit of this solution is that the token interface remain the same, making it backwards compatible.

This solution involves the following changes:

  • Modify the initializer of Curation to accept the master copy contract address to use when cloning.
  • Expose a function in Curation contract so that governance can change the implementation in the future.
  • Leverage "@openzeppelin/contracts/proxy/Clones.sol" to spawn the Minimal Proxies.
  • Update the current Graph Curation Token contract code and make it upgradeable so it can be used from the context of a Minimal Proxy.

References

Implementations: https://github.com/graphprotocol/contracts/pull/505

Audit: https://github.com/graphprotocol/contracts/blob/a24f6a140ad170cfc11572136e309c70975b8a2a/audits/OpenZeppelin/2021-11-graph-curation-minimal-proxy.pdf


Graph Governance Proposal-0009

Save gas when initializing a subgraph deployment

This proposal is to upgrade The Graph's protocol smart contracts running on Ethereum mainnet with the changes described in Graph Improvement Proposal (GIP) 0019, including the motivation and scope of the changes described in this proposal.

The code deployed that implements GIP-0019 must correspond to the commit hash included in the front matter of this governance proposal.

Following a successful "yes" vote, the protocol upgrade should be carried out at the earliest convenience using The Graph Council's Gnosis Multisig.

How the Council voted

In the order they voted. Snapshot knows members by address only, so BitBasic doesn't name them.

Member Vote When
0x7ebe59…0385 Yes Dec 2, 20:59 UTC
0x37bc95…b391 Yes Dec 2, 21:37 UTC
0xb02ce5…80b0 Yes Dec 3, 07:32 UTC
0xd201c9…22aa Yes Dec 3, 13:33 UTC
0x4530af…ba9a Yes Dec 3, 17:43 UTC
0x38fa68…4da8 Yes Dec 6, 23:04 UTC