refactor!: replace getMaxProvingPeriod() and getChallengeWindow() with getPDPConfig()#526
Conversation
|
I ran 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:
But I am not able to understand what I am doing wrong here. |
|
Also needs edits in docs/src/content/docs/developer-guides/components.mdx btw |
|
@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 |
getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig()getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig()
getMaxProvingPeriod() and getChallengeWindow() by getPDPConfig()getMaxProvingPeriod() and getChallengeWindow() with getPDPConfig()
There was a problem hiding this comment.
these should not have been removed, jsonrpc mock should support all the methods
There was a problem hiding this comment.
I disagree. Instead, the fix should have been to pull the latest ABI, in which the methods are removed.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Yeah, sure @hugomrdias. I'll open a PR soon for this.
… with `getPDPConfig()` (FilOzone#526)
Fixes #520
getMaxProvingPeriod()andgetChallengeWindow()bygetPDPConfig()