Conversation
|
|
||
| ## 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
No description provided.