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 allows reporting non-finalized epochs #175

Closed
skozin opened this issue Nov 23, 2020 · 1 comment
Closed

LidoOracle contract allows reporting non-finalized epochs #175

skozin opened this issue Nov 23, 2020 · 1 comment
Assignees
Labels
bug Something isn't working solidity issues/tasks related to smart contract code
Milestone

Comments

@skozin
Copy link
Member

skozin commented Nov 23, 2020

The code for determining the last reportable epoch is the following:

/**
 * @notice Returns the fisrt and last epochs that can be reported
 */
function getCurrentReportableEpochs()
    public view
    returns (
        uint256 firstReportableEpochId,
        uint256 lastReportableEpochId
    )
{
    return (earliestReportableEpochId, getCurrentEpochId());
}

/**
 * @notice Returns the epochId calculated from current timestamp
 */
function getCurrentEpochId() public view returns (uint256) {
    return (
        _getTime()
        .sub(beaconSpec.genesisTime)
        .div(beaconSpec.slotsPerEpoch)
        .div(beaconSpec.secondsPerSlot)
    );
}

The problem is that the current epoch is not yet finalized: for that, two more epochs should pass, so oracles should be prohibited from reporting it.

@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 RC2 milestone Nov 25, 2020
@skozin skozin added the solidity issues/tasks related to smart contract code label Nov 30, 2020
@vshvsh
Copy link
Contributor

vshvsh commented Dec 1, 2020

That's a very minor issue. While technically true it's non-exploitable with majority of honest (even if buggy) oracles and irrelevant otherwise.

@vshvsh vshvsh closed this as completed Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solidity issues/tasks related to smart contract code
Projects
None yet
Development

No branches or pull requests

3 participants