-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reward amount rollup #64
Comments
/start |
Tips:
|
You might want to offer some clarity/help to the assignee @rndquu |
@rndquu Should the new tables you mentioned be added to this repo, or should they be part of the bot repo here: ubiquityos? |
@hhio618 Hey
Those are plugin related tables so definitely not part of ubiquityos. The https://github.com/ubiquibot/conversation-rewards plugin uses https://github.com/ubiquibot/permit-generation plugin for permit generation under the hood. To make things consistent it makes sense to add related DB migrations to https://github.com/ubiquibot/permit-generation/tree/development/supabase/migrations.
@0x4007 might know better. You may design DB as you see fit. I would start with a single
So the flow could be:
Overall there will be the following tables:
So as a part of this issue the Example 1:
Example 2:
No, this task is regarding solely for saving rewards (i.e. accumulating) in a DB. Notice:
One last thing is that the "reward amount rollup" should work this way (in order to be backwards compatible with our existing infrastructure):
This way we distinguish claimed and unclaimed rewards. |
Ideally DB design should be the one that supports different payout methods:
So DB tables could look like:
The issue with the
So I would prefer simplicity with 5 different tables (compared to the solution described above):
P.S. I think when the "permit or gift card generation on demand at pay.ubq.fi" feature is fully ready then it makes sense to refactor to v2 that would support different payout types |
@0x4007 What payout types do we plan to support except for permits, gift cards and virtual cards? |
The original idea was to support:
|
@hhio618 It occurred to me that the Check this example:
So we don't really need to match rewards with permits or gift cards. To calculate the available reward amount we can simply subtract the sum of generated permits and gift cards from solved rewards. TLDR; I think as a part of this issue only the |
@rndquu |
@rndquu
|
Sorry for the inconvenience, we're still contemplating over the DB schema, pls check these comments:
If this issue's description is updated (in favor of a single DB table mentioned here) then we'll increase this github issue's reward to cover refactoring costs. |
This github issue is solely regarding saving rewards in a DB so the following tasks should be solved as a part of this issue:
While this point is out of scope for this issue (since it will be solved here):
|
/start |
! hhio618 you were previously unassigned from this task. You cannot be reassigned. |
@rndquu Any news on this issue and the related one? |
I have a plan to keep the granularity of single permits, which is interesting in terms of administration, while rolling up rewards.
Based on 2, it would make a lot of sense for the database to include the issue's name. I would love to add an array stating what kind of contribution that reward refers to: writing a spec, reviewing or completing the task. There are a few more details I want to implement. I guess the downside of this approach is having to thrust a DB, but apparently other ends also do that. |
Passed the deadline and no activity is detected, removing assignees: @zugdev. |
I also really want to remove Supabase/database dependencies from everywhere in our system. It adds a ton of friction for DAO contributors to work on our infrastructure. I think that smart contracts as databases for finances probably makes sense, we just need to be careful about gas fees. Otherwise I prefer git based JSON storage, perhaps with encryption, because it is likely to be the easiest to share the data and set up for maintenance + onboarding new developers. |
Gas is excusable in L2s, my main concern with a contract solution was the need to handle multiple chains. We wanted to abstract chains as much as possible in |
It's an interesting idea for enhancing reliability. Perhaps it's more worthwhile after we see problems with git based storage. |
We could use GitRows, but since it's no longer maintained, we'd need to fork it. It supports CRUD operations on repo data, works with private repos, and lets users log in with their PAT. |
Thinking this through, and your feedback is important. From what I understand, currently we use this repo's compute.yml workflow and permit-generation to write the individual permits. My plan:
0xmyaddress.json:
My idea is that only a GitHub app can change this repo's content using the EVM private key. Scripts would be placed outside of this repo for maintainance, the rewards repo would contain workflows that run the scripts from the other repo.
The scripts would then be called using workflows in the rewards repo, the idea is that we protect any possibility of manually changing rewards. |
That can work but then if you want to test locally or for external users, how do you set it up? |
Not that simple, I guess. We will need content perm to add/edit the workflows either way. I think having repo admin with 2FA is good enough. We just must ensure the jsons are not edited by someone other than the app, perhaps there is a way to isolate it. |
Where do you plan to store permits/gift cards/other types of payouts? I think the consensus was that we will use one table approach (ledger) to keep things simple and more easier to track. I think I think that rewards should be based on the Github user not the wallet address because wallets change and users stay and also it's easier to query a user than a wallet which can change multiple times, for example if you query a user on you would need to first check all wallets and then all rewards associated with those wallets, instead you can query the user directly. In my head the ideal flow would be that I go to the reward page, I login with Github, I see all my rewards related to tasks, reviews, conversation rewards...along with the breakdown of rewards, already claimed permits, penalties...and then:
I would say that it's better to first implement reward rollup with a traditional database. Later after we will implement Git based storage and test it on small plugins and make sure it's working correctly and without bugs, we can easily switch.
|
To sum up, moving from permit2 to "smart contracts for finances" is a huge pivot which touches too many repositories to achieve it in a reasonable amount of time. We could think more on it after the "reward rollup" feature is ready. @zugdev I suppose you have 2 ways:
|
Another thing to consider is partner's token / chain ID. The ideal flow would be that the user could choose the chain and/or the token however I feel like at this stage it's not feasible...maybe we can have revisit this in the future |
Maybe a fast middle ground but is it possible to multicall permit claims @rndquu? We can abstract this away from the user on a special permit roll up claim UI. It can let a user import several permits somehow (possibly with a copy paste text box) later there may be a way to automate this. The UI can check the sum total and just display a big claim button under that sum total. Ideally at this step the user signs one transaction and claims all of them in one shot. It's not the optimal UI/UX but if multicall is possible this could step us closer in the right direction. |
Uniswap's permit2 doesn't work with multicall |
/start |
! This task does not reflect a business priority at the moment. You may start tasks with one of the following labels: Priority: 3 (High), Priority: 4 (Urgent), Priority: 5 (Emergency) |
@rndquu the deadline is at Fri, Dec 13, 12:22 PM UTC |
Important
|
Right now the permit redeem flow is the following:
conversation-rewards
plugin generates a permit, saves it to a DB and displays it in github commentspay.ubq.fi
This PR introduces claiming rewards to gift cards.
The updated flow of the permit redeem should be following:
pay.ubq.fi
, generates either an on-chain single permit (possibly for multiple solved issues) either redeems to a gift cardSo as a part of this issue we should accumulate contributor rewards in a DB similar to how
0x4007
initially implemented it with thedebits, cerdits, settlements
tables.When this issue of accumulated rewards is ready we can just disable permit generation (via the plugin's
permitGeneration.enabled
option) and let contributors redeem only atpay.ubq.fi
.The text was updated successfully, but these errors were encountered: