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

Remove unused ComputeDataCommitment from built-in market #1354

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
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
21 changes: 1 addition & 20 deletions actors/market/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub enum Method {
VerifyDealsForActivation = 5,
BatchActivateDeals = 6,
OnMinerSectorsTerminate = 7,
ComputeDataCommitment = 8,
// ComputeDataCommitment = 8, // Deprecated
CronTick = 9,
// Method numbers derived from FRC-0042 standards
AddBalanceExported = frc42_dispatch::method_hash!("AddBalance"),
Expand Down Expand Up @@ -736,24 +736,6 @@ impl Actor {
Ok(())
}

fn compute_data_commitment(
rt: &impl Runtime,
params: ComputeDataCommitmentParams,
) -> Result<ComputeDataCommitmentReturn, ActorError> {
rt.validate_immediate_caller_type(std::iter::once(&Type::Miner))?;

let st: State = rt.state()?;
let proposal_array = st.get_proposal_array(rt.store())?;

let mut commds = Vec::with_capacity(params.inputs.len());
for comm_input in params.inputs.iter() {
let proposed_deals = get_proposals(&proposal_array, &comm_input.deal_ids, st.next_id)?;
commds.push(compute_data_commitment(rt, &proposed_deals, comm_input.sector_type)?);
}

Ok(ComputeDataCommitmentReturn { commds })
}

fn cron_tick(rt: &impl Runtime) -> Result<(), ActorError> {
rt.validate_immediate_caller_is(std::iter::once(&CRON_ACTOR_ADDR))?;

Expand Down Expand Up @@ -1457,7 +1439,6 @@ impl ActorCode for Actor {
VerifyDealsForActivation => verify_deals_for_activation,
BatchActivateDeals => batch_activate_deals,
OnMinerSectorsTerminate => on_miner_sectors_terminate,
ComputeDataCommitment => compute_data_commitment,
CronTick => cron_tick,
GetBalanceExported => get_balance,
GetDealDataCommitmentExported => get_deal_data_commitment,
Expand Down
10 changes: 0 additions & 10 deletions actors/market/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ pub struct DealSpaces {
pub verified_deal_space: BigInt,
}

#[derive(Serialize_tuple, Deserialize_tuple, Debug, Clone, Eq, PartialEq)]
pub struct ComputeDataCommitmentParams {
pub inputs: Vec<SectorDataSpec>,
}

#[derive(Serialize_tuple, Deserialize_tuple, Debug, Clone, Eq, PartialEq)]
pub struct ComputeDataCommitmentReturn {
pub commds: Vec<Cid>,
}

/// A specialization of a array to deals.
pub type DealArray<'bs, BS> = Array<'bs, DealProposal, BS>;

Expand Down
Loading