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

Distribution, expand the ignored distributios set #7250

Merged
merged 8 commits into from
Feb 10, 2024

Conversation

ValarDragon
Copy link
Member

Expands the set of gauges we ignore, as we are now no longer concerned about state compat in main.

This changes

if remainCoins.Len() == 1 && remainCoins[0].Amount.LTE(osmomath.NewInt(10)) && gauge.DistributeTo.Denom == "gamm/pool/1" && remainCoins[0].Denom != "uosmo" {

to

	// Remove some spam gauges that are not worth distributing. (We ignore the denom stake because of tests.)
	if remainCoins.Len() == 1 && remainCoins[0].Amount.LTE(osmomath.NewInt(100)) && remainCoins[0].Denom != "stake" {
		ctx.Logger().Debug(fmt.Sprintf("gauge debug, this gauge is perceived spam, skipping %d", gauge.Id))
		err := k.updateGaugePostDistribute(ctx, gauge, totalDistrCoins)
		return true, totalDistrCoins, err
	}
	return false, totalDistrCoins, nil
}

Requiring a gauge to distribute at least 100 coins, for any pool. Ignores "stake" to avoid fixing all the tests.

return true, totalDistrCoins, err
}

// Remove some spam gauges that are not worth distributing. (We ignore the denom stake because of tests.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We ignore the denom stake because of tests.)

LOL, cant we just inc the tests to be greater than 100??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but its pain

@@ -713,6 +698,28 @@ func (k Keeper) distributeInternal(
return totalDistrCoins, err
}

func (k Keeper) skipSpamGaugeDistribute(ctx sdk.Context, locks []*lockuptypes.PeriodLock, gauge types.Gauge, totalDistrCoins sdk.Coins, remainCoins sdk.Coins) (bool, sdk.Coins, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be worth creating unit test for this as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 5cf383a

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

@github-actions github-actions bot added the Stale label Jan 24, 2024
@github-actions github-actions bot closed this Jan 31, 2024
@czarcas7ic czarcas7ic reopened this Jan 31, 2024
@github-actions github-actions bot removed the Stale label Feb 1, 2024
@czarcas7ic czarcas7ic merged commit c281f0a into main Feb 10, 2024
1 check passed
@czarcas7ic czarcas7ic deleted the dev/refine_spam_filter branch February 10, 2024 23:55
@github-actions github-actions bot mentioned this pull request Mar 15, 2024
@github-actions github-actions bot mentioned this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/incentives V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants