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

Spec ecosystem incentive #225

Merged
merged 33 commits into from
Sep 16, 2022
Merged

Conversation

taiki1frsh
Copy link
Collaborator

@taiki1frsh taiki1frsh commented Aug 10, 2022

This PR is for the revision of the previous frontend-incentive module specification after the research about the things on check_list in there.
This PR is merged into the PR #216 . After merged, that PR also is merged into design/spec branch manually.

The changed parts from the previous frontend-incentive specification are not a few actually.

About module name
I changed module name from frontend-incentive to ecosystem-incentive because the current style can be applied for many different use-cases by using the same logic.

About logic
The biggest modification is definitely hooks part.
As you know, in the previous design, we planed to use event data for catching the traded fee information to accumulate rewards for the subjects.
But, after the research about it, it turned out to be impossible to do so.
Instead, there're hooks mechanism for cosmos sdk for literally hooking to some target actions.
(research log: https://www.notion.so/cauchye/Frontend-incentive-Tech-research-9b0965c91cd542ecbb6ea123d557add3)
By using this mechanism and the way to get memo data in a specific message process in the how_get_memo branch, we can implement incentive features without generating two-way dependencies between x/nftmarket and x/ecosystem-incentive modules.

And, following these changes, I decided to accept register style to become subject.

refs:
#218
https://www.notion.so/cauchye/Frontend-incentive-Tech-research-9b0965c91cd542ecbb6ea123d557add3

Please review and confirm, @mkXultra .

@taiki1frsh
Copy link
Collaborator Author

SetHooks usage in app.go:

app.StakingKeeper = *stakingKeeper.SetHooks(

app.cdpKeeper = *cdpKeeper.SetHooks(cdptypes.NewMultiCdpHooks(app.incentiveKeeper.Hooks()))

The location to define SetHooks in x/cdp/keeper/keeper.go:

func (k *Keeper) SetHooks(hooks types.CdpHooks) *Keeper {

@taiki1frsh taiki1frsh marked this pull request as ready for review August 10, 2022 07:54
@taiki1frsh taiki1frsh requested a review from mkXultra August 10, 2022 07:55

```protobuf
message FrontendReward {
message Reward {
Copy link
Contributor

Choose a reason for hiding this comment

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

@taiki1frsy
I think the data structure is ambiguous.
Can I see a sample data structure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mkXultra
I added description in 02_state.md for more abundant document of the data structures in this module.
Plz refer.

@mkXultra
Copy link
Contributor

mkXultra commented Sep 7, 2022

It might be better to have a Keeper Method that punishes it if there is a malicious front end.
It can be made to run with ProposalOnly

@taiki1frsh
Copy link
Collaborator Author

taiki1frsh commented Sep 9, 2022

TODO:

@taiki1frsh
Copy link
Collaborator Author

taiki1frsh commented Sep 13, 2022

Memo:
Currently we don't have liquidation, auction, etc logic in the code yet.
So when we implement those stuff, the hook insertion must be included in there.

@taiki1frsh taiki1frsh merged commit 1693772 into spec-frontend-incentive Sep 16, 2022
@taiki1frsh taiki1frsh deleted the spec-ecosystem-incentive branch September 16, 2022 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants