From f1300dd8f896a4d786ad327531acf93ffde732fd Mon Sep 17 00:00:00 2001 From: Alex North <445306+anorth@users.noreply.github.com> Date: Tue, 8 Aug 2023 10:35:39 +1200 Subject: [PATCH] Remove unused ComputeDataCommitment from built-in market --- actors/market/src/lib.rs | 21 +-------------------- actors/miner/src/ext.rs | 1 - 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/actors/market/src/lib.rs b/actors/market/src/lib.rs index d93902a9d3..74d60cf5ce 100644 --- a/actors/market/src/lib.rs +++ b/actors/market/src/lib.rs @@ -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"), @@ -736,24 +736,6 @@ impl Actor { Ok(()) } - fn compute_data_commitment( - rt: &impl Runtime, - params: ComputeDataCommitmentParams, - ) -> Result { - 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))?; @@ -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, diff --git a/actors/miner/src/ext.rs b/actors/miner/src/ext.rs index 04d6f58152..42926d5bac 100644 --- a/actors/miner/src/ext.rs +++ b/actors/miner/src/ext.rs @@ -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 {