Merged
Conversation
2ec9666 to
41a464c
Compare
This modifies the structure of the incentives contract we have been working with to solve a key problem. Namely the accuracy was either unacceptable or the management of the contract (funding expectations) where intractable. This has now been resolved with a new delegated claiming model that can be added to the existing althea l1 gassless tx ecosystem. This provides consistent updates that and allows for efficient operation and management in one package.
41a464c to
7948fa8
Compare
This new order is harder to mess up (user is separated from reward token by pool id, resulting in fewer errors with the two addresses and more closely matches the order of arguments in events for just generally more consistency.
Makes life easier for the claimer by having a single function and not having to do any math.
All the functions have been organized into: 1. Common user callable functions 2. Admin callable functions 3. Internal functions
The single function implementation was long and with multiple branching cases became confusing to reason about. It has been broken into _createProgramInternal() for new programs and _modifyProgramInternal() for existing/old programs.
The MassiveRandom test only checked the deviation between ideal rewards and claimed rewards without the inclusion of auto-claiming bots. The new MassiveRandomBotClaiming test will simulate imperfect bot execution and assert that the difference between ideal and claimed rewards is much lower. MassiveRandom produces a 30% deviation, while MassiveRandomBotClaiming produces a less that 5% deviation. The deviation can be tuned by increasing the share of rewards that go to bots when claiming, because bots will claim more often.
This patch fixes a number of test ordering issues and import issues to allow parallel operation. This only reduces runtime from 3 minutes 38 seconds to 1 minute 50 seconds on my machine but these improvements are still significant to fix intermittent failures due to poor isolation between the tests previously and a few test filse that simply would not run in isolation because the imports where incorrect.
737db6e to
e511cd8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This modifies the structure of the incentives contract we have been working with to solve a key problem. Namely the accuracy was either unacceptable or the management of the contract (funding expectations) where intractable.
This has now been resolved with a new delegated claiming model that can be added to the existing althea l1 gassless tx ecosystem. This provides consistent updates that and allows for efficient operation and management in one package.
See the new contract for clear docs on how it works.