-
Notifications
You must be signed in to change notification settings - Fork 80
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
[WIP] Remove unused and deprecated code #1431
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -599,12 +599,6 @@ impl PartitionStateSummary { | |
struct ExpirationQueueStateSummary { | ||
pub on_time_sectors: BitField, | ||
pub early_sectors: BitField, | ||
#[allow(dead_code)] | ||
pub active_power: PowerPair, | ||
#[allow(dead_code)] | ||
pub faulty_power: PowerPair, | ||
#[allow(dead_code)] | ||
pub on_time_pledge: TokenAmount, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These being dead signals to me that we are missing state invariant checks upstream of this that should use the values. I don't think removing them now is helpful – we should strengthen the invariant checks to use them instead. |
||
pub expiration_epochs: Vec<ChainEpoch>, | ||
} | ||
|
||
|
@@ -697,14 +691,7 @@ impl ExpirationQueueStateSummary { | |
let union_on_time = BitField::union(&all_on_time); | ||
let union_early = BitField::union(&all_early); | ||
|
||
Self { | ||
on_time_sectors: union_on_time, | ||
early_sectors: union_early, | ||
active_power: all_active_power, | ||
faulty_power: all_faulty_power, | ||
on_time_pledge: all_on_time_pledge, | ||
expiration_epochs, | ||
} | ||
Self { on_time_sectors: union_on_time, early_sectors: union_early, expiration_epochs } | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,12 +293,6 @@ pub struct PreCommitSectorParams { | |
pub seal_rand_epoch: ChainEpoch, | ||
pub deal_ids: Vec<DealID>, | ||
pub expiration: ChainEpoch, | ||
/// Deprecated: | ||
/// Whether to replace a "committed capacity" no-deal sector (requires non-empty DealIDs) | ||
pub replace_capacity: bool, | ||
/// Deprecated: | ||
/// The committed capacity sector to replace, and its deadline/partition location | ||
pub replace_sector_deadline: u64, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't change Params structs. This is a publicly exported API invoked from off-chain. This will break existing callers. We can one day deprecate the entire method, forcing every remaining caller to migrate to PreCommitSectorBatch2, but until then it needs to remain as-is. Deprecated doesn't mean we can delete it – it means we can't delete it but people should stop using it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anorth For my ow understanding, what kind of offchain callers use this public API ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this one, storage providers. I haven't looked at stats recently to see how many have migrated to v2, but probably most have not yet. |
||
pub replace_sector_partition: u64, | ||
pub replace_sector_number: SectorNumber, | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![warn(dead_code)] | ||
|
||
use clap::Parser; | ||
use std::io::Write; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should remove these (in any actor). They are useful documentation of method numbers that have been used, and relevant to interpreting old blockchain history. These lines aren't costing us anything to retain.