Skip to content

Conversation

@wjmelements
Copy link
Contributor

Reviewers @rvagg @hugomrdias

Context

Toward #312

Changes

  • mockServiceProviderRegistry
  • WIP createContexts

wjmelements and others added 19 commits October 10, 2025 01:04
* 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
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Oct 18, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 18, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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(
Copy link
Collaborator

Choose a reason for hiding this comment

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

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 -1 to 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 isNewDataSet that's not used anywhere. Let's remove that.
  • isExisting is only used for the callback, but also is now overloading our use of -1 in dataSetId, 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was planning to make this method private

@rvagg rvagg force-pushed the next branch 2 times, most recently from 162d489 to 0e3e5fa Compare October 22, 2025 13:06
@wjmelements
Copy link
Contributor Author

that's an evil rebase

@rvagg
Copy link
Collaborator

rvagg commented Oct 23, 2025

that's an evil rebase
then don't give me merge commits to deal with, they're not making it in to master and we're not squash merging a huge amount of disparate functionality

Base automatically changed from next to master October 28, 2025 04:25
@wjmelements
Copy link
Contributor Author

Planning to close this and open a new PR.

@wjmelements wjmelements linked an issue Oct 29, 2025 that may be closed by this pull request
@wjmelements wjmelements mentioned this pull request Oct 30, 2025
@wjmelements
Copy link
Contributor Author

Closing in favor of #368

@github-project-automation github-project-automation bot moved this from 📌 Triage to 🎉 Done in FOC Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Default Replication

4 participants