Skip to content

refactor!: replace getMaxProvingPeriod() and getChallengeWindow() with getPDPConfig()#526

Merged
rvagg merged 5 commits into
FilOzone:masterfrom
akronim26:use/pdp_config
Jan 8, 2026
Merged

refactor!: replace getMaxProvingPeriod() and getChallengeWindow() with getPDPConfig()#526
rvagg merged 5 commits into
FilOzone:masterfrom
akronim26:use/pdp_config

Conversation

@akronim26
Copy link
Copy Markdown
Contributor

Fixes #520

  • Replaces getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig()

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Dec 24, 2025
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC Dec 24, 2025
@akronim26
Copy link
Copy Markdown
Contributor Author

I ran pnpm test and got following regarding the pieceStatus() test:

Failed to get PDP config: Error: execution reverted: "Warm Storage View: unknown function: getPDPConfig with args: undefined" (action="call", data="0x08c379a000000000000000000000000000000…
│     at makeError (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/utils/errors.ts:698:21)
│     at getBuiltinCallException (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/abi/abi-coder.ts:118:12)
│     at _AbiCoder.getBuiltinCallException (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/abi/abi-coder…
│     at _Interface.makeError (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/abi/interface.ts:925:32)
│     at staticCallResult (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/contract/contract.ts:340:42)
│     at processTicksAndRejections (node:internal/process/task_queues:103:5)
│     at staticCall (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/contract/contract.ts:303:24)
│     at Proxy.getPDPConfig (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/node_modules/.pnpm/ethers@6.16.0/node_modules/ethers/src.ts/contract/contract.ts:351:41)
│     at _WarmStorageService.getPDPConfig (file:///home/akronim26/Desktop/Skills/Blockchain/Opensource/synapse-sdk/packages/synapse-sdk/src/warm-storage/service.ts:1066:7)
│     at async Promise.all (index 1) {
│   code: 'CALL_EXCEPTION',
│   action: 'call',
│   data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000465761726d2053746f7261676520566965773a2075…
│   reason: 'Warm Storage View: unknown function: getPDPConfig with args: undefined',
│   transaction: {
│     to: '0xA5D87b04086B1d591026cCE10255351B5AA4689B',
│     data: '0xea0f9354'
│   },
│   invocation: {
│     method: 'getPDPConfig',
│     signature: 'getPDPConfig()',
│     args: _Result(0) []
│   },
│   revert: {
│     signature: 'Error(string)',
│     name: 'Error',
│     args: [
│       'Warm Storage View: unknown function: getPDPConfig with args: undefined'
│     ]
│   },
│   shortMessage: 'execution reverted: "Warm Storage View: unknown function: getPDPConfig with args: undefined"'
│ }

The error is:

Warm Storage View: unknown function: getPDPConfig with args: undefined

But I am not able to understand what I am doing wrong here.

@rvagg
Copy link
Copy Markdown
Collaborator

rvagg commented Jan 8, 2026

Also needs edits in docs/src/content/docs/developer-guides/components.mdx btw

@rvagg
Copy link
Copy Markdown
Collaborator

rvagg commented Jan 8, 2026

@akronim26 you need to update synapse-core/src/mocks/jsonrpc/warm-storage.ts. too -- look inside there and you'll see a big 'ol switch statement that intercepts calls. You should be able to remove getMaxProvingPeriod and challengeWindow from in there and insert a new getPDPConfig. The error is coming from actual network-level RPC calls but they are being intercepted by this mock infrastructure and it doesn't know about this call so rejects it. The stack trace is confusing because it shows the build-up to the call, but the fact that it gets to execution reverted means it's getting in there but the mock is faking a revert and telling you why.

@rvagg rvagg changed the title refactor: replace getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig() refactor!: replace getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig() Jan 8, 2026
@rvagg rvagg changed the title refactor!: replace getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig() refactor!: replace getMaxProvingPeriod() and getChallengeWindow() with getPDPConfig() Jan 8, 2026
Copy link
Copy Markdown
Collaborator

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

good work

@rvagg rvagg merged commit a4956c7 into FilOzone:master Jan 8, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to 🎉 Done in FOC Jan 8, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these should not have been removed, jsonrpc mock should support all the methods

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I disagree. Instead, the fix should have been to pull the latest ABI, in which the methods are removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same as before add not replace mocks should support all methods @akronim26 any chance you can make a PR to re-add the deleted methods ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, sure @hugomrdias. I'll open a PR soon for this.

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.

Use getPDPConfig() instead of individual PDP config getters

5 participants