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

fix: remove Option around SectorPreCommitInfoInner.unsealed_cid #1570

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions actors/miner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ impl Actor {
deal_ids: spci.deal_ids,
expiration: spci.expiration,

unsealed_cid: Some(spci.unsealed_cid),
unsealed_cid: spci.unsealed_cid,
})
.collect(),
)
Expand Down Expand Up @@ -1544,14 +1544,10 @@ impl Actor {
));
}

match &precommit.unsealed_cid {
Some(CompactCommD(Some(commd))) if !is_unsealed_sector(commd) => {
if let Some(commd) = &precommit.unsealed_cid.0 {
if !is_unsealed_sector(commd) {
return Err(actor_error!(illegal_argument, "unsealed CID had wrong prefix"));
}
None => return Err(actor_error!(
illegal_argument,
"unspecified CompactCommD not allowed past nv21, need explicit None value for CC or CommD")),
_ => {}
}

// Require sector lifetime meets minimum by assuming activation happens at last epoch permitted for seal proof.
Expand Down Expand Up @@ -1657,7 +1653,7 @@ impl Actor {

// Presence of unsealed CID is checked in the preconditions.
// It must always be specified from nv22 onwards.
Comment on lines 1654 to 1655
Copy link
Member

Choose a reason for hiding this comment

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

This comment is redundant now.

let declared_commd = precommit.unsealed_cid.unwrap();
let declared_commd = precommit.unsealed_cid;
// This is not a CompactCommD, None means that nothing was computed and nothing needs to be checked
if let Some(computed_cid) = verify_return.unsealed_cids[i] {
// It is possible the computed commd is the zero commd so expand declared_commd
Expand Down Expand Up @@ -3594,7 +3590,7 @@ struct SectorPreCommitInfoInner {
pub deal_ids: Vec<DealID>,
pub expiration: ChainEpoch,
/// CommD
pub unsealed_cid: Option<CompactCommD>,
pub unsealed_cid: CompactCommD,
}

/// ReplicaUpdate param with Option<Cid> for CommD
Expand Down
Loading