Conversation
* randIndex * update _encodeDataSetCreateData * add failing randIndex test * fix test * always test the fallback methods * test rand 256 * use bigint literal * randU256 * fallbackRandU256 * export rand functions in index.ts
* fix: Use clientAddress for next dataset ID (#299) fix: resolves bug of using client address instead of signer for datsetId lookup * chore(master): release synapse-sdk 0.31.1 (#300) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * update abi and fix tests * remove cdnEndEpoch from type * Update packages/synapse-sdk/wagmi.config.ts Co-authored-by: Rod Vagg <rod@vagg.org> --------- Co-authored-by: Shashank Trivedi <100513286+lordshashank@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Rod Vagg <rod@vagg.org>
chore: update for M3 contracts chore: update for M3 contracts
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
synapse-dev | 6393997 | Commit Preview URL Branch Preview URL |
Oct 22 2025, 03:57 AM |
| return await StorageContext.createWithSelectedProvider(resolution, synapse, warmStorageService, options) | ||
| } | ||
|
|
||
| static async createWithSelectedProvider( |
There was a problem hiding this comment.
Now that we're exposting this, we're essentially exposing ProviderSelectionResult as a public type that someone might use. So we should look at this flow a little more critically.
- We use
-1to signal that a new dataSet needs to be made, but we could also just omit it for that case I think. - The type has a bizzaro
isNewDataSetthat's not used anywhere. Let's remove that. isExistingis only used for the callback, but also is now overloading our use of-1indataSetId, so we don't really need it now either- The type really is a combination of Provider+DataSet (which is what a Context is supposed to be structured around), so how about we rename it.
Here's an interesting option, make it an "intent" for how we want the context to be:
interface StorageContextIntent {
provider: ProviderInfo
dataSetIntent:
| { action: 'create', metadata: Record<string, string> }
| { action: 'reuse', id: number, metadata: Record<string, string> }
}Simple variation that's not to different to now:
interface ProviderDataSetSelection {
provider: ProviderInfo
dataSetId?: number // undefined = needs creation
dataSetMetadata: Record<string, string>
}But I think I like the explicit descriptiveness of an intent.
There was a problem hiding this comment.
I was planning to make this method private
162d489 to
0e3e5fa
Compare
|
that's an evil rebase |
|
|
Planning to close this and open a new PR. |
|
Closing in favor of #368 |
Reviewers @rvagg @hugomrdias
Context
Toward #312
Changes