Skip to content

Commit

Permalink
Remove unused ComputeDataCommitment from built-in market
Browse files Browse the repository at this point in the history
  • Loading branch information
anorth committed Aug 7, 2023
1 parent ad4470f commit f1300dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
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
1 change: 0 additions & 1 deletion actors/miner/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub mod market {
pub const VERIFY_DEALS_FOR_ACTIVATION_METHOD: u64 = 5;
pub const BATCH_ACTIVATE_DEALS_METHOD: u64 = 6;
pub const ON_MINER_SECTORS_TERMINATE_METHOD: u64 = 7;
pub const COMPUTE_DATA_COMMITMENT_METHOD: u64 = 8;

#[derive(Serialize_tuple, Deserialize_tuple)]
pub struct SectorDeals {
Expand Down

0 comments on commit f1300dd

Please sign in to comment.