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

refactor: filecoin client to use new capabilities #938

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Sep 20, 2023

Refactors the filecoin client to use the new capabilities.

TODO: fix up tests

Copy link
Contributor

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

Everything looks good and as expected.

We just need to clarify the language for the invocations that will be used to basically issue receipts. I am also not sure on best way yet, but I think that at least it needs to mention that can also be a failure. Note that I only flagged first 2 occurrences, but it also happens in other cases


### `Storefront.filecoinSubmit`

Signal that an offered piece has been submitted to the filecoin storage pipeline.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think signal here is strange. I understand the perspective as its real purpose is to issue the receipt.

However, the receipt can actually be negative with an error instead of a signal that piece has been submitted.

I would probably rephrase to include something like: "Request to submit piece into the Filecoin Pipeline. Either will succeed and its receipt point to next task, or it will fail with reason to not have piece submitted in the pipeline (e.g. wrong piece provided for given content)"

Open to other suggestions, as this gets difficult to clairfy in a short format

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we want something more like Invoked to report whether piece was successfully submitted or not

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that I do not mind if we continue to use "signal" term as well. We just need to capture that it is invoked to report the asynchronous result of original invocation


### `Storefront.filecoinAccept`

Signal that a submitted piece has been accepted in a Filecoin deal.
Copy link
Contributor

Choose a reason for hiding this comment

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

can also signal that it failed. same as above

@@ -21,14 +19,15 @@ export const connection = connect({
})

/**
* Queues a piece to the aggregator system of the filecoin pipeline.
* Request that a piece be aggregated for inclusion in an upcoming an Filecoin
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Request that a piece be aggregated for inclusion in an upcoming an Filecoin
* Request that a piece is aggregated for inclusion in an upcoming an Filecoin

Copy link
Contributor

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

LGTM!

Would be nice just to add the error case I mentioned

},
})

// self invoke piece/add from aggregator
const res = await aggregateAdd(
// self invoke piece/offer from aggregator
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// self invoke piece/offer from aggregator
// self invoke piece/accept from aggregator

assert.ok(!res.fx.join)
})

it('aggregator self invokes add a filecoin piece to reject the piece queued', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could we keep an error response?

Alan Shaw and others added 2 commits October 23, 2023 22:47
docs: better docs

fix: client tests
Implements `filecoin-api` services, events and tests all over the place.

BREAKING CHANGE: see latest specs https://github.com/web3-storage/specs/blob/cbdb706f18567900c5c24d7fb16ccbaf93d0d023/w3-filecoin.md
@vasco-santos vasco-santos merged commit b80c8e6 into refactor/filecoin-capabilities Oct 23, 2023
13 of 14 checks passed
@vasco-santos vasco-santos deleted the refactor/filecoin-client branch October 23, 2023 20:52
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