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

oracle #4

Closed
vshvsh opened this issue Sep 9, 2020 · 4 comments · Fixed by #153
Closed

oracle #4

vshvsh opened this issue Sep 9, 2020 · 4 comments · Fixed by #153
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vshvsh
Copy link
Contributor

vshvsh commented Sep 9, 2020

oracle (smart contract)

based on https://github.com/depools/depool-dao/blob/master/apps/depooloracle/contracts/DePoolOracle.sol but

  1. oracles should report uniform data: it's eth2 blockchain, when finalized there should be no two different views on network and all honest oracles should report the exact same result
    thus https://github.com/depools/depool-dao/blob/master/apps/depooloracle/contracts/DePoolOracle.sol#L225
    should count quorum on exact results instead of mean result
  2. Find a different name for Epoch (maybe interval) bc people are confusing it with eth2 Epoch
  3. allow reporting epochs from the past (not current epochs) as long as epoch is > than the last reported one and <= current one (nb can be exploited in edge cases for a short time)

oracle (daemon)

oracle should report balance for every 7200*x slot (0, 7200, 14400, ...) when it's finalized but not earlier. In pushData(uint256 _epoch, ...) _epoch (that needs to be renamed to _data_timestamp or something) should be the blocktime of the slot. Edge cases are when there's no block for the slot - in that case, balance and blocktime should be for the last finalized block before 7200*x, usually 7200*x-1.

Balance reported = sum of all balances on active validators under depool control (up to date list of keys is in the smart contract), + sum of all balances on validators under depool control in the activation queue + sum of all balances under depool control in the exit queue + sum of all balances on inactive (exited) validators under depool control

@vshvsh vshvsh added the enhancement New feature or request label Sep 10, 2020
@lxzrv lxzrv mentioned this issue Sep 21, 2020
Klyaus added a commit to lidofinance/lido-oracle that referenced this issue Sep 28, 2020
Update get validators keys logic
lidofinance/lido-dao#4
Klyaus added a commit to lidofinance/lido-oracle that referenced this issue Sep 29, 2020
Update get validators keys logic
lidofinance/lido-dao#4
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Sep 30, 2020
lidofinance/lido-dao#4
Add receiving balances from Lighthouse API
Add receiving balances from Prysm API
Add balance reporting to Oracle contract
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Sep 30, 2020
lidofinance/lido-dao#4
Add receiving balances from Lighthouse API
Add receiving balances from Prysm API
Add balance reporting to Oracle contract
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 1, 2020
#8
lidofinance/lido-dao#4

Add pytest instruction to README
Add beacon function tests
Update requirements.txt with missed dependencies
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 1, 2020
#8
lidofinance/lido-dao#4

Add pytest instruction to README
Add beacon function tests
Update requirements.txt with missed dependencies
Klyaus added a commit to lidofinance/lido-oracle that referenced this issue Oct 1, 2020
Klyaus added a commit to lidofinance/lido-oracle that referenced this issue Oct 1, 2020
Klyaus added a commit to lidofinance/lido-oracle that referenced this issue Oct 1, 2020
Klyaus added a commit to lidofinance/lido-oracle that referenced this issue Oct 2, 2020
Description process of launching py-oracle in e2e environment
Also some minor fixes
#9
parent issue lidofinance/lido-dao#4
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 2, 2020
#8
lidofinance/lido-dao#4

Add pytest instruction to README
Add beacon function tests
Add contracts function tests
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 2, 2020
#8
lidofinance/lido-dao#4

Add test run instruction to README
Add beacon function tests
Add contracts function tests
Add requirements-test.txt
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 2, 2020
#8
lidofinance/lido-dao#4

Add test run instruction to README
Add beacon function tests
Add contracts function tests
Add requirements-test.txt
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 2, 2020
#8
lidofinance/lido-dao#4

Add test run instruction to README
Add beacon function tests
Add contracts function tests
Add requirements-test.txt
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 2, 2020
#8
lidofinance/lido-dao#4

Add test run instruction to README
Add beacon function tests
Add contracts function tests
Add requirements-test.txt
@vshvsh vshvsh added this to the RC1 milestone Oct 3, 2020
onionglass added a commit to lidofinance/lido-oracle that referenced this issue Oct 5, 2020
#16
lidofinance/lido-dao#4

Update get_balances function now get balances for epoch
Update tests to match new logic
ongrid added a commit to lidofinance/lido-oracle that referenced this issue Oct 13, 2020
ongrid added a commit to lidofinance/lido-oracle that referenced this issue Oct 13, 2020
ongrid added a commit to lidofinance/lido-oracle that referenced this issue Oct 14, 2020
* Configuration and envs
* Sanity Checks
* Timing

Related: [depool-dao#4](lidofinance/lido-dao#4)
@ongrid
Copy link
Contributor

ongrid commented Oct 14, 2020

After research and modeling I'd propose to use ETH2 epochs as a main measurement unit in algorithm instead of initially proposed slots. Reasons:

  • epochs are the main subject of ETH2 finality
  • both prysm and lighthouse APIs and STDOUT logs they produce give the finality attribute for epoch objects.
  • With less parameters to care, state management and troubleshooting are simpler.
  • states (balances) are tied to epochs, not slots. Polling states from adjacent slots that belong to the same epoch produce the same results.
  • larger units - less syncronization confusions and less aggressive timing

With Eth2 defaults

SLOTS_PER_EPOCH=32

one-day long interval 7200/32 = 225 epochs

@vshvsh your opinion?

ongrid added a commit to lidofinance/lido-improvement-proposals that referenced this issue Nov 10, 2020
* Nominate all values in wei instead Gwei
* Rename queued to InProcess (to satisfy eth2.0 spec)
* Fix definition of beaconValidators (to satisfy eth2.0 spec)
* Clarify formula of InProcess (transient state)

Main issue: [lido-oracle#21](lidofinance/lido-oracle#21)
Related: [lido-dao#110](lidofinance/lido-dao#110)
Related: [lido-dao#4](lidofinance/lido-dao#4)
ongrid added a commit to lidofinance/lido-improvement-proposals that referenced this issue Nov 10, 2020
* Nominate all values in wei instead Gwei
* Rename queued to InProcess (to satisfy eth2.0 spec)
* Fix definition of beaconValidators (to satisfy eth2.0 spec)
* Clarify formula of InProcess (transient state)

Main issue: [lido-oracle#21](lidofinance/lido-oracle#21)
Related: [lido-dao#110](lidofinance/lido-dao#110)
Related: [lido-dao#4](lidofinance/lido-dao#4)
ongrid added a commit to lidofinance/lido-improvement-proposals that referenced this issue Nov 10, 2020
* Nominate all values in wei instead Gwei
* Rename queued to InProcess (to satisfy eth2.0 spec)
* Fix definition of beaconValidators (to satisfy eth2.0 spec)
* Clarify formula of InProcess (transient state)

Main issue: [lido-oracle#21](lidofinance/lido-oracle#21)
Related: [lido-dao#110](lidofinance/lido-dao#110)
Related: [lido-dao#4](lidofinance/lido-dao#4)
ongrid added a commit that referenced this issue Nov 14, 2020
* Add PushableMock contract
* Add pushBeacon unittests
Related:  #110, #4
ongrid added a commit that referenced this issue Nov 16, 2020
* Improve PushableMock contract
* Extend pushBeacon unittests
Related:  #110, #4
ongrid added a commit that referenced this issue Nov 17, 2020
Extend pushBeacon unittests to cover different cases/combinations
of depositedValidators/beaconValidators/beaconBalances

Related:  #110, #4
lxzrv pushed a commit that referenced this issue Nov 17, 2020
* Add PushableMock contract
* Add pushBeacon unittests
Related:  #110, #4
lxzrv pushed a commit that referenced this issue Nov 17, 2020
* Improve PushableMock contract
* Extend pushBeacon unittests
Related:  #110, #4
lxzrv pushed a commit that referenced this issue Nov 17, 2020
Extend pushBeacon unittests to cover different cases/combinations
of depositedValidators/beaconValidators/beaconBalances

Related:  #110, #4
ongrid added a commit that referenced this issue Nov 22, 2020
* Add PushableMock contract
* Add pushBeacon unittests

Related:  #110, #4
ongrid added a commit that referenced this issue Nov 22, 2020
* Add PushableMock contract
* Add pushBeacon unittests
Related:  #110, #4
ongrid added a commit that referenced this issue Nov 22, 2020
* Improve PushableMock contract
* Extend pushBeacon unittests
Related:  #110, #4
ongrid added a commit that referenced this issue Nov 22, 2020
Extend pushBeacon unittests to cover different cases/combinations
of depositedValidators/beaconValidators/beaconBalances

Related:  #110, #4
skozin pushed a commit that referenced this issue Nov 22, 2020
* Add PushableMock contract
* Add pushBeacon unittests
Related:  #110, #4
skozin pushed a commit that referenced this issue Nov 22, 2020
* Improve PushableMock contract
* Extend pushBeacon unittests
Related:  #110, #4
skozin pushed a commit that referenced this issue Nov 22, 2020
Extend pushBeacon unittests to cover different cases/combinations
of depositedValidators/beaconValidators/beaconBalances

Related:  #110, #4
vshvsh pushed a commit to lidofinance/lido-improvement-proposals that referenced this issue Nov 24, 2020
* Nominate all values in wei instead Gwei
* Rename queued to InProcess (to satisfy eth2.0 spec)
* Fix definition of beaconValidators (to satisfy eth2.0 spec)
* Clarify formula of InProcess (transient state)

Main issue: [lido-oracle#21](lidofinance/lido-oracle#21)
Related: [lido-dao#110](lidofinance/lido-dao#110)
Related: [lido-dao#4](lidofinance/lido-dao#4)
krogla pushed a commit that referenced this issue Jan 26, 2021
* Add PushableMock contract
* Add pushBeacon unittests
Related:  #110, #4
krogla pushed a commit that referenced this issue Jan 26, 2021
* Improve PushableMock contract
* Extend pushBeacon unittests
Related:  #110, #4
krogla pushed a commit that referenced this issue Jan 26, 2021
Extend pushBeacon unittests to cover different cases/combinations
of depositedValidators/beaconValidators/beaconBalances

Related:  #110, #4
dechjo referenced this issue in dechjo/lido-dao Jan 26, 2021
* Add PushableMock contract
* Add pushBeacon unittests
Related:  lidofinance#110, #4
dechjo referenced this issue in dechjo/lido-dao Jan 26, 2021
* Improve PushableMock contract
* Extend pushBeacon unittests
Related:  lidofinance#110, #4
dechjo referenced this issue in dechjo/lido-dao Jan 26, 2021
Extend pushBeacon unittests to cover different cases/combinations
of depositedValidators/beaconValidators/beaconBalances

Related:  lidofinance#110, #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants