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

LidoOracle contract: reportable epochs interval may become inverted #176

Closed
skozin opened this issue Nov 23, 2020 · 3 comments
Closed

LidoOracle contract: reportable epochs interval may become inverted #176

skozin opened this issue Nov 23, 2020 · 3 comments
Assignees
Labels
cosmetic solidity issues/tasks related to smart contract code wontfix This will not be worked on
Milestone

Comments

@skozin
Copy link
Member

skozin commented Nov 23, 2020

The following is possible with the current implementation:

image

This is caused by the fact that, currently, the earliest reportable epoch is set to the first epoch of the next frame when any of the current frame's epochs become finalized. At the same time, the last reportable epoch is always the current epoch — which can (and, most of the time, will) be less than the first epoch of the next frame.

An example (assuming epochsPerFrame=100): current epoch is 10; oracles agree on the epoch 0, frame 0 becomes finalized. At this point, getCurrentReportableEpochs will return firstReportableEpochId=100, lastReportableEpochId=10.

@ongrid ongrid self-assigned this Nov 25, 2020
@ongrid ongrid added the bug Something isn't working label Nov 25, 2020
@ongrid ongrid added this to the Testnet milestone Nov 25, 2020
@skozin skozin added the solidity issues/tasks related to smart contract code label Nov 30, 2020
@ongrid
Copy link
Contributor

ongrid commented Dec 1, 2020

This is mostly cosmetic issue. These numbers shouldn't be interpreted as a range, they should be considered as separate values for the separate checks.

Note: Nevertheless we need more expressive approach possible with default solidity (non-experimental) ABI encoder like retrieval of all the oracle needs within the single call (still human readable). The sequence of reportable frames with all the metadata is good to have, but it's non-trivial with v0.4.24 encoder. We'd like to have something like this:

oracle.getReportableFrames()

[
{epoch: 0, frame: 0, quorum: 5, voted: 4, start: 1234567, end: 1234567, pushed: False, voted: ['0xdeadbeef', '0xbeefdead']},
{epoch: 225, frame: 1, quorum: 5, voted: 0, start: 1234567, end: 1234567, pushed: False, voted: []},
]

But it changes the interface so breaks compatibility - so it's the candidate for 0.3.0.

@ongrid
Copy link
Contributor

ongrid commented Dec 2, 2020

I'd suggest to remove it from the Mainnet launch scope and postpone to v0.3.0 with another breaking changes. I think, we'll deprecate these individual getters and provide the oracle precomputed array of all the values it needs. Still subject to research ABI encoders and check if experimental mode suits here (it's not a bleeding edge, but it was experimental in 0.4.24).

@ongrid ongrid added cosmetic wontfix This will not be worked on and removed bug Something isn't working labels Dec 7, 2020
@ongrid
Copy link
Contributor

ongrid commented Dec 7, 2020

It should be a bit less annoying with the new names for these entities introduced in #215

minReportableEpochId
maxReportableEpochId

and should be deprecated by #230

@ongrid ongrid closed this as completed Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmetic solidity issues/tasks related to smart contract code wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants