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

perf(protorev): send rewards to dev acc once per epoch #7564

Merged
merged 14 commits into from
Feb 27, 2024

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Feb 21, 2024

Closes: #7518

What is the purpose of the change

The protorev module currently calculates profits and sends the dev reward cut after every backrun. This adds unnecessary read/write overhead, causing measurable detriment to sync speed.

This PR tracks the difference between the last epoch's protorev module account to the balance at the current epoch, calculates the dev rewards once, and does a single send.

@czarcas7ic czarcas7ic added the V:state/breaking State machine breaking PR label Feb 21, 2024
@czarcas7ic czarcas7ic changed the title perf: send rewards to dev acc once per epoch perf: send protorev rewards to dev acc once per epoch Feb 21, 2024
@czarcas7ic czarcas7ic changed the title perf: send protorev rewards to dev acc once per epoch perf(protorev): send rewards to dev acc once per epoch Feb 21, 2024
@czarcas7ic
Copy link
Member Author

#7509

^ this PR should be merged before this one, so it can be properly wired

@czarcas7ic czarcas7ic marked this pull request as ready for review February 23, 2024 19:46
Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM, but I don't see a test showing that multi-denom distributes are working

@czarcas7ic
Copy link
Member Author

Will get test in and then merge, thanks all

@czarcas7ic czarcas7ic closed this Feb 27, 2024
@czarcas7ic czarcas7ic reopened this Feb 27, 2024
@czarcas7ic
Copy link
Member Author

Im actually seeing the multi-denom test here already

name: "osmo denom and another base denom",
arbProfits: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)),
sdk.NewCoin("juno", osmomath.NewInt(100000000))),
},
{
name: "osmo denom, another base denom, and a non base denom",
arbProfits: sdk.NewCoins(sdk.NewCoin("uosmo", osmomath.NewInt(100000000)),
sdk.NewCoin("juno", osmomath.NewInt(100000000)),
sdk.NewCoin("eth", osmomath.NewInt(100000000))),
},

@ValarDragon lmk if that suffices.

@ValarDragon
Copy link
Member

Ah great, thanks! I missed that then

@ValarDragon ValarDragon merged commit 616e5cb into main Feb 27, 2024
1 check passed
@ValarDragon ValarDragon deleted the adam/protorev-one-send-per-epoch branch February 27, 2024 15:01
@github-actions github-actions bot mentioned this pull request Apr 1, 2024
@github-actions github-actions bot mentioned this pull request Apr 15, 2024
@PaddyMc PaddyMc mentioned this pull request Apr 19, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Make protorev send rewards to developers / community pool once per epoch
3 participants