Skip to content

Distribution, expand the ignored distributios set#7250

Merged
czarcas7ic merged 8 commits intomainfrom
dev/refine_spam_filter
Feb 10, 2024
Merged

Distribution, expand the ignored distributios set#7250
czarcas7ic merged 8 commits intomainfrom
dev/refine_spam_filter

Conversation

@ValarDragon
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
Contributor

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added 5cf383a

@github-actions
Copy link
Copy Markdown
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
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