Skip to content

Comments

pdpv0: document filecoin pay settlement #979

Draft
ZenGround0 wants to merge 1 commit intopdpv0from
docs/settlements
Draft

pdpv0: document filecoin pay settlement #979
ZenGround0 wants to merge 1 commit intopdpv0from
docs/settlements

Conversation

@ZenGround0
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added the team/fs-wg Items being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10 label Feb 12, 2026
@ZenGround0 ZenGround0 changed the base branch from main to pdpv0 February 12, 2026 22:08

## Settle Task

The settle task is scheduled twice a day through the IAmBored entrypoint. Upon waking up the settle task queries the `eth_keys` table for the first keys it finds with role == `pdp`. The task then queries the provider registry to learn the PDP service address which it this key is providing for. In all cases today this should be the FWSS contract address on whichever filecoin network (main/calib) this curio node is running on. `Settle` task then delegates to the `filecoinpayment` library method `SettleLockupPeriod` to attempt to settle all rails in need of settlement that are paying out to the provider's key and using the appropriate FWSS contract as the rail's operator contract.
Copy link
Member

Choose a reason for hiding this comment

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

to learn the PDP service address

to learn the payee address, no?


The settle task is scheduled twice a day through the IAmBored entrypoint. Upon waking up the settle task queries the `eth_keys` table for the first keys it finds with role == `pdp`. The task then queries the provider registry to learn the PDP service address which it this key is providing for. In all cases today this should be the FWSS contract address on whichever filecoin network (main/calib) this curio node is running on. `Settle` task then delegates to the `filecoinpayment` library method `SettleLockupPeriod` to attempt to settle all rails in need of settlement that are paying out to the provider's key and using the appropriate FWSS contract as the rail's operator contract.

`SettleLockupPeriod` uses eth call methods on the filecoin-pay contract to lookup all rails operator and payee. The method's intention is to settle rails that have any possibility of client default between this run of the task and the next expected run in 12 hours. To determine this condition each rail's `settledUpTo` and `lockupPeriod` value is inspected. When a rail has not been settled for over one `lockupPeriod` the client can be in default. `SettleLockuPerod` settles all rails that are within one day of meeting this condition. Additionally all termianted rails in the process of finishing out their last `lockupPeriod` of life are marked for settlement.
Copy link
Member

Choose a reason for hiding this comment

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

lookup all rails operator and payee

all rails by payee (and token, we could mention USDFC in here, or hand-wave ERC20), and later filtered by operator IIRC

Copy link
Member

Choose a reason for hiding this comment

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

also I think the framing of this sentence is wrong, it's inverted,

settle rails that have any possibility of client default between this run .. and the next

the task exists to collect payment, not to deal with default, lockup exists to deal with default, but the main focus is to get paid right?

also should we mention the FWSS fixed 30 day lockup and this is FWSS-specific? or are we happy being FWSS-specific in here? Link to FilecoinPay docs would be good to add more colour to this whole section cause lockup and settlements are weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/fs-wg Items being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants