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

MU07 - Chainlink Relayers #206

Merged
merged 49 commits into from
Aug 28, 2024
Merged

MU07 - Chainlink Relayers #206

merged 49 commits into from
Aug 28, 2024

Conversation

chapati23
Copy link
Contributor

@chapati23 chapati23 commented Aug 12, 2024

MU07 Overview

  1. Deploy ChainlinkRelayerFactory proxied with a ProxyAdmin owned by Mento Labs multisig.
  2. Deploy ChainlinkRelayer instances for two rate feeds: relayed:CELOPHP and relayed:PHPUSD.
  3. Submit a Celo Governance Proposal that:
    • Whitelists the relayers for the two rate feeds.
    • Sets the relayed:CELOPHP as the "equivalent token" for the PSO token address. Meaning that when paying with gas, the blockchain node will use the relayed:CELOPHP rate feed when gas is payed in the PSO token.

Testing / development helpers

In order to have as close a structure as possible on testnets, this PR also deploys a few MockChainlinkAggregator contracts:

  • PHPUSD to Alfjores
  • PHPUSD to Baklava
  • CELOUSD to Baklava

Using these on Alfajores we have:

  • relayed:CELOPHP built from chainlink's own testnet aggregator of CELOUSD and our mock aggregator of PHPUSD
  • relayed:PHPUSD built from our mock aggregator of PHPUSD

And on Baklava we have everything based only on our mock aggregators.

Scripts to interact with relayers:

RelayerStatus

$ yarn script:dev -n alfajores -s RelayerStatus

Get a status output for all defined relayers:

  ====== CELO/PHP (CELO/USD:USD/PHP) =======
  RateFeedID: 0xaFc02368A174Cd08e01c373de6D0B537CECF43C8
  Num rates: 1
  Median rate: 25850491393557810218000000
  ====== PHP/USD =======
  RateFeedID: 0xab921d6ab1057601A9ae19879b111fC381a2a8E9
  Num rates: 1
  Median rate: 17540930000000000000000

RelayerReport

$ yarn script:dev -n alfajores -s RelayerReport

Trigger report on all relayers.

Relayed CELO/PHP (CELO/USD:USD/PHP) successfully.
Relayed PHP/USD successfully.

UpdateMockChainlinkAggregators

$ yarn script:dev -n alfajores -s UpdateMockChainlinkAggregators

Update the mock aggregators on testnets with values from the mainnet aggregators that they mirror.

Other Changes

  • Removed the forge_script helper functions because it got out of hand and it was only used in a couple of places
  • Improved the verify:celoscan command to check ABIs on celoscan first, and skip verification.

Related Issues

bin/deploy.sh Outdated Show resolved Hide resolved
bin/deploy.sh Outdated Show resolved Hide resolved
bowd and others added 13 commits August 15, 2024 15:22
Co-authored-by: chapati <philip.paetz@me.com>
* feat: mento gov utils scripts

* fix: interfaces uses correct pragma

* feat: pass and queue proposals

* feat: remove --no-cache from script calls

* fix: typo on a revert message

* feat: improve logging

* fix: remove tree that is pushed

* fix: remove merge artifacts

* feat: update readme
* chore: reproduce deployment broadcast files from on-chain data

* Update bin/reproduce-mainnet-gov.ts

Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>

* Apply suggestions from code review

Co-authored-by: baroooo <baranseltekin@gmail.com>

* feat: regenerate json files after Baran's suggestions

---------

Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>
Co-authored-by: baroooo <baranseltekin@gmail.com>
@bowd bowd changed the title WIP: Deploy Chainlink Relayer Deploy Chainlink Relayers Aug 19, 2024
@bowd bowd changed the title Deploy Chainlink Relayers MU07 - Chainlink Relayers Aug 19, 2024
@bowd bowd marked this pull request as ready for review August 19, 2024 13:26
@bowd
Copy link
Contributor

bowd commented Aug 19, 2024

I tried running the proposal on Baklava but it seams that the cLabs contracts team have also abandoned Baklava and SortedOracles is not up to date with the equivalent token implementation :(

Copy link
Contributor Author

@chapati23 chapati23 left a comment

Choose a reason for hiding this comment

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

one last typo, then good to go from my side

script/upgrades/MU07/MU07.sol Outdated Show resolved Hide resolved

function getProxyAdminOwner() internal view returns (address) {
if (ChainLib.isCelo()) {
return 0x655133d8E90F8190ed5c1F0f3710F602800C0150; // Mento Labs multisig
Copy link
Contributor

Choose a reason for hiding this comment

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

address looks correct, but maybe get it from contracts.dependency("MentoLabsMultisig") ?

script/upgrades/dependencies.json Outdated Show resolved Hide resolved
script/utils/Script.sol Show resolved Hide resolved
@chapati23
Copy link
Contributor Author

Merging currently blocked until this is merged celo-org/governance#472

@philbow61 philbow61 merged commit 62e97df into main Aug 28, 2024
1 check passed
@philbow61 philbow61 deleted the feat/deploy-chainlink-relayer branch August 28, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants