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

feat(dist)!: make blueprint an IPLD, use CID as module ids [NET-412 NET-432] #1595

Merged
merged 22 commits into from
May 18, 2023

Conversation

justprosh
Copy link
Member

@justprosh justprosh commented Apr 28, 2023

Previously, the blueprint looked like this:

{
  "name": "trust-graph",
  "dependencies": [ "hash:someblake3hash", "name:trust-graph" ]
}

Module IDs were represented as blake3 hashes. Modules could also be specified by names, which were local to each peer and could be easily overwritten. The blueprint ID was a blake3 hash of the dependencies.

In deals, we already use CIDs for modules and worker definitions, which can be seen as a combination of service blueprints and spell definitions.

This PR contains the next BREAKING CHANGES:

  • Module IDs are now CIDs of the module wasm.
  • Blueprints have been converted to IPLD structures.
  • Blueprint IDs are now CIDs of the IPLD structure.
  • dist.make_blueprint returns a string representing the blueprint in IPLD format, which can be directly added to IPFS using ipfs dag put. This ensures the same CID is used everywhere.
    The updated blueprint now looks like this:

Blueprint now looks like this:

{
  "name": "trust-graph",
  "dependencies": [
    {
      "/": "bafybeieh62qys3ln2qiqbye2jgynxkfzzlvebw7dtpsqgv45p6qw62hk7u"
    },
    {
      "/": "bafybeigrqdxshsoxwp27s47tr3inn6pkt3ggh7hzwcqz7qgfrxmw3j77vu"
    }
  ]
}

The strings bafybeieh62qys3ln2qiqbye2jgynxkfzzlvebw7dtpsqgv45p6qw62hk7u and bafybeigrqdxshsoxwp27s47tr3inn6pkt3ggh7hzwcqz7qgfrxmw3j77vu are the CIDs of the respective modules.

@justprosh justprosh added e2e Run e2e workflow and removed e2e Run e2e workflow labels May 8, 2023
@justprosh justprosh added the e2e Run e2e workflow label May 8, 2023
@justprosh justprosh requested a review from folex May 9, 2023 14:22
@justprosh justprosh marked this pull request as ready for review May 9, 2023 14:22
@justprosh justprosh requested review from gurinderu and kmd-fl May 9, 2023 14:22
@justprosh justprosh changed the title feat!: make blueprint an IPLD, use CID as module ids feat!: make blueprint an IPLD, use CID as module ids [NET-412 NET-432] May 9, 2023
@linear
Copy link

linear bot commented May 9, 2023

NET-432 CID[IPLD]-fication of blueprints

NET-412 Use CIDs for blueprint ids

Right now it is some blake-something hash and it is impossible to compare CID to blueprint id

Copy link
Contributor

@kmd-fl kmd-fl left a comment

Choose a reason for hiding this comment

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

Does it mean that aqua deploy_service/fluence workers deploy will stop working properly?

crates/cid-utils/src/hash.rs Show resolved Hide resolved
particle-modules/src/modules.rs Outdated Show resolved Hide resolved
particle-modules/src/modules.rs Outdated Show resolved Hide resolved
particle-modules/src/error.rs Outdated Show resolved Hide resolved
@folex folex changed the title feat!: make blueprint an IPLD, use CID as module ids [NET-412 NET-432] feat!(dist): make blueprint an IPLD, use CID as module ids [NET-412 NET-432] May 16, 2023
crates/cid-utils/src/hash.rs Outdated Show resolved Hide resolved
crates/json-utils/src/lib.rs Outdated Show resolved Hide resolved
@justprosh justprosh requested a review from folex May 18, 2023 07:47
@justprosh justprosh changed the title feat!(dist): make blueprint an IPLD, use CID as module ids [NET-412 NET-432] feat(dist)!: make blueprint an IPLD, use CID as module ids [NET-412 NET-432] May 18, 2023
crates/cid-utils/build.rs Outdated Show resolved Hide resolved
@folex folex merged commit 720a2b3 into master May 18, 2023
4 of 5 checks passed
@folex folex deleted the ipld-blueprint branch May 18, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants