Skip to content

refactor: viem base branch#555

Merged
hugomrdias merged 94 commits into
masterfrom
hugomrdias/move-tests
Feb 3, 2026
Merged

refactor: viem base branch#555
hugomrdias merged 94 commits into
masterfrom
hugomrdias/move-tests

Conversation

@hugomrdias
Copy link
Copy Markdown
Member

@hugomrdias hugomrdias commented Jan 15, 2026

-Removed the PDPAuthHelper class to simplify authentication processes.
-Updated PDPServer to directly utilize the Client from viem for improved integration.
-Refactored StorageContext to eliminate dependencies on the removed PDPAuthHelper, enhancing clarity and maintainability.
-Adjusted metadata handling to use MetadataObject for consistency across the codebase.
-Removed outdated tests related to PDPAuthHelper and updated existing tests to reflect the new structure.

closes #516

@hugomrdias hugomrdias requested a review from rvagg as a code owner January 15, 2026 12:14
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jan 15, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 15, 2026

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 d75fb75 Commit Preview URL

Branch Preview URL
Feb 03 2026, 12:01 PM

@hugomrdias hugomrdias self-assigned this Jan 15, 2026
@hugomrdias hugomrdias marked this pull request as draft January 15, 2026 12:25
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Jan 15, 2026
@rjan90 rjan90 added this to the M4: Filecoin Service Liftoff milestone Jan 15, 2026
@rjan90
Copy link
Copy Markdown
Collaborator

rjan90 commented Jan 15, 2026

@hugomrdias this seems to be the fix for multiple issues in our backlog, can you add which this PR will close, just so that we keep track of which issue tickets are current in progress

@hugomrdias hugomrdias force-pushed the hugomrdias/move-tests branch from 064e600 to c04ee29 Compare January 15, 2026 15:14
@hugomrdias hugomrdias marked this pull request as ready for review January 15, 2026 16:07
Comment thread packages/synapse-core/src/utils/constants.ts
Comment thread examples/cli/src/commands/datasets.ts Outdated
Comment thread packages/synapse-core/test/typed-data.test.ts
Comment thread packages/synapse-core/src/typed-data/sign-create-dataset.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/data-sets.ts Outdated
Comment thread packages/synapse-core/src/warm-storage/data-sets.ts Outdated
Comment thread packages/synapse-sdk/src/utils/viem.ts Outdated
Comment thread packages/synapse-sdk/src/test/synapse.test.ts Outdated
@rjan90 rjan90 mentioned this pull request Jan 19, 2026
Comment thread packages/synapse-sdk/src/synapse.ts Outdated
@rvagg
Copy link
Copy Markdown
Collaborator

rvagg commented Jan 19, 2026

hugomrdias/move-tests - your branch naming is betraying just how far you evolved from your initial goals

First pass review done, comments left in line, no major objections from me

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jan 20, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm markdown-it is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/markdownlint-cli2@0.20.0npm/markdown-it@14.1.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/markdown-it@14.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm vite is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: apps/synapse-playground/package.jsonnpm/vite@7.3.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vite@7.3.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@BigLep BigLep linked an issue Jan 26, 2026 that may be closed by this pull request
@BigLep BigLep moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Jan 26, 2026
@BigLep
Copy link
Copy Markdown
Contributor

BigLep commented Jan 26, 2026

@hugomrdias : what more is remaining for merging this?

- Renamed the ipniPeerID field to ipniPeerId across multiple files for consistency with naming conventions.
- Updated related command examples and decoding logic to reflect the new field name.
- Ensured that the changes are reflected in tests to maintain functionality and accuracy.
- Changed the instantiation of FilBeamRetriever to use ChainRetriever instead of baseRetriever, enhancing the retrieval process.
- This adjustment aligns with recent updates to the provider handling logic, improving overall maintainability and performance.
…tation

- Added new functions for managing service providers, including addProduct, removeProduct, and updateProduct, to streamline product management within the service provider registry.
- Introduced methods for querying active providers and provider counts, improving the overall functionality of the service provider registry.
- Updated documentation to clarify the usage of new functions and their parameters, ensuring consistency and ease of understanding for developers.
- Removed deprecated provider-related code from the warm-storage module to enhance code clarity and maintainability.
- Enhanced error handling in service provider functions to provide clearer feedback on operation failures.
…y and rpcURL

- Updated multiple CLI command files to eliminate the use of privateKey and rpcURL, streamlining the client initialization process.
- Adjusted the Synapse instantiation to utilize the client directly, enhancing code clarity and maintainability.
- Added endorsements index to knip configuration for improved source tracking.
- Added new endorsements module to manage endorsed provider IDs, including the `getProviderIds` function for fetching endorsed provider IDs from the blockchain.
- Implemented `getProviderIdsCall` to facilitate contract calls and `parseGetProviderIds` for processing the results.
- Updated AGENTS.md to document the new ProviderIdSet smart contract and its functionality.
- Enhanced the package.json and tsconfig.json to include endorsements in type definitions and entry points.
- Refactored related components to integrate endorsements into the existing service provider structure, improving overall functionality and maintainability.
- Added tests for the new endorsements functionality to ensure reliability and correctness.
…rvice

- Refactored the Synapse class to simplify initialization and improve clarity by removing the EndorsementsService and related logic.
- Updated the SynapseOptions interface to utilize the new client-based approach, enhancing consistency across service interactions.
- Adjusted FilBeamService and FilBeamRetriever to work with the new Chain type, improving type safety and maintainability.
- Enhanced the StorageContext and StorageManager to align with the updated service provider structure, ensuring compatibility with the latest changes.
- Removed deprecated imports and functions related to endorsements, streamlining the codebase and improving overall maintainability.
- Removed the specific version of ethers from pnpm-workspace.yaml.
- Updated react and react-dom to version 19.2.4 in synapse-playground/package.json.
- Changed viem dependency to version 2.x in docs/package.json, examples/cli/package.json, and synapse-playground/package.json.
- Updated ox dependency to version 0.12.0 in pnpm-workspace.yaml.
- Updated the ipniPeerID field to ipniPeerId in the constants file for consistency with naming conventions.
- Removed deprecated ipniPeerID handling from the decodePDPCapabilities function, streamlining the code and improving clarity.
- Ensured that changes are reflected across relevant areas to maintain functionality and accuracy.
- Replaced instances of ethers with viem in multiple documentation files to reflect the new dependency.
- Updated code snippets to utilize privateKeyToAccount for account management, enhancing clarity and consistency.
- Standardized the use of `// @lib: esnext,dom` in code examples to ensure proper library usage.
- Removed deprecated code and adjusted examples to align with the latest SDK structure and functionality.
- Updated the Synapse class to streamline the creation process, replacing the static create method with a constructor that accepts options directly.
- Improved type definitions for the Client, incorporating PublicRpcSchema and PublicActions for better type safety.
- Refactored the WarmStorageService and PDPVerifier to align with the new client-based initialization approach.
- Enhanced SynapseOptions and added SynapseFromClientOptions interfaces for clearer configuration management.
- Adjusted tests to reflect the new instantiation patterns, ensuring consistency across the codebase.
- Replaced the static create method with the constructor for Synapse initialization in multiple CLI command files (fund, pay, pieces, upload).
- This change enhances code clarity and aligns with the recent refactor of the Synapse SDK for improved instantiation patterns.
- Added the Simplify utility type to enhance the OptionsType definition in getActivePiecesCall, streamlining type management.
- Ensured that the chain property is included in the refined type structure for better clarity and consistency.
- Introduced the ActionCallChain type across various modules to streamline contract call options, improving type consistency and clarity.
- Updated multiple function signatures to utilize the new ActionCallChain type, enhancing type safety and reducing redundancy.
- Improved documentation with examples for several functions in the pdp-verifier module, ensuring better usability and understanding for developers.
- Adjusted comments and code structure for clarity, aligning with recent refactoring efforts in the Synapse SDK.
- Replaced capabilityKeys and capabilityValues with pdpOffering in multiple test cases for the registerProvider function, enhancing clarity and consistency in the test structure.
- Added epoch.ts export to utils index for improved module accessibility.
- Modified tsconfig.json to include additional files for better type checking and module resolution.
- Removed epoch utilities from the utils directory and adjusted imports in context.ts to reflect this change.
- Deleted the epoch.test.ts file as it is no longer relevant following the removal of epoch utilities.
- Updated synapse.test.ts to clean up unused imports, enhancing code clarity.
- Changed references from `pnpm run fix` to `pnpm run lint:fix` in the AGENTS.md file to accurately reflect the correct command for linting and auto-fixing code before commits.
- Ensured consistency in documentation regarding development commands and linting practices.
- Upgraded several package dependencies in synapse-playground, including @nanostores/persistent, lucide-react, react-dropzone, and wrangler to their latest versions for improved functionality and security.
- Changed import statements in WarmStorageService and StorageMenu components from useAccount to useConnection for better alignment with the updated wagmi library.
- Updated viem dependency to version ~2.45.1 in multiple package.json files for consistency across projects.
…ction

- Upgraded type-fest from version 5.1.0 to 5.4.3 in package.json for improved type definitions.
- Added a timeout parameter to the deletePiece function to enhance request handling in sp.ts.
- Cleaned up the getPieces function in pieces.ts by removing unnecessary contractAddress references, improving code clarity.
- Changed the versioning of the 'viem' and 'zod' dependencies to 'catalog:' in multiple package.json files for consistency across projects.
- Upgraded '@clack/prompts' dependency in the CLI example to version '^1.0.0'.
- Added a new 'withdraw' command to the CLI for withdrawing funds from the wallet, improving functionality.
- Refactored error handling in several CLI commands to use a consistent spinner error display, enhancing user experience.
- Added 'viem' dependency to package.json for enhanced functionality.
- Updated onPiecesAdded method signature in UploadCallbacks interface for better type clarity.
- Changed depositWithPermitAndApproveOperator method documentation to accurately reflect the return type as 'Transaction hash'.
- Added 'viem' and 'zod' dependencies to pnpm-workspace.yaml for improved functionality and type safety across projects.
@hugomrdias hugomrdias force-pushed the hugomrdias/move-tests branch from a5f8971 to d75fb75 Compare February 3, 2026 11:52
@hugomrdias hugomrdias merged commit 3741241 into master Feb 3, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Feb 3, 2026
lordshashank pushed a commit to lordshashank/synapse-sdk that referenced this pull request Mar 9, 2026
Follow [migration guide](https://docs.filecoin.cloud/developer-guides/migration-guide/#filozsynapse-sdk-0370)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Abhivansh <31AbhivanshJ@gmail.com>
Co-authored-by: William Morriss <wjmelements@gmail.com>
Co-authored-by: Miroslav Bajtoš <oss@bajtos.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

5 participants