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

Onboard new GNO-A collateral #556

Merged
merged 13 commits into from
Dec 14, 2022
Merged

Onboard new GNO-A collateral #556

merged 13 commits into from
Dec 14, 2022

Conversation

valiafetisov
Copy link
Contributor

@valiafetisov valiafetisov commented Dec 5, 2022

Preparation for the GNO onboarding

  • Quick fix to enable creation of an auction on goerli
  • Add GNO-A collateral config
  • Wait for the spell to lend into the chainlog (on goerli)
    • Or compile and execute in the fork
  • Test participation with DAI

@valiafetisov
Copy link
Contributor Author

As there are GNO contracts now on the goerli, I think it should be ready to test from our side

Screenshot 2022-12-08 at 09 15 25

@valiafetisov
Copy link
Contributor Author

valiafetisov commented Dec 8, 2022

Functional testing scenario:

  • Set REMOTE_RPC_URL inside core/.env to alchemy endpoint on goerli
  • Set RPC_URL inside frontend/.env to http://127.0.0.1:8545
  • Start Create collateral auction simulation inside core via npm run simulate
  • Start frontend via npm run dev

Results:

  • I was able to create GNO-A vault using simulation ✔️

    Screenshot 2022-12-08 at 09 25 27
  • I was able to fetch created vault in our UI ✔️

    Screenshot 2022-12-08 at 09 25 43
  • I was able to liquidate vault using simulation ✔️

  • I was able to view auction in the UI ✔️

    Screenshot 2022-12-08 at 09 26 40
  • I was able to participate in auction with DAI and get GNO token in return into my wallet ✔️

    Screenshot 2022-12-08 at 10 30 26 Screenshot 2022-12-08 at 10 09 43

But encountered a state of the UI which seems to be a bug: after successful bidding, bid with dai transaction page currently stays active and still suggests you to participate as if the auction was not finished. I guess this is unrelated to the GNO and can be addressed in other PR.

@valiafetisov
Copy link
Contributor Author

valiafetisov commented Dec 8, 2022

  • After testing, the outstanding part in this PR is the hardcoded CDP_REGISTRY address (missing from the chainlog) that should be either removed or refactored in a way that doesn't break other networks. This is not trivial, so I would remove it here and create issue to come up with strategy how we deal with contracts missing from chainlog
  • Also we would need to remove GNO from tests: since there are no contracts from the mainnet the tests will always fail

But what is the next course of actions regarding the onboarding? Do we still want to test the mainnet spell?

@LukSteib
Copy link
Contributor

LukSteib commented Dec 8, 2022

Was able to replicate all of the steps that you described above successfully ✔️

But encountered a state of the UI which seems to be a bug: after successful bidding, bid with dai transaction page currently stays active and still suggests you to participate as if the auction was not finished.

Agree, experienced the same problem. Will create an issue for it.

But what is the next course of actions regarding the onboarding? Do we still want to test the mainnet spell?

Yes, I'd still like to run the test based on mainnet spell. There we should also be able to properly test Callee.

@LukSteib LukSteib mentioned this pull request Dec 8, 2022
1 task
@valiafetisov
Copy link
Contributor Author

Currently not able to execute mainnet spell (makerdao/spells-mainnet#295, commit 9d9215d), casting fails with ds-pause-delegatecall-error.

@valiafetisov
Copy link
Contributor Author

valiafetisov commented Dec 12, 2022

Currently, the same ds-pause-delegatecall-error is thrown during execution of the deployed mainnet spell (the address and the block is recovered from this commit: makerdao/spells-mainnet@82f9e9b). Not sure what's going on here.

Reproduction steps:

  1. Clone our repo
  2. Create required env var (more specifically, REMOTE_RPC_URL inside core/.env that will be used for forking)
  3. Start simulation environment cd core && npm ci && npm run simulate
  4. Choose Onboard new collateral, then GNO-A onboarding via prompts
  5. See that the transaction fails inside hardhat fork with reverted with reason string 'ds-pause-delegatecall-error'

Note that current simulation forks at 16145121 (right after the spell was deployed), but I've also tried warping and casting scheduled spell on the latest block with the same outcome. I've also created calculateCastTimestamp function based on the MCD_PAUSE.delay() and the "working hours" logic, but that doesn't seem to be the problem either.

@LukSteib
Copy link
Contributor

Since the spell was casted to mainnet, can we add GNO-A to our set of collaterals for the "Create collateral auction" simulation.
This will enable us to properly test functionality.

@valiafetisov
Copy link
Contributor Author

Removed GNO-A from blacklist and was able to create a participate in the auction 🙂

ℹ collateral keeper: auction "GNO-A:1" net profit is 87817 DAI after transaction fees, moving on to the execution                                                                                 18:30:33
ℹ keeper: wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" has not been authorized yet. Attempting authorization now...                                                                        18:30:33
ℹ Transaction is preparing to be mined...                                                                                                                                                         18:30:33
ℹ Transaction is pending to be mined...                                                                                                                                                           18:30:33
ℹ Transaction was mined into block "17218243"                                                                                                                                                     18:30:33
ℹ keeper: wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" successfully authorized via "0x8b2f4b3c97b8714f85574231649bae9fb0d0a674654a26a5e2182006d4abb8ca" transaction                        18:30:33
ℹ collateral keeper: auction "GNO-A:1" net profit is 87817 DAI after transaction fees, moving on to the execution                                                                                 18:30:33
ℹ keeper: wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" has already been authorized                                                                                                         18:30:33
ℹ keeper: collateral "GNO-A" has not been authorized on wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" yet. Attempting authorization now...                                                  18:30:33
ℹ Transaction is preparing to be mined...                                                                                                                                                         18:30:33
ℹ Transaction is pending to be mined...                                                                                                                                                           18:30:33
ℹ Transaction was mined into block "17218244"                                                                                                                                                     18:30:33
ℹ keeper: collateral "GNO-A" successfully authorized on wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" via "0x37fa2127e688aeab9fce8386d49b98c31e26a4b91845adc17c492a9a7454aed4" transaction  18:30:33
ℹ collateral keeper: auction "GNO-A:1" net profit is 87817 DAI after transaction fees, moving on to the execution                                                                                 18:30:33
ℹ keeper: wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" has already been authorized                                                                                                         18:30:33
ℹ keeper: collateral "GNO-A" has already been authorized on wallet "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"                                                                                   18:30:33
ℹ collateral keeper: auction "GNO-A:1": attempting swap execution                                                                                                                                 18:30:33
ℹ Transaction is preparing to be mined...                                                                                                                                                         18:30:33
ℹ Transaction is pending to be mined...                                                                                                                                                           18:30:37
ℹ Transaction was mined into block "17218245"                                                                                                                                                     18:30:38
ℹ collateral keeper: auction "GNO-A:1" was succesfully executed via "0xa0d003a41bbb3f7871c3d349d449ea51ca894ccd220619ed12170dc2d95854f4" transaction  

@LukSteib
Copy link
Contributor

Agree

Was able to simulate GNO-A auction based on hardhat mainnet fork and participate in the auction via UI using unsiwap v3 callee

image

@valiafetisov valiafetisov marked this pull request as ready for review December 13, 2022 21:17
LukSteib
LukSteib previously approved these changes Dec 13, 2022
@KirillDogadin-std
Copy link
Contributor

removed the connection of the blacklist with simulations, added the collateral to the blacklist

@valiafetisov valiafetisov merged commit b9d60b2 into main Dec 14, 2022
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.

3 participants