-
Notifications
You must be signed in to change notification settings - Fork 608
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
Superfluid: Reduce epoch time #1083
Comments
I've made a branch I believe this patch should fix the immediate amplification overhead here. cc @joeabbey |
Forgot to update this yesterday, the first attempt in that branch was not state compatible. TBD why it wasn't! |
I'm surprised that this one-line fix is not state compatible. By what method did you find out that this wasn't state compatible? |
Me and @hleb-albau tried it on a node, and got a state hash error :/ |
Tried changing binary from |
it did work, but not survive epoch blocks |
I see i see, does that mean the fix needs more reduce in epoch time? |
Its not state compatible with the existing binary, meaning that if you had a v7.0.4 node, and this node, they will not get the same app hash |
Closed by #2214 |
Joe abbey very helpfully got pprof results of the post-superfluid epoch https://twitter.com/JoeAbbey/status/1503072747349499905?s=20&t=fLB87nwcpX7kFigVoR9O1A (We've all been surprised at why it wasn't sub one minute)
Turns out the answer was that we're doing too many calls to
GetSyntheticLock
! We call this function right here: https://github.com/osmosis-labs/osmosis/blob/main/x/incentives/keeper/distribute.go#L235Whats happening is in the distribution code for superfluid delegations to Atom/Osmo, we do one distribute for every superfluid delegated-to validator. Right now we do one distribute per validator / superfluid denom pair. Each distribute iterates over all
L
lockups of sufficient length in the Atom/Osmo pool, and checks if it has a superlfuid delegation to the respective validator. This causesL * # num validators
calls here.We actually index lockups by synthetic denom as well. We reverted a change that was using that previously, due to some uncertainty around correctness pre-feature shipping, I'm now pretty sure post refactors to the module we did, that its correct. This would reduce the number of data iterations to the ideal of
# superfluid locks
.To fix this, we should get all locks with unbonding period duration, of the synthetic lockup duration length. A couple ways to do this, but they basically all involve changing the calls here: https://github.com/osmosis-labs/osmosis/blob/main/x/incentives/keeper/distribute.go#L370-L384 . The underlying locks are keyed as 'normal', so you can do
k.lk.GetLocksLongerThanDurationDenom(ctx, distrTo.Denom, distrTo.Duration)
with the synthetic denom.The text was updated successfully, but these errors were encountered: