Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move some constants & types out of fvm_shared #1517

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Feb 8, 2024

Specifically:

  • MAX_SECTOR_NUMBER
  • Spacetime
  • SectorQuality
  • TOTAL_FILECOIN
  • EPOCH_DURATION_SECONDS
  • BLOCKS_PER_EPOCH

@Stebalien Stebalien changed the title Move SectorQuality, Spacetime, and MAX_SECTOR_NUMBER Move some constants & types out of fvm_shared Feb 8, 2024
@Stebalien Stebalien requested a review from anorth February 8, 2024 20:47
@Stebalien
Copy link
Member Author

More to come, but this covers some of the easy stuff.

Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

LGTM whether or not you delete SectorQuality.

use num_traits::Zero;

pub mod detail {
/// Maximum length of a deal label.
pub const DEAL_MAX_LABEL_SIZE: usize = 256;
}

lazy_static! {
/// Total Filecoin available to the network.
Copy link
Member

Choose a reason for hiding this comment

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

Commentary: The assumed total filecoin. We should really make this a syscall.

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH, this constant should just go away. It's used to specify collateral bounds, which is kind of unnecessary IMO (although I guess the idea is to limit the size of state?).

use fvm_shared::clock::EPOCH_DURATION_SECONDS;
pub use fvm_shared::BLOCKS_PER_EPOCH as EXPECTED_LEADERS_PER_EPOCH;

pub const EPOCH_DURATION_SECONDS: i64 = 30;
Copy link
Member

Choose a reason for hiding this comment

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

Commentary: again assumed duration, but isn't something that gets defined by the actors.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but changing this would require a massive migration so I think it's OK if the actors assume a specific duration. But I'll comment on that.

actors/miner/src/policy.rs Outdated Show resolved Hide resolved
@Stebalien
Copy link
Member Author

I've removed the type aliases and added a bunch of comments.

@Stebalien Stebalien added this pull request to the merge queue Feb 8, 2024
Merged via the queue into master with commit 2a0946b Feb 8, 2024
14 checks passed
@Stebalien Stebalien deleted the steb/reduce-shared branch February 8, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

2 participants