Skip to content

Conversation

@parthshah1
Copy link

Reference: https://filecoinproject.slack.com/archives/C07CGTXHHT4/p1759759227582029

This PR adds comprehensive support for devnet (local development network) to the Synapse SDK, enabling developers to test and develop against local Filecoin deployments.

Added a test for the same.

- Add 'devnet' to FilecoinNetworkType union type
- Add devnet chain ID (31415926) and network configuration
- Add devnet RPC URLs (localhost:1234)
- Support runtime contract address resolution for devnet
- Add queryGenesisTimestamp utility for dynamic genesis detection
- Update all services to accept multicall3Address parameter
- Restore provider-resolver.ts for devnet compatibility
- Add devnet-specific options to SynapseOptions interface
- Disable CDN/IPNI features for devnet environment
- Include devnet registration script for service providers

This enables full devnet support with runtime-determined contract addresses,
dynamic genesis timestamp detection, and proper service initialization.
- Remove extensive console.log debugging statements from PDPServer.createAndAddPieces
- Remove conditional DEBUG_PDP console.debug statements from StorageContext
- Remove debug utility scripts: debug-create-dataset.js, debug-curio-ping.js, test-piece-upload-flow.js

These were added for troubleshooting during devnet support development and are no longer needed.
- Revert sp.ts code cleanup (request body refactoring)
- Revert pdp/server.ts comment changes and code cleanup
- Revert storage/context.ts code cleanup
- Revert errors/pdp.ts error message improvements
- Remove provider-resolver.ts (general utility, not devnet-specific)
- Remove all utils/ folder changes (including devnet-register-sp.js)

Keep only devnet configuration changes for multicall3, warmstorage, and contract addresses.
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Nov 26, 2025
@parthshah1 parthshah1 changed the title Devnet support v2 feat: Synapse Devnet support Nov 26, 2025
@rvagg
Copy link
Collaborator

rvagg commented Dec 1, 2025

@parthshah1 can you try deploying multicall3 using their deployment instructions: https://github.com/mds1/multicall3?tab=readme-ov-file#new-deployments - you should be able to get it deployed to a stable address 0xcA11bde05977b3631167028862bE2a173976CA11 and not have to change it in here. That address is stable across all (?) of the chains it's deployed on, including Filecoin's mainnet and calibnet and should be possible on devnet.

@parthshah1
Copy link
Author

@rvagg I don't think that would be the case if we deploy using forge. I get different multicall address everytime I deploy it using forge. I can add a default in case we need to keep it constant v/s defined via env var.

@parthshah1
Copy link
Author

@rvagg Secondly, how often are util scripts like sp-tool and/or post-deploy client mode used. Because I haven't changed those. I can extend the support to that too, maybe I should. Wdyt?

@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FS Dec 4, 2025
@rvagg
Copy link
Collaborator

rvagg commented Dec 5, 2025

sp-tool isn't used very much. Curio now has registry setup tooling in it now, although I use the warm functionality in there when I'm setting up my own calibnet test environment to approve my provider. Most of the rest of the things in utils/ probably need to be cleared out. The post-deploy setup stuff is mostly handled quite well by filecoin-pin payments setup now plus the Curio SP setup.

@parthshah1
Copy link
Author

@rvagg Understood. I use them to register and add my provider. So I will add support to sp-tool and not touch any other files.
It is not a big change anyway.

@parthshah1
Copy link
Author

@rvagg Did another pass on this. The multicall3 can't be deployed to get us a canonical address in devnet. I tried deploying using pre signed transaction. I get

Error: server returned an error response: error code 1: verify msg failed: message will not be included in a block: 'GasLimit' field cannot be less than the cost of storing a message on chain 1000000 < 4040863

And deploying using forge will lead us to different addresses.

Happy to know your thoughts.

@rvagg
Copy link
Collaborator

rvagg commented Dec 10, 2025

I'd love to know how we got multicall3 into mainnet and calibnet when we need far more gas than the presigned transaction allows for:

Apparently the multicall3 deployer private key was compromised so maybe that was obtained from somewhere to get them deployed on Filecoin, unless this was part of a network upgrade I'm not aware of.

@eshon do you happen to have background of our multicall3 deployments and who did them?

@BigLep
Copy link
Contributor

BigLep commented Dec 17, 2025

2025-12-17 conversation:

@BigLep
Copy link
Contributor

BigLep commented Jan 8, 2026

@redpanda-f : can you take a look at this and how it relates to #527 ? Is there anything from this PR that should be moved over to #527 ? I assume once we have done that, we can close this PR.

@parthshah1
Copy link
Author

@BigLep I think safe to close this PR in favor of #527. It covers almost all aspects of this PR.

@BigLep
Copy link
Contributor

BigLep commented Jan 8, 2026

Thanks @parthshah1 . Closing.

@BigLep BigLep closed this Jan 8, 2026
@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to 🎉 Done in FS Jan 8, 2026
@eshon
Copy link

eshon commented Jan 8, 2026

@eshon do you happen to have background of our multicall3 deployments and who did them?

@rvagg - I asked them to deploy it themselves in 2023 here and they owned the private key for it.

Generally legacy deterministic address EVM deployments don't work well on Filecoin due to different gas values needed from Ethereum. In the Safe model, you can ask them to do it in one of their repos and they review the request and do it for you with their key eventually.

@rvagg
Copy link
Collaborator

rvagg commented Jan 8, 2026

Wonderful, thanks for the historical artefact link @eshon

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.

4 participants