Skip to content

Conversation

@ZenGround0
Copy link
Contributor

This FIP is to add a liveness check method to the builtin miner actor to allow for user space fevm contracts to check on the status of filecoin sectors based on sector number.

Still WIP. Will move out of Draft PR when it is ready for review.

Discussion #1108

@ZenGround0 ZenGround0 marked this pull request as ready for review December 4, 2025 00:12
@ZenGround0 ZenGround0 changed the title Export Sector Liveness Check Export Sector Status Dec 4, 2025
Copy link
Member

@jsoares jsoares left a comment

Choose a reason for hiding this comment

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

Hardly the strongest change motivation section, but seems clear enough.

<!--"If you can't explain it simply, you don't understand it well enough." Provide a simplified and layman-accessible explanation of the FIP.-->
We propose exporting a new method `validate_sector_status` from the builtin miner actor for creating user space FEVM smart contracts that can check the status of filecoin sectors, either live or dead, on chain. An additional exported method `generate_sector_status_info` can be used in an offchain call to generate inputs to `validate_sector_status`.

Combined with the recent changes to ProveCommitSectors3 in FIP 109 allowing smart contract notifications upon sector commitent, this FIP establishes a minimally useful interface for a rich set of programmable storage applications.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Combined with the recent changes to ProveCommitSectors3 in FIP 109 allowing smart contract notifications upon sector commitent, this FIP establishes a minimally useful interface for a rich set of programmable storage applications.
Combined with the recent changes to ProveCommitSectors3 in FIP-0109 allowing smart contract notifications upon sector commitent, this FIP establishes a minimally useful interface for a rich set of programmable storage applications.

<!--A short (~200 word) description of the technical issue being addressed.-->
We propose exporting a new method `validate_sector_status` from the builtin miner actor for creating user space FEVM smart contracts that can check the status of filecoin sectors, either live or dead, on chain. An additional exported method `generate_sector_status_info` can be used in an offchain call to generate inputs to `validate_sector_status`.

Combined with the recent changes to ProveCommitSectors3 in FIP 109 allowing smart contract notifications upon sector commitent, this FIP establishes a minimally useful interface for a rich set of programmable storage applications.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Combined with the recent changes to ProveCommitSectors3 in FIP 109 allowing smart contract notifications upon sector commitent, this FIP establishes a minimally useful interface for a rich set of programmable storage applications.
Combined with the recent changes to ProveCommitSectors3 in FIP-0109 allowing smart contract notifications upon sector commitent, this FIP establishes a minimally useful interface for a rich set of programmable storage applications.


We forwent a similar validating interface pattern with `get_sector_expiration`. This would look like a method that takes in the correct expiration and returns True or False depending on whether the input expiration is correct. This is done for expediency and convenience. The thinking is that this method only ever provides a useful hint anyway as it cannot provide any useful information when handling early terminations.

We considered including the most current guess of a sectors expiration from `get_sector_expiration` this could be accomplished by providing the sector location and traversing the partition's expiration queue. This would effectively expose a signal of a sector's faultiness which runs counter to our design of `validate_sector_status`. If we want to expose this information we should be consistent and create a new `Fault` sector status value from the enum.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
We considered including the most current guess of a sectors expiration from `get_sector_expiration` this could be accomplished by providing the sector location and traversing the partition's expiration queue. This would effectively expose a signal of a sector's faultiness which runs counter to our design of `validate_sector_status`. If we want to expose this information we should be consistent and create a new `Fault` sector status value from the enum.
We considered including the most current guess of a sectors expiration from `get_sector_expiration`, which could be accomplished by providing the sector location and traversing the partition's expiration queue. This would effectively expose a signal of a sector's faultiness which runs counter to our design of `validate_sector_status`. If we want to expose this information we should be consistent and create a new `Fault` sector status value from the enum.

a) sector number recorded in the `sectors` bitfield of some `Partition`
b) sector number NOT recorded in the `terminated` bitfield of the same `Partition`

Furthermore the separation of the search for the partition and deadline index into the offchain call `generate_sector_status_info` ensures that gas costs and miner state size have no impact on a user's ability to make this call. Hence there is no provide practical denial of service to make the call and condition (1) is satisfied both in principle and in practice.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Furthermore the separation of the search for the partition and deadline index into the offchain call `generate_sector_status_info` ensures that gas costs and miner state size have no impact on a user's ability to make this call. Hence there is no provide practical denial of service to make the call and condition (1) is satisfied both in principle and in practice.
Furthermore the separation of the search for the partition and deadline index into the offchain call `generate_sector_status_info` ensures that gas costs and miner state size have no impact on a user's ability to make this call. Hence there is no denial of service vector and condition (1) is satisfied both in principle and in practice.

This sentence is broken in at least two ways -- I'm not sure if this is what was meant, so feel free to ignore the suggestion and rewrite as you wish.


## Implementation
<!--The implementations must be completed before any core FIP is given status "Final", but it need not be completed before the FIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.-->
WIP builtin actors PR here: https://github.com/filecoin-project/builtin-actors/pull/1707/files

Choose a reason for hiding this comment

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

Suggested change
WIP builtin actors PR here: https://github.com/filecoin-project/builtin-actors/pull/1707/files
WIP builtin actors PR here: https://github.com/filecoin-project/builtin-actors/pull/1707

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants