Skip to content

feat(costs)!: per-operation pricing price list#823

Open
SgtPooki wants to merge 15 commits into
FilOzone:masterfrom
SgtPooki:synapse-per-operation-fee-structure
Open

feat(costs)!: per-operation pricing price list#823
SgtPooki wants to merge 15 commits into
FilOzone:masterfrom
SgtPooki:synapse-per-operation-fee-structure

Conversation

@SgtPooki
Copy link
Copy Markdown
Contributor

@SgtPooki SgtPooki commented Jun 3, 2026

What changed

Reshapes the Costs API to the GA per-operation pricing model. getPriceList() reads the full token / rates / fees / lockups catalogue from FilecoinWarmStorageServiceStateView.getPriceList() (filecoin-services#501); the effective-rate, lockup, deposit, and upload-cost paths, StorageManager, and the React usePriceList hook all read from it. Operator-approval maxLockupPeriod now reads getPriceList().lockups.defaultLockupPeriod (filecoin-services#503).

How to verify

pnpm -F @filoz/synapse-core build && pnpm -F @filoz/synapse-sdk build
pnpm -F @filoz/synapse-core test:node
pnpm -F @filoz/synapse-sdk test:node

Notes / risks

  • Do not publish until calibration and mainnet redeploy with filecoin-services#501. getPriceList() reverts on the current live contracts and there is no fallback (mocked tests pass).
  • The ABI is wired via a contained getPriceList fragment (src/abis/price-list.ts) instead of bumping the generated ref; in-code TODOs flag it for removal once FILECOIN_SERVICES_GIT_REF includes getPriceList.
  • Relates to Support new per-operation fee structure #763.

BREAKING CHANGE: removes getServicePrice() (core + SDK) and useServicePrice() in favor of getPriceList() / usePriceList(); drops the rate alias on upload costs (use rates), the LOCKUP_PERIOD export, and the addPiecesOperationCount cost option.

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jun 3, 2026
@SgtPooki SgtPooki force-pushed the synapse-per-operation-fee-structure branch from c6b9a5f to 847c4de Compare June 3, 2026 15:51
@rvagg
Copy link
Copy Markdown
Collaborator

rvagg commented Jun 4, 2026

@SgtPooki you should be able to change the generated.ts to point to a commit hash and get new ABI pulled in. I think this is fine, we're nearing the last of the changes pre-GA and it wouldn't be terrible to merge in a specific commit that's not on a tag, we can always follow-up later (and we'll get the auto PR now that there's a workflow in place).

Comment thread packages/synapse-core/src/utils/constants.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/calculate-upload-fees.ts
Comment thread packages/synapse-core/src/warm-storage/get-upload-costs.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/get-upload-costs.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/index.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/price-list.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/price-list.ts Outdated
Comment thread packages/synapse-react/src/warm-storage/use-service-price.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/calculate-effective-rate.ts Outdated
Comment thread packages/synapse-sdk/src/warm-storage/service.ts Outdated
@BigLep BigLep moved this from 📌 Triage to ⌨️ In Progress in FOC Jun 4, 2026
@SgtPooki SgtPooki force-pushed the synapse-per-operation-fee-structure branch from 847c4de to 79118bb Compare June 4, 2026 15:03
@SgtPooki SgtPooki requested a review from Copilot June 4, 2026 18:05
@SgtPooki SgtPooki marked this pull request as ready for review June 4, 2026 18:05
@SgtPooki SgtPooki requested a review from hugomrdias as a code owner June 4, 2026 18:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@SgtPooki SgtPooki requested a review from Copilot June 4, 2026 18:09
@SgtPooki SgtPooki changed the title feat(costs): per-operation pricing price list feat(costs)!: per-operation pricing price list Jun 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot stopped reviewing on behalf of SgtPooki due to an error June 4, 2026 19:04
Copilot stopped reviewing on behalf of SgtPooki due to an error June 4, 2026 19:26
@SgtPooki SgtPooki requested a review from rvagg June 4, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ⌨️ In Progress

Development

Successfully merging this pull request may close these issues.

4 participants