Closed skozin closed 1 year ago
Thank you!
We also have another problem: error InitialEpochIsYetToArrive()
at AccountingOracle.initialize
.
Because BaseOracle._initialize
calls _setConsensusContract
which checks refSlot < lastProcessingRefSlot
where refSlot
is taken from IConsensusContract(addr).getCurrentFrame()
which calls _computeFrameIndex
which requires epoch >= config.initialEpoch
what is false at the moment of AccountingOracle initialization.
I also not sure if it is a good idea to check on AccountingOracle migration strictly initialEpoch == legacyProcessedEpoch + epochsPerFram
. There might be multiple scenarios when its wrong. For example (the day counts are approx):
updateInitialEpoch(hardfork +1d)
initialEpoch == legacyProcessedEpoch + epochsPerFram
UPD: or we know we want the AccountingOracle be operable at frame after the next after hardfork. But in the case we might want to parametrize the check
@arwer13 See the latest commit with the fix for the revert you've mentioned.
As for the initial epoch check, the assumed process of deployment is the following:
HashConsensus
, AccountingOracle
impl, and accounting oracle's proxy are deployed before the upgrade voting is started. The initial epoch of HashConsensus
is far in the future, thus the consensus is guaranteed to be inoperable.HashConsensus
to the calculated value by calling updateInitialEpoch
.HashConsensus
address.Thus, if the initial epoch is calculated correctly in the migrator contract, the check should pass regardless of the vote timing.
Allows updating the initial epoch of a
HashConsensus
instance while the current initial epoch is still in the future. This simplifies the protocol upgrade process by allowing to pre-deploy the consensus contract before the exact time of the protocol upgrade is known.