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

Update Client Service to enable Regulator for transfers #1373

Merged
merged 10 commits into from Feb 12, 2023

Conversation

daveroga
Copy link
Contributor

@daveroga daveroga commented Feb 4, 2023

What does this implement/fix? Explain your changes.

Update in the client to enable regulator for the transfers.

Does this close any currently open issues?

#1372

What commands can I run to test the change?

Start nightfall with REGULATOR_URL=http://localhost:8080 NF_SERVICES_TO_START=blockchain,client,worker,optimist,deployer ./bin/start-nightfall -g -d to indicate a regulator url for the client to create transfers enabled for the regulator.

  • npx hardhat test --bail --no-compile test/unit/circuits/transfer-regulator.circom.test.mjs (This is also included in npm run unit-test-circuits
  • npx hardhat test --bail --no-compile test/kem-dem-regulator.test.mjs (This is also included in npm run test-general-stuff
  • npm run test-erc20-tokens (To test in real scenario you need to simulate a regulator in start-nightfall with a REGULATOR_URL REGULATOR_URL=http://localhost:8080 NF_SERVICES_TO_START=blockchain,client,deployer,optimist,worker ./bin/start-nightfall -g -d)

Any other comments?

This is part of the regulator feature and the part for the regulator service is simulated now, waiting for the corresponding PR that will be merged in this feature branch and then integrated.

@daveroga daveroga self-assigned this Feb 4, 2023
@daveroga daveroga marked this pull request as ready for review February 6, 2023 13:59
@imagobea imagobea linked an issue Feb 7, 2023 that may be closed by this pull request
Copy link
Contributor

@imagobea imagobea left a comment

Choose a reason for hiding this comment

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

Only requesting changes so that we can discuss some of the comments and take a look at the test with the SDK.

I could follow more or less the implementation till I got to the circuit part! 🙈 We need to find a place to document this in a simple but comprehensive way.

Once the feature evolves, we should add more test. If possible, I would create new test suites instead of adding more cases to erc-tokens.

We should test that a 3rd party can open the commitment and access the data as intended. But cannot spend commitments. Etc etc.

Great work indeed!! 💪 It is nice to see others adventuring into the circuits layer. Well done 👏

docker/docker-compose.yml Outdated Show resolved Hide resolved
nightfall-client/src/services/transfer-regulator.mjs Outdated Show resolved Hide resolved
nightfall-client/src/services/transfer-regulator.mjs Outdated Show resolved Hide resolved
nightfall-client/src/services/kem-dem.mjs Outdated Show resolved Hide resolved
nightfall-client/src/services/kem-dem.mjs Outdated Show resolved Hide resolved
nightfall-client/src/services/kem-dem.mjs Show resolved Hide resolved
nightfall-client/src/services/transfer-regulator.mjs Outdated Show resolved Hide resolved
nightfall-client/src/utils/regulator.mjs Outdated Show resolved Hide resolved
Copy link
Contributor

@imagobea imagobea left a comment

Choose a reason for hiding this comment

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

Go Regulator, Go!! Thanks for explaining this to me (again) 🙏

Copy link
Contributor

@israelboudoux israelboudoux left a comment

Choose a reason for hiding this comment

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

Nice one @daveroga!

@daveroga daveroga merged commit abbcfde into feature-regulator Feb 12, 2023
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.

[FEATURE] Update Client Service to enable Regulator for transfers
4 participants