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

Support for upcoming smart-contract-based allocators. #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kacperzuk-neti
Copy link
Collaborator

@kacperzuk-neti kacperzuk-neti commented Apr 9, 2024

Pull Request Template

Description

What: this PR stores "address" and "tooling" fields from allocator JSON files in database and exposes to clients via API.

Why: smart-contract allocators will need to make a different call on-chain to grant datacap to a client. Instead of calling verifreg directly, they'll need to call smart contract which will do it on their behalf. Address of this smart contract is stored in the "address" field and we need the "tooling" field to know when to use the new approach.

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  1. I've setup my own "Allocator-Governance" repo with some JSONs in it: https://github.com/Neti-Test/filplus-allocator-governance/tree/main/active
  2. Configured the backend to use this repo
  3. curl -H "Content-Type: application/json" -d '{"files_changed":["active/msig-classic.json","active/msig-contract.json"]}' localhost:8080/allocator/create
    • NOTE - it did fail to me at this point due to null installation_id of the allocator. This seems unrelated to my changes though and I've worked it around by setting the installation_id manually in the DB and rerunning the create endpoint.
  4. curl -s localhost:8080/allocators, verified that it now includes address and tooling in the response.

Checklist:

Before submitting your pull request, please review the following checklist:

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation. - No, please point me to the documentation that potentially needs to be updated.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Additional Information

I'm not sure if this change needs a change to documentation. Is there a documentation somewhere?
I also weren't able to run fplus-lib tests as they seem to depend on some specific repo (keyko-io/test-philip-second). Please provide some guidance if you deem it necessary for this change.

Also this needs a database schema migration, to add address and tooling text columns to allocators table. How should this be handled?

What: this PR stores "address" and "tooling" fields from allocator JSON
files in database and exposes to clients via API.

Why: smart-contract allocators will need to make a different call
on-chain to grant datacap to a client. Instead of calling verifreg
directly, they'll need to call smart contract which will do it on their
behalf. Address of this smart contract is stored in the "address" field
and we need the "tooling" field to know when to use the new approach.
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

1 participant