Skip to content

Conversation

@rvagg
Copy link
Collaborator

@rvagg rvagg commented Oct 28, 2025

This is an awkward mashup of the work @wjmelements is doing in #356 and some ABI update work I was doing as well.

It's likely not perfect, hasn't been properly tested, but should match the latest filecoin-services ABI.

There's some follow-ups in here:

@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Oct 28, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 28, 2025

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

Branch Preview URL
Oct 28 2025, 05:34 PM

@rjan90 rjan90 moved this from 📌 Triage to ⌨️ In Progress in FS Oct 28, 2025
@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 28, 2025

I've created #362

Copy link
Contributor

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

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

SGTM and I can confirm that it works

} catch {
return null
}
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

We should resolve this before merge

@hugomrdias
Copy link
Collaborator

im working on this, demo app doesnt work currently

Signed-off-by: Jakub Sztandera <[email protected]>
@hugomrdias hugomrdias merged commit a2c2dea into master Oct 28, 2025
11 checks passed
@hugomrdias hugomrdias deleted the rvagg/abi-next branch October 28, 2025 17:34
@github-project-automation github-project-automation bot moved this from ⌨️ In Progress to 🎉 Done in FS Oct 28, 2025
},
getProviderWithProduct: async (id: number, productType: number) => {
if (id === 1 && productType == 0) {
getPDPService: async (id: number) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is wrong. There is no getPDPService method! Why did you revert my fix that changed it to getProviderWithProduct?

productType: 0n,
capabilityKeys: [],
isActive: false,
getPDPService: async () => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong. There is no getPDPService method! Why did you revert my fix that switched to the new method getProviderWithProduct?

minProvingPeriodInEpochs: 2880n,
location: 'US-EAST',
paymentTokenAddress: '0x0000000000000000000000000000000000000000',
paymentTokenAddress: '0x0000000000000000000000000000000000000000' as `0x${string}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

use Hex!

import { assert } from 'chai'
import { ethers } from 'ethers'
import type { Hex } from 'viem'
import { boolToBytes, bytesToHex, numberToBytes, stringToHex } from 'viem'
Copy link
Contributor

Choose a reason for hiding this comment

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

bro!

location: 'EU-WEST',
paymentTokenAddress: '0x0000000000000000000000000000000000000000',
} as const
paymentTokenAddress: '0x0000000000000000000000000000000000000000' as `0x${string}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

use Hex!

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this type assertion is required (as it is for ethers.ZeroAddress), because it's a literal.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok I tried and it seems it is necessary

Copy link
Contributor

Choose a reason for hiding this comment

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

another fix is to use as const for the object

acc[key] = providerWithProduct.productCapabilityValues[i]
return acc
},
{} as Record<string, `0x${string}`>
Copy link
Contributor

Choose a reason for hiding this comment

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

use Hex!

// Prepare product data and capabilities
let productType = 0 // ProductType.PDP

const [ capabilityKeys, capabilityValues ] = this._convertPDPOfferingToCapabilities(info.pdpOffering, info.capabilities)
Copy link
Contributor

Choose a reason for hiding this comment

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

bro!

}

return capabilities
}
Copy link
Contributor

Choose a reason for hiding this comment

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

bro!

location: hexToString(capabilities.location),
paymentTokenAddress: capabilities.paymentTokenAddress,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

bro!

*/
private async encodePDPOffering(offering: PDPOffering): Promise<string> {
const contract = this._getRegistryContract()
return await contract.encodePDPOffering(offering)
Copy link
Contributor

Choose a reason for hiding this comment

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

this method doesn't exist! why did you bring it back!

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.

5 participants