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

Complete Scrappy Turkify #13

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Complete Scrappy Turkify #13

wants to merge 27 commits into from

Conversation

me-imfhd
Copy link

Implements Shamirs Secret Sharing for storing pk among 5 distributed servers.
Fixes prisma schema bug where payout should reference worker instead of user.
Fixes hydration errors.
Manages .env nicely.
Adds docker to spin up postgres and redis databases.
Implements long running payouts with redis queues, (locks amount instantly and makes a queue to handle sol transfer and creates a payouts on success and clears the lock amount in a single prisma transaction).
Prevents double spending with the help Sequential isolation in prisma transactions.
Add more zod validations, does error handling.
Sooner toast notifications.
Logins only when connects wallet, clears token on disconnect.
Adds get all tasks page for users to see all there tasks,
Adds payout page for workers to see all their payouts. (including making apis for that in the backend)
Using docker to start all 5 distributed server which are responsible for sending the private key shares to your main backend (especially to the queue)

NOTE: Have tested in all scenarios mostly everything works fine if the backed does not go down, (even if the backend goes down when it comes back up the failed queues with start the transaction again and clear the locked amount)
Need to set cors properly for sk-distirbution-servers so that only your main backend can access it in prod (right now everything can access it).

@Airbornharsh
Copy link

@me-imfhd you can create a single server and can spawn threads with new server instance this will use single port but load will be divided

@me-imfhd
Copy link
Author

@Airbornharsh can you clarify which server you are talking about, the main backend or the sk-distribution servers?

@Airbornharsh
Copy link

@me-imfhd sk-distribution-server

@me-imfhd
Copy link
Author

@Airbornharsh thats not for load, its just a mock to show case how it needs to be done in production, we need to have multiple servers across multiple cloud providers which have shares of private key which is fetched by the main backend to derive the original private key, so that no single developer has access to it, its shamir's secret sharing, you can read about it

@Airbornharsh
Copy link

@me-imfhd ok got it

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.

None yet

2 participants