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

CSFeeOracle based on BaseOracle and HashConsensus #36

Merged
merged 6 commits into from
Nov 7, 2023

Conversation

madlabman
Copy link
Contributor

@madlabman madlabman commented Oct 31, 2023

Lido v2 introduced several new contracts for oracles, including HashConsensus and BaseOracle. To make use of that, the set of contracts copied in the source tree under lib/base-oracle directory. OpenZeppelin contracts of version 4.4.1 added separately to resolve dependencies of the copied contracts (see remappings.txt). Only change for lido-dao contracts made is changing compiler version from 0.8.9 to ^0.8.9 to be able to seamlessly import the contracts.

The flow for the off-chain part may look like this:

  • It queries the new frame like this:
        startSlot = consensus.getLastProcessingRefSlot();
        (refSlot, ) = consensus.getCurrentFrame();
  • It queries oracle.treeCid and downloads previous report data if any.
  • If no tree available, rebuild one starting from getFrameConfig.initialEpoch by traversing frames one by one.
  • It sends the report.

@madlabman madlabman force-pushed the feat/hash-consensus branch 2 times, most recently from ae3df1d to ef1bc0d Compare November 1, 2023 19:04
script/Deploy.s.sol Outdated Show resolved Hide resolved
script/Deploy.s.sol Outdated Show resolved Hide resolved
src/CSFeeOracle.sol Outdated Show resolved Hide resolved
src/CSFeeOracle.sol Outdated Show resolved Hide resolved
@madlabman madlabman force-pushed the feat/hash-consensus branch 2 times, most recently from bcb86d9 to 4c67a97 Compare November 2, 2023 15:24
@madlabman madlabman force-pushed the feat/hash-consensus branch from 4c67a97 to 08a0593 Compare November 2, 2023 15:30
@madlabman madlabman marked this pull request as ready for review November 2, 2023 15:31
@madlabman madlabman requested review from vgorkavenko, a team and dgusakov November 2, 2023 15:31
@madlabman madlabman force-pushed the feat/hash-consensus branch 2 times, most recently from 4dc3097 to 16c9b40 Compare November 6, 2023 19:54
Makefile Show resolved Hide resolved
lib/base-oracle/README.md Outdated Show resolved Hide resolved
@madlabman madlabman force-pushed the feat/hash-consensus branch from 16c9b40 to 657e18d Compare November 7, 2023 08:51
@madlabman madlabman requested a review from vgorkavenko November 7, 2023 08:56
@madlabman madlabman merged commit 76049b1 into main Nov 7, 2023
4 checks passed
@madlabman madlabman deleted the feat/hash-consensus branch November 7, 2023 13:07
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