-
Notifications
You must be signed in to change notification settings - Fork 602
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
x/epochs: AfterEpochEnd called with wrong epoch number #830
Comments
I suggest for the immediate problem of getting this release out, we just fix "Change superfluid logic to get Epoch from reading from identifier (which will gracefully work across whenever the fix occurs)" |
Integrators to reach out to:
Anything else? |
I made the PR mentioned above and explained the change in the newly created The only thing I have not tested is the potential for an off by one error during the thirdening. I can prioritize testing this on a local net if we feel this to be necessary. |
I think we should do thirdening testing separately and not block this on it! |
@czarcas7ic to merge to main. |
Merged and notified integrators. Will post here if any issues are heard |
What the logic should be:
Suppose epoch N ends at “time T”.
Suppose block 5 is at time T - 1. (The epoch shouldn’t have ended yet)
Suppose block 6 is at time T + 1. The epoch should have ended at time T. Since time T is after “block 5", and “before block 6”, we end epoch N as soon as we can within block 6 — namely at the beginning of the block before everything else.
We then start Epoch N+1 immediately, since all of the the txs in block 6 should be executed in epoch N+1.
Whats the bug
We are doing that, but if you look in the relevant code https://github.com/osmosis-labs/osmosis/blob/main/x/epochs/abci.go#L34-L43, we are modifying the EpochIdentifier before the AfterEpochEndCall!
This results in the current epoch argument being wrong. However if you get the epoch from the Identifier, you would still get the correct result.
The fix is relatively simple, but the complex thing is making sure this:
Superfluid component
This is tagged for superfluid, because we either need to:
The text was updated successfully, but these errors were encountered: