More API between user-programmed actors and built-in miner actor for building decentralized staking protocol #1034
Replies: 8 comments 7 replies
-
First attempt on fip draft #1035 |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting @jennijuju ! Allowing programmatic terminations will be quite useful for defi protocols. I do want to express my strong opinion that the usefulness of this FIP is dependent on finding a solution to the "open question" listed at the bottom of this discussion. I created a new discussion to focus on that here. There are several reasons for this:
With this in mind, I'm still a very strong advocate in favor of exposing these methods through the FEVM precompile, as they will be critical in building fully decentralized lending/leasing/staking protocols on fevm. My main point is just in terms of prioritization - computing collateral values on chain (imo) is a precursor to making on-chain sector terminations useful |
Beta Was this translation helpful? Give feedback.
-
TerminateSectorsThe draft FIP proposes exposing the current TerminateSectors method.
I'm fine with exposing some sector termination, but the existing method is not good. Not only should we not expose it, but we should deprecate it. Rather than just terminating the sectors, the existing method does a complicated deferral and partial processing of the requested work. It also schedules a cron job to do more of the work, thereby punting the execution cost of large jobs onto the network as a whole. I think this was motivated by not having a proper gas model before the development of the FVM, and the potentially expensive work of terminating an unknown number of deals etc. But none of that is relevant to explicit termination by an SP operator/owner. The caller should specify a set of sectors that can be terminated well within the block gas limit, and the method should just do the work. For the proposed use case of automated invocation from smart contracts, the existing method will be very hard to use. A simpler one will be much more appropriate. We should specify a new TerminateSectors2 method that does directly what it is asked to do. (Note: the termination queue might remain for use when automatically terminating sectors due to missed Window PoST, where unbounded work would still be a problem.) |
Beta Was this translation helpful? Give feedback.
-
GetAvailableBalance, GetLockedReward, GetLockedInitialPledgeGetAvailableBalance is already exported. GetLockedReward is already exported (as GetVestingFunds). A miner's locked initial pledge can be calculated as TotalBalance - (AvailableBalance + LockedReward). I'm not opposed to exporting a GetInitialPledge, but it's absence isn't limiting anyone at the moment. |
Beta Was this translation helpful? Give feedback.
-
GetExpectedRewardsExpected rewards for some amount of power is not fundamentally a calculation specific to a miner, but is a general calculation for the network. A miner actor doesn't even know the one key input it would need for this: its power. Instead, this should probably be a pair of new methods exported from the power actor:
And for symmetry with existing methods, add |
Beta Was this translation helpful? Give feedback.
-
@jennijuju want to export 1 more method to get live/faulty sectors of a specific miner, i didnt see this in the list of exported methods |
Beta Was this translation helpful? Give feedback.
-
Exposing more API of the builtin actors to smart contracts and enabling sector termination through smart contract will make DeFi protocols more trustless and decentralized. We are supportive of the FIP but would also want to see something like |
Beta Was this translation helpful? Give feedback.
-
I generally support this proposal to export more methods, as it will provide DAPPs with greater flexibility in managing processes, particularly for DeFi. However, concerning the termination fee, I strongly support proposal #972 to mitigate lending risks. I also proposed #712 to simplify the termination fee calculation, which would further limit lending risk. Additionally, lower risk and capped losses introduce greater certainty into the system, enhancing its power and security. |
Beta Was this translation helpful? Give feedback.
-
@Schwartz10 @jennijuju
Abstract
Upon the FEVM launch, FIP-0050 was also introduced with a list of the builtin actor methods that are exposed as callables from user actors. Since then, we’ve seen a number of protocols build lending or leasing applications around Miner Actors collateral & rewards. As common practice in DeFi, protocols often introduce a “liquidation” procedure that liquidates a borrower’s collateral to derisk the liquidity providers from losing lent out funds. In the process of Filecoin leasing applications, a liquidation means termination of a miner’s active sectors, facing a penalty, but recovering pledged collateral to return to liquidity providers. Economic security of applications being built on the FEVM is important for developing trust and attracting outside capital / liquidity / investors, and understanding precise collateral values for any given miner actor is critical for a DeFi protocol’s economic security.
More exported APIs in miner actor are required to support onchain liquidation procedure for decentralized staking protocol.
Change Motivation
As DeFi protocols on Filecoin gain traction and lock larger amounts of value, they will be targets for more attacks. As an ecosystem, we should create the necessary primitives to build secure economic applications that use miner actors as collateral.
There are a few motivations behind the proposals:
Proposed Change
Add the following exported methods:
more details in the upcoming FIP Draft.
Open question
Is it possible to get a single maximum termination penalty given a list of the miner actors IDs that are provided?
Beta Was this translation helpful? Give feedback.
All reactions