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

Exit db refactor #824

Merged
merged 5 commits into from
Sep 20, 2023
Merged

Exit db refactor #824

merged 5 commits into from
Sep 20, 2023

Conversation

ptulugu
Copy link
Contributor

@ptulugu ptulugu commented Aug 18, 2023

The goal of this change is to make it possible for many thousands of exits
to easily run off a single database with no shared credentials and also to
make it possible for many different organizations to cooperate on this database.

In order to achieve this we will be replacing the postgresql database currently
used by the exits with a smart contract which will be used to register users

Client register flow has changed from client -> Exit -> Ops. Exit forwards a request to an external server with sms api key in order to
verify a client. That server will have write access to the smart contract to add the client, and then return their registration status to
exit, which then forwards that request back to the client

  • Solidity contract currently doesnt have any access restrictions
  • There is currently no cleanup for old clients

@ptulugu ptulugu force-pushed the pranay/refactor branch 5 times, most recently from 15fa1a1 to f2cbde7 Compare August 23, 2023 20:40
@ptulugu ptulugu force-pushed the pranay/refactor branch 2 times, most recently from 6c35728 to a341d54 Compare August 28, 2023 20:30
@ptulugu ptulugu force-pushed the pranay/refactor branch 4 times, most recently from c17b5d3 to 98907d3 Compare September 13, 2023 18:57
@ptulugu ptulugu changed the title WIP: Exit db refactor Exit db refactor Sep 13, 2023
@jkilpatr jkilpatr self-requested a review September 13, 2023 21:03
Copy link
Member

@jkilpatr jkilpatr left a comment

Choose a reason for hiding this comment

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

Wow this is a big one!

I've left some comments, mostly about duplicated code that should be de-duplicated and cleaned up into utility functions.

Looks like clippy still needs fixing along with the CI tests not completing

integration_tests/src/contract_test.rs Outdated Show resolved Hide resolved
integration_tests/src/utils.rs Outdated Show resolved Hide resolved
integration_tests/src/utils.rs Outdated Show resolved Hide resolved
integration_tests/src/utils.rs Show resolved Hide resolved
integration_tests/src/registration_server.rs Show resolved Hide resolved
rita_client_registration/src/lib.rs Show resolved Hide resolved
rita_exit/src/database/mod.rs Outdated Show resolved Hide resolved
rita_exit/src/database/mod.rs Show resolved Hide resolved
rita_exit/src/database/struct_tools.rs Outdated Show resolved Hide resolved
rita_exit/src/operator_update/mod.rs Show resolved Hide resolved
@ptulugu ptulugu force-pushed the pranay/refactor branch 5 times, most recently from e8513ef to ae9d16a Compare September 15, 2023 18:37
@ptulugu ptulugu force-pushed the pranay/refactor branch 3 times, most recently from e4a7ce6 to 944638c Compare September 20, 2023 22:33
Pranay Tulugu added 5 commits September 20, 2023 15:34
…m exits

The goal of this change is to make it possible for many thousands of exits
to easily run off a single database with no shared credentials and also to
make it possible for many different organizations to cooperate on this database.

In order to achieve this we will be replacing the postgresql database currently
used by the exits with a smart contract which will be used to register users

Client register flow has changed from client -> Exit -> Ops. Exit forwards a request to an external server with sms api key in order to
verify a client. That server will have write access to the smart contract to add the client, and then return their registration status to
exit, which then forwards that request back to the client
AltheaDB.sol is the solidity contract to be hosted on the althea blockchain that is used
in place of the previous postgresql db. This commits add this contract as well as implementations of
functions in rita_client_registration to add and query users to this contract
Since the register endpoint can be called simultaneously by multiple router, we need to queue up these txs and
batch them together and setup the correct nonce
@ptulugu ptulugu enabled auto-merge (rebase) September 20, 2023 22:35
@ptulugu ptulugu merged commit b12c903 into master Sep 20, 2023
12 checks passed
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