Skip to content
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6be6998
Baseline super-good-enough cert
Kubuxu Nov 12, 2025
374acc3
stub decodeEndorsements
wjmelements Nov 12, 2025
5a4ec65
preferEndorsements
wjmelements Nov 12, 2025
8ce3807
start decoding endorsements
Kubuxu Nov 13, 2025
ea1c8f8
notAfter as timesetamp
wjmelements Nov 13, 2025
b2538d1
encodeEndorsements
wjmelements Nov 13, 2025
174a7e8
mv cert.ts to utils
wjmelements Nov 14, 2025
0959768
utils export from cert.ts
wjmelements Nov 14, 2025
8fdb6bf
fix test
wjmelements Nov 14, 2025
67af7c0
test that createContexts prefers endorsements
wjmelements Nov 14, 2025
a34808c
encode/decode certs with domain separator
wjmelements Nov 14, 2025
953f4c8
add cert test
wjmelements Nov 15, 2025
c4ea7c7
Merge remote-tracking branch 'origin/master' into feat/super-good-eno…
wjmelements Nov 15, 2025
e5236ad
add tools/endorse-sp.js
wjmelements Nov 15, 2025
ebebd81
increase timeout for CI
wjmelements Nov 15, 2025
344d9d2
make the decodeEndorsements a bit simpler
Kubuxu Nov 15, 2025
c81971a
add more tests
Kubuxu Nov 15, 2025
7c784b7
Update packages/synapse-core/src/utils/cert.ts
wjmelements Nov 16, 2025
cdcf6d4
rm sinon
wjmelements Nov 17, 2025
7c58dd8
Update packages/synapse-core/src/utils/cert.ts
wjmelements Nov 17, 2025
6874d4a
cleanup
wjmelements Nov 17, 2025
77a4524
Update packages/synapse-core/src/utils/cert.ts
wjmelements Nov 17, 2025
1318554
Merge remote-tracking branch 'origin/master' into feat/endorsement-ce…
wjmelements Nov 25, 2025
f1a66ef
disallow undefined chainId in decodeEndorsement
wjmelements Nov 25, 2025
72047d7
accept any of the preferred endorsements
wjmelements Nov 26, 2025
57c44a7
Merge remote-tracking branch 'origin/master' into feat/endorsement-ce…
wjmelements Jan 13, 2026
9f55a11
remove certs
wjmelements Jan 13, 2026
1aace20
wagmi
wjmelements Jan 13, 2026
b236a21
constants
wjmelements Jan 13, 2026
8020db0
EndorsementsService
wjmelements Jan 13, 2026
3e91700
plumbing
wjmelements Jan 14, 2026
c50a632
import type
wjmelements Jan 14, 2026
422f105
add endorsements mock and restore test
wjmelements Jan 14, 2026
2a96464
add endorsements script to examples/cli
wjmelements Jan 15, 2026
c76237c
delete keystore when init with pk
wjmelements Jan 15, 2026
a7718ff
Revert "delete keystore when init with pk"
wjmelements Jan 15, 2026
9410618
fix lint
wjmelements Jan 15, 2026
1734d72
isCancel
wjmelements Jan 15, 2026
59c313b
serviceURL
wjmelements Jan 15, 2026
7c10429
Merge remote-tracking branch 'origin/master' into feat/endorsement-set
wjmelements Jan 15, 2026
a8696ba
lint
wjmelements Jan 15, 2026
6d429c2
decodePDPCapabilities is not async
wjmelements Jan 20, 2026
8628eff
Merge remote-tracking branch 'origin/master' into feat/endorsement-set
wjmelements Jan 20, 2026
dacf3f8
Revert "chore: re-add `getMaxProvingPeriod` and `challengeWindow` fun…
wjmelements Jan 20, 2026
2423079
getContract
wjmelements Jan 20, 2026
cb582d8
test fallback on ping failure
wjmelements Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 206 additions & 39 deletions packages/synapse-core/src/abis/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,6 @@ export const errorsAbi = [
],
name: 'InsufficientCapabilitiesForProduct',
},
{
type: 'error',
inputs: [
{ name: 'payer', internalType: 'address', type: 'address' },
{ name: 'minimumRequired', internalType: 'uint256', type: 'uint256' },
{ name: 'available', internalType: 'uint256', type: 'uint256' },
],
name: 'InsufficientFundsForMinimumRate',
},
{
type: 'error',
inputs: [
Expand All @@ -167,6 +158,15 @@ export const errorsAbi = [
],
name: 'InsufficientLockupAllowance',
},
{
type: 'error',
inputs: [
{ name: 'payer', internalType: 'address', type: 'address' },
{ name: 'minimumRequired', internalType: 'uint256', type: 'uint256' },
{ name: 'available', internalType: 'uint256', type: 'uint256' },
],
name: 'InsufficientLockupFunds',
},
{
type: 'error',
inputs: [
Expand Down Expand Up @@ -418,6 +418,15 @@ export const errorsAbi = [
inputs: [{ name: 'railId', internalType: 'uint256', type: 'uint256' }],
name: 'RailNotAssociated',
},
{
type: 'error',
inputs: [
{ name: 'railId', internalType: 'uint256', type: 'uint256' },
{ name: 'settledUpTo', internalType: 'uint256', type: 'uint256' },
{ name: 'endEpoch', internalType: 'uint256', type: 'uint256' },
],
name: 'RailNotFullySettled',
},
{ type: 'error', inputs: [], name: 'ServiceContractMustTerminateRail' },
{
type: 'error',
Expand Down Expand Up @@ -2883,15 +2892,6 @@ export const filecoinWarmStorageServiceAbi = [
inputs: [{ name: 'dataSetId', internalType: 'uint256', type: 'uint256' }],
name: 'FilBeamServiceNotConfigured',
},
{
type: 'error',
inputs: [
{ name: 'payer', internalType: 'address', type: 'address' },
{ name: 'minimumRequired', internalType: 'uint256', type: 'uint256' },
{ name: 'available', internalType: 'uint256', type: 'uint256' },
],
name: 'InsufficientFundsForMinimumRate',
},
{
type: 'error',
inputs: [
Expand All @@ -2907,6 +2907,15 @@ export const filecoinWarmStorageServiceAbi = [
],
name: 'InsufficientLockupAllowance',
},
{
type: 'error',
inputs: [
{ name: 'payer', internalType: 'address', type: 'address' },
{ name: 'minimumRequired', internalType: 'uint256', type: 'uint256' },
{ name: 'available', internalType: 'uint256', type: 'uint256' },
],
name: 'InsufficientLockupFunds',
},
{
type: 'error',
inputs: [
Expand Down Expand Up @@ -3132,6 +3141,15 @@ export const filecoinWarmStorageServiceAbi = [
inputs: [{ name: 'railId', internalType: 'uint256', type: 'uint256' }],
name: 'RailNotAssociated',
},
{
type: 'error',
inputs: [
{ name: 'railId', internalType: 'uint256', type: 'uint256' },
{ name: 'settledUpTo', internalType: 'uint256', type: 'uint256' },
{ name: 'endEpoch', internalType: 'uint256', type: 'uint256' },
],
name: 'RailNotFullySettled',
},
{ type: 'error', inputs: [], name: 'ServiceContractMustTerminateRail' },
{
type: 'error',
Expand Down Expand Up @@ -3198,13 +3216,6 @@ export const filecoinWarmStorageServiceStateViewAbi = [
],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [],
name: 'challengeWindow',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'payer', internalType: 'address', type: 'address' }],
Expand Down Expand Up @@ -3273,13 +3284,6 @@ export const filecoinWarmStorageServiceStateViewAbi = [
outputs: [{ name: 'count', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'getChallengesPerProof',
outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }],
stateMutability: 'pure',
},
{
type: 'function',
inputs: [{ name: 'client', internalType: 'address', type: 'address' }],
Expand Down Expand Up @@ -3375,13 +3379,6 @@ export const filecoinWarmStorageServiceStateViewAbi = [
],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'getMaxProvingPeriod',
outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
Expand Down Expand Up @@ -4281,6 +4278,124 @@ export const pdpVerifierConfig = {
abi: pdpVerifierAbi,
} as const

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ProviderIdSet
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* - [__View Contract on Filecoin Mainnet Filfox__](https://filfox.info/en/address/0x59eFa2e8324E1551d46010d7B0B140eE2F5c726b)
* - [__View Contract on Filecoin Calibration Filscan__](https://calibration.filscan.io/address/0xAA2f7CfC7ecAc616EC9C1f6d700fAd19087FAC84)
*/
export const providerIdSetAbi = [
{ type: 'constructor', inputs: [], stateMutability: 'nonpayable' },
{
type: 'function',
inputs: [{ name: 'providerId', internalType: 'uint256', type: 'uint256' }],
name: 'addProviderId',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [{ name: 'providerId', internalType: 'uint256', type: 'uint256' }],
name: 'containsProviderId',
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'getProviderIds',
outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
name: 'owner',
outputs: [{ name: '', internalType: 'address', type: 'address' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [{ name: 'providerId', internalType: 'uint256', type: 'uint256' }],
name: 'removeProviderId',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [],
name: 'renounceOwnership',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }],
name: 'transferOwnership',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'event',
anonymous: false,
inputs: [
{
name: 'previousOwner',
internalType: 'address',
type: 'address',
indexed: true,
},
{
name: 'newOwner',
internalType: 'address',
type: 'address',
indexed: true,
},
],
name: 'OwnershipTransferred',
},
{
type: 'error',
inputs: [{ name: 'owner', internalType: 'address', type: 'address' }],
name: 'OwnableInvalidOwner',
},
{
type: 'error',
inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
name: 'OwnableUnauthorizedAccount',
},
{
type: 'error',
inputs: [{ name: 'providerId', internalType: 'uint256', type: 'uint256' }],
name: 'ProviderIdNotFound',
},
{
type: 'error',
inputs: [{ name: 'providerId', internalType: 'uint256', type: 'uint256' }],
name: 'ProviderIdTooLarge',
},
] as const

/**
* - [__View Contract on Filecoin Mainnet Filfox__](https://filfox.info/en/address/0x59eFa2e8324E1551d46010d7B0B140eE2F5c726b)
* - [__View Contract on Filecoin Calibration Filscan__](https://calibration.filscan.io/address/0xAA2f7CfC7ecAc616EC9C1f6d700fAd19087FAC84)
*/
export const providerIdSetAddress = {
314: '0x59eFa2e8324E1551d46010d7B0B140eE2F5c726b',
314159: '0xAA2f7CfC7ecAc616EC9C1f6d700fAd19087FAC84',
} as const

/**
* - [__View Contract on Filecoin Mainnet Filfox__](https://filfox.info/en/address/0x59eFa2e8324E1551d46010d7B0B140eE2F5c726b)
* - [__View Contract on Filecoin Calibration Filscan__](https://calibration.filscan.io/address/0xAA2f7CfC7ecAc616EC9C1f6d700fAd19087FAC84)
*/
export const providerIdSetConfig = {
address: providerIdSetAddress,
abi: providerIdSetAbi,
} as const

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ServiceProviderRegistry
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -4377,6 +4492,27 @@ export const serviceProviderRegistryAbi = [
outputs: [{ name: 'providerId', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
},
{
type: 'function',
inputs: [
{
name: 'plannedUpgrade',
internalType: 'struct ServiceProviderRegistry.PlannedUpgrade',
type: 'tuple',
components: [
{
name: 'nextImplementation',
internalType: 'address',
type: 'address',
},
{ name: 'afterEpoch', internalType: 'uint96', type: 'uint96' },
],
},
],
name: 'announcePlannedUpgrade',
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [],
Expand Down Expand Up @@ -4747,6 +4883,16 @@ export const serviceProviderRegistryAbi = [
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
inputs: [],
name: 'nextUpgrade',
outputs: [
{ name: 'nextImplementation', internalType: 'address', type: 'address' },
{ name: 'afterEpoch', internalType: 'uint96', type: 'uint96' },
],
stateMutability: 'view',
},
{
type: 'function',
inputs: [],
Expand Down Expand Up @@ -5120,6 +5266,27 @@ export const serviceProviderRegistryAbi = [
],
name: 'ProviderRemoved',
},
{
type: 'event',
anonymous: false,
inputs: [
{
name: 'plannedUpgrade',
internalType: 'struct ServiceProviderRegistry.PlannedUpgrade',
type: 'tuple',
components: [
{
name: 'nextImplementation',
internalType: 'address',
type: 'address',
},
{ name: 'afterEpoch', internalType: 'uint96', type: 'uint96' },
],
indexed: false,
},
],
name: 'UpgradeAnnounced',
},
{
type: 'event',
anonymous: false,
Expand Down
1 change: 1 addition & 0 deletions packages/synapse-core/src/abis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
filecoinPayV1Abi as payments,
filecoinWarmStorageServiceStateViewAbi as storageView,
pdpVerifierAbi as pdp,
providerIdSetAbi as providerIdSet,
serviceProviderRegistryAbi as serviceProviderRegistry,
sessionKeyRegistryAbi as sessionKeyRegistry,
} from './generated.ts'
12 changes: 12 additions & 0 deletions packages/synapse-core/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export interface Chain extends ViemChain {
address: Address
abi: typeof Abis.pdp
}
endorsements: {
address: Address
abi: typeof Abis.providerIdSet
}
}
}

Expand Down Expand Up @@ -120,6 +124,10 @@ export const mainnet: Chain = {
address: Abis.generated.pdpVerifierAddress['314'],
abi: Abis.pdp,
},
endorsements: {
address: Abis.generated.providerIdSetAddress['314'],
abi: Abis.providerIdSet,
},
},
}

Expand Down Expand Up @@ -194,6 +202,10 @@ export const calibration: Chain = {
address: Abis.generated.pdpVerifierAddress['314159'],
abi: Abis.pdp,
},
endorsements: {
address: Abis.generated.providerIdSetAddress['314159'],
abi: Abis.providerIdSet,
},
},
testnet: true,
}
Expand Down
2 changes: 2 additions & 0 deletions packages/synapse-core/src/mocks/jsonrpc/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export const ADDRESSES = {
warmStorage: mainnet.contracts.storage.address,
multicall3: mainnet.contracts.multicall3.address,
pdpVerifier: mainnet.contracts.pdp.address,
endorsements: mainnet.contracts.endorsements.address,
},
calibration: {
warmStorage: calibration.contracts.storage.address,
multicall3: calibration.contracts.multicall3.address,
pdpVerifier: calibration.contracts.pdp.address,
payments: calibration.contracts.payments.address,
endorsements: calibration.contracts.endorsements.address,
usdfcToken: calibration.contracts.usdfc.address,
filCDN: zeroAddress,
viewContract: calibration.contracts.storageView.address,
Expand Down
Loading
Loading