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: w3 aggregate protocol client and api implementation #787

Merged
merged 9 commits into from
Jun 7, 2023

Conversation

vasco-santos
Copy link
Contributor

@vasco-santos vasco-santos commented May 3, 2023

This PR is a first iteration for w3 aggregate client and API implementations. It follows same patterns we identified while working on upload-api and upload-client and is agnostic from the deployment service. aggregate-api exposes a lib and a set of tests that implementers with infra should follow, as well as the needed interfaces that must be fulfilled. It also includes fx usage for aggregate/offer return value

It follows spec https://github.com/web3-storage/specs/blob/feat/filecoin-spec/w3-aggregation.md

There are two interfaces defined in this service:

  • offerStore - responsible for receiving offers to be queued. Implementer receives commD of aggregate together with Offer content. These will be used to give SPs. Note that implementer should keep track of the offer's commD so that it can query over time when a deal is done (or failures), so that the fx invocation can be executed and a receipt generated
  • aggregateStore - store of aggregates already places with SPs (implementor like spade-proxy will have this store hooked with spade DB)

It is worth noting that this is a first iteration and not the complete thing at this moment. More specifically, in follow up iterations we need to:

New detailed issues for above will be created before this PR gets merged.

Part of storacha/w3filecoin-infra#19

Still to do:

  • change commp from text to CID

Usage:

Closes #772 and #773

@vasco-santos vasco-santos added this to the w3up phase 4 milestone May 3, 2023
Upgrades ucanto to 8. There are no breaking changes that affect normal
functionality as expected
@vasco-santos vasco-santos force-pushed the feat/w3-aggregate-protocol branch 19 times, most recently from 269f9fc to 83b0ed3 Compare May 26, 2023 13:03
@vasco-santos vasco-santos force-pushed the feat/w3-aggregate-protocol branch 2 times, most recently from 5bfcb09 to 372c2f3 Compare June 1, 2023 12:55
@vasco-santos vasco-santos force-pushed the feat/w3-aggregate-protocol branch 3 times, most recently from b0dcbb1 to 30d6d60 Compare June 6, 2023 09:11
@vasco-santos
Copy link
Contributor Author

While writing this and getting to know more about commP, commD and so on, thinking perhaps we should do some renames from what we decided in spec:

  • aggregate/offer nb to rename commitmentProof to commD or dataSegementProof ?
  • CBOR block offer data structure to rename commitmentProof to pieceLink and size to pieceSize ?
    • do we also need to store paddedSize ?
  • aggregate/get nb to rename commitmentProof to commD or dataSegementProof ?

@@ -95,6 +95,7 @@
},
"rules": {
"unicorn/prefer-number-properties": "off",
"unicorn/expiring-todo-comments": "off",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lint fails with TODO: ... comments now ...

@vasco-santos
Copy link
Contributor Author

A few follow ups will be worked on:

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor non blocking consistency thing on the failures...


class AggregateNotFound extends Server.Failure {
get name() {
return /** @type {const} */ ('AggregateGetFailure')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return /** @type {const} */ ('AggregateGetFailure')
return /** @type {const} */ ('AggregateNotFoundFailure')

get name() {
return /** @type {const} */ ('AggregateOfferInvalidUrlFailure')
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!

@vasco-santos vasco-santos merged commit b58069d into main Jun 7, 2023
@vasco-santos vasco-santos deleted the feat/w3-aggregate-protocol branch June 7, 2023 14:43
travis pushed a commit that referenced this pull request Jun 7, 2023
🤖 I have created a release *beep* *boop*
---


##
[6.0.0](capabilities-v5.0.1...capabilities-v6.0.0)
(2023-06-07)


### ⚠ BREAKING CHANGES

* merge `@web3-storage/access-api` into `@web3-storage/upload-api`
([#790](#790))

### Features

* merge `@web3-storage/access-api` into `@web3-storage/upload-api`
([#790](#790))
([4f6ddb6](4f6ddb6))
* w3 aggregate protocol client and api implementation
([#787](#787))
([b58069d](b58069d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
travis added a commit that referenced this pull request Jun 8, 2023
🤖 I have created a release *beep* *boop*
---


##
[14.0.0](access-v13.0.2...access-v14.0.0)
(2023-06-07)


### ⚠ BREAKING CHANGES

* merge `@web3-storage/access-api` into `@web3-storage/upload-api`
([#790](#790))

### Features

* merge `@web3-storage/access-api` into `@web3-storage/upload-api`
([#790](#790))
([4f6ddb6](4f6ddb6))
* w3 aggregate protocol client and api implementation
([#787](#787))
([b58069d](b58069d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
travis added a commit that referenced this pull request Jun 8, 2023
🤖 I have created a release *beep* *boop*
---


##
[7.0.0](w3up-client-v6.0.1...w3up-client-v7.0.0)
(2023-06-08)


### ⚠ BREAKING CHANGES

* merge `@web3-storage/access-api` into `@web3-storage/upload-api`
([#790](#790))

### Features

* merge `@web3-storage/access-api` into `@web3-storage/upload-api`
([#790](#790))
([4f6ddb6](4f6ddb6))
* w3 aggregate protocol client and api implementation
([#787](#787))
([b58069d](b58069d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
vasco-santos added a commit that referenced this pull request Jun 12, 2023
Previous PR went out without workflows commited
#787 🤦🏼‍♂️

---------

Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
Co-authored-by: Travis Vachon <travis.vachon@gmail.com>
travis added a commit that referenced this pull request Jun 21, 2023
🤖 I have created a release *beep* *boop*
---


##
[9.1.0](upload-client-v9.0.1...upload-client-v9.1.0)
(2023-06-20)


### Features

* w3 aggregate protocol client and api implementation
([#787](#787))
([b58069d](b58069d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
vasco-santos added a commit to storacha/specs that referenced this pull request Jun 22, 2023
Context
storacha/w3up#787 (comment)

---------

Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
vasco-santos pushed a commit that referenced this pull request Jul 11, 2023
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2023-07-11)


### ⚠ BREAKING CHANGES

* aggregate capabilities now have different nb properties and aggregate
client api was simplified

### Features

* w3 aggregate protocol client and api implementation
([#787](#787))
([b58069d](b58069d))


### Bug Fixes

* update aggregate spec in client and api
([#824](#824))
([ebefd88](ebefd88))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
vasco-santos added a commit that referenced this pull request Jul 11, 2023
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2023-07-11)


### ⚠ BREAKING CHANGES

* aggregate capabilities now have different nb properties and aggregate
client api was simplified

### Features

* w3 aggregate protocol client and api implementation
([#787](#787))
([b58069d](b58069d))


### Bug Fixes

* aggregate api test link comparison type
([#816](#816))
([81bdf1c](81bdf1c))
* update aggregate spec in client and api
([#824](#824))
([ebefd88](ebefd88))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Vasco Santos <santos.vasco10@gmail.com>
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.

Implement w3-aggregation API package
3 participants