-
Notifications
You must be signed in to change notification settings - Fork 15
Curio Market 2.0 - PDPv1 via @curio/market-client #200
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
base: master
Are you sure you want to change the base?
Conversation
…oots->pieces Ref: FilOzone#105 feat!: owner -> storage provider & details rename fix!: address Curio endpoint renames, rename utils fix: address rename review feedback fix: address more rename review feedback fix: long tail of renames feat: contract functionality updates and fixes feat: more renaming & cleanup
Signed-off-by: Jakub Sztandera <[email protected]>
Almost all references to "CommP" are now gone. This includes exports.
Replaces createStorage() * synapse.storage.upload() and synapse.storage.download() for easy-path * StorageContext contains a relationship with a specific SP + data set * synapse.storage.createContext() to manage them directly * context.download() and context.upload() (etc.) for dealing directly with that SP + data set Closes: FilOzone#135
* feat(commpv2): Curio CommPv2 compatibility Ref: filecoin-project/curio#596 * chore: update contract addresses
Bumps [chai](https://github.com/chaijs/chai) from 5.3.3 to 6.0.1. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](chaijs/chai@v5.3.3...v6.0.1) --- updated-dependencies: - dependency-name: chai dependency-version: 6.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- add biome config and remove ts-standard - add simple-git-hooks to optionally setup biome for staged files pre-commit - changed from polendina to playwright-test for tests, couldn't get polendina to work. - add .vscode folder to auto setup biome extensions and settings
- Set "useAwait" to "off" and "noExplicitAny" to "off" in biome.json for now to many. - Update type definitions and comments across various files for clarity. - Simplify error handling in multiple catch blocks to improve readability. - Adjust test mocks to use consistent parameter naming conventions. - Updated the "test:watch" script in package.json to use "npm run" for consistency. - Removed redundant "source.fixAll.biome" setting from .vscode/settings.json to streamline configuration.
- Added new compiler options in tsconfig.json for improved module handling and strictness. - Refactored PDPServer to remove unnecessary await in PieceCID calculation for performance optimization. - Updated exports in piece/index.ts to use type exports for better clarity and maintainability. - Changed TypeScript version from "^5.8.3" to "5.8.3" to ensure consistent builds across environments. - Removed "DOM" and "DOM.Iterable" from the "lib" array in tsconfig.json to streamline the TypeScript configuration. - This change aims to reduce unnecessary library inclusions and improve build performance.
…es (FilOzone#173) Integrate KV metadata with Synapse Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
@snadrus Not sure if the intention if is to get this PR reviewed or its more for E2E on your end for now? But in general whenever something is ready for review, please be aware of the git-commit message guidelines, given that this repo has auto-publishing: https://github.com/FilOzone/synapse-sdk/blob/master/README.md#commit-message-guidelines |
sorry, I missed the 'draft' flag! |
src/pdp/server-pdp0.ts
Outdated
@@ -0,0 +1,547 @@ | |||
/** | |||
* PDPServer - Consolidated interface for all PDP server (Curio) HTTP operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can trim this doc down to say that it's the v0 interface, no need to give it the full treatment in here if we retain the full form in server.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduced
src/pdp/server-pdp1.ts
Outdated
const metadata = withCDN ? [this.getAuthHelper().WITH_CDN_METADATA] : [] | ||
// Generate the EIP-712 signature for data set creation | ||
const authData = await this.getAuthHelper().signCreateDataSet(clientDataSetId, payee, metadata) | ||
|
||
// Prepare the extra data for the contract call | ||
// This needs to match the DataSetCreateData struct in Warm Storage contract | ||
const extraData = this._encodeDataSetCreateData({ | ||
payer: await this.getAuthHelper().getSignerAddress(), | ||
metadata, | ||
signature: authData.signature, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could extract these EIP-712 bits into a common utils file since it's going to be common regardless, extraData is going to pass through in the same form in both pathways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a need to keep the PDPv1 client self-standing, so I'd prefer avoiding a common utils for (what should be) this short-lived transition.
src/pdp/server.ts
Outdated
this._implPromise = this._selectBackend() | ||
} | ||
|
||
private async _selectBackend(): Promise<Backend> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 is good
there's also a ping()
operation (see method below in this file) we do at the very beginning when we set up a StorageContext to make sure the provider we select is alive and we can work with it (we filter them out if we don't get a response). This selection essentially serves as a "ping" for v1, and as long as we're chatting to the provider, maybe we should do something like:
const v1 = new PDPServerPdp0(this._authHelper, baseUrl)
await v1.ping()
return v1
and then our ping()
in here becomes a noop and we get a ping every time we instantiate regardless of what it implements (plus also we never have to ping()
a v1 since it's implicit in it returning a products list)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Ref: FilOzone#165 (review) was accidentally added originally
* filCDNBeneficiaryAddress * fix test * fix checksum address
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.4.0 to 5.0.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v4.4.0...v5.0.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## [0.24.0](FilOzone/synapse-sdk@v0.23.2...v0.24.0) (2025-09-05) ### Features * add synapse.storage and StorageContext ([FilOzone#153](FilOzone#153)) ([7485b84](FilOzone@7485b84)) * **commp:** transition to CommPv2 ([c0c39a4](FilOzone@c0c39a4)) * **commp:** use "PieceCID" terminology, use v2 exclusively ([81f9ea8](FilOzone@81f9ea8)) * **commpv2:** Curio CommPv2 compatibility ([FilOzone#156](FilOzone#156)) ([d529e0b](FilOzone@d529e0b)) * EIP712 signing support for metadata in CreateDataSet and AddPices ([FilOzone#173](FilOzone#173)) ([f396e0d](FilOzone@f396e0d)) * major rename - pandora->warm storage, proof sets->data sets, roots->pieces ([6e1a743](FilOzone@6e1a743)) * sp registry ([e680f82](FilOzone@e680f82)) * **utils:** split client and provider functionality to make setup easier ([66c9d02](FilOzone@66c9d02)) * **warmstorage:** discover dependent contract addresses from WarmStorage ([984966b](FilOzone@984966b)) ### Bug Fixes * ignore deleted providers when searching for retrieval options ([FilOzone#159](FilOzone#159)) ([2b8c427](FilOzone@2b8c427)) * **pdp:** encode the metadata correctly in extraData ([c4aea98](FilOzone@c4aea98)) * **pdp:** isComplete on data set creation should include server status ([FilOzone#158](FilOzone#158)) ([5cf3dc1](FilOzone@5cf3dc1)) * trim trailing slash from serviceURL ([cf8be53](FilOzone@cf8be53)) * **warmstorage:** adapt to view contract using extsload ([f56f00e](FilOzone@f56f00e)) ### Trivial Changes * add biome and git hooks ([FilOzone#165](FilOzone#165)) ([425ba99](FilOzone@425ba99)) * change imports to .ts ([FilOzone#185](FilOzone#185)) ([778f779](FilOzone@778f779)) * **deps-dev:** bump chai from 5.3.3 to 6.0.1 ([FilOzone#164](FilOzone#164)) ([6d64b0b](FilOzone@6d64b0b)) * **deps:** bump actions/setup-node from 4.4.0 to 5.0.0 ([FilOzone#190](FilOzone#190)) ([b43d391](FilOzone@b43d391)) * FilCDNBeneficiary ([FilOzone#191](FilOzone#191)) ([b394840](FilOzone@b394840)) * fix biome warnings ([FilOzone#170](FilOzone#170)) ([6d62d88](FilOzone@6d62d88)) * remove simple-git-hooks from devDeps ([d600d5e](FilOzone@d600d5e)) * update ABI imports and clean up unused code ([FilOzone#187](FilOzone#187)) ([6bdd507](FilOzone@6bdd507)) * update contract addresses ([2227cc9](FilOzone@2227cc9)) * update for alpha release contracts ([4a60150](FilOzone@4a60150)) * update TypeScript configuration ([FilOzone#172](FilOzone#172)) ([0e521d1](FilOzone@0e521d1))
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.8.3 to 5.9.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml) - [Commits](microsoft/TypeScript@v5.8.3...v5.9.2) --- updated-dependencies: - dependency-name: typescript dependency-version: 5.9.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## [0.24.1](FilOzone/synapse-sdk@v0.24.0...v0.24.1) (2025-09-05) ### Trivial Changes * **deps-dev:** bump typescript from 5.8.3 to 5.9.2 ([FilOzone#193](FilOzone#193)) ([8892319](FilOzone@8892319))
FilOzone#195) The registry allows the provider to have a different payee to provider address so we can't match on it. But we can match on providerId because it can't change. Also allow for graceful fallback if we find data sets but none of them match a provider we can use - so we'll just make a new one.
## [0.24.2](FilOzone/synapse-sdk@v0.24.1...v0.24.2) (2025-09-06) ### Bug Fixes * **pdp:** select provider on ID, allow graceful fallback when no match ([FilOzone#195](FilOzone#195)) ([30d32af](FilOzone@30d32af))
I've left server.ts (except class rename) to make multi-party changes easier. |
No description provided.