diff --git a/actors/miner/src/lib.rs b/actors/miner/src/lib.rs index 00762073f..d9945d637 100644 --- a/actors/miner/src/lib.rs +++ b/actors/miner/src/lib.rs @@ -795,6 +795,7 @@ impl Actor { &proof_inputs, miner_actor_id, precommits[0].info.seal_proof, + RegisteredAggregateProof::SnarkPackV2, ¶ms.aggregate_proof, )?; @@ -1690,6 +1691,9 @@ impl Actor { rt.validate_immediate_caller_is( info.control_addresses.iter().chain(&[info.worker, info.owner]), )?; + if params.aggregate_proof_type != RegisteredAggregateProof::SnarkPackV2 { + return Err(actor_error!(illegal_argument, "aggregate proof type must be SnarkPackV2")); + } // Load pre-commits, failing if any don't exist. let sector_numbers = params.sector_activations.iter().map(|sa| sa.sector_number); @@ -1786,6 +1790,7 @@ impl Actor { &proof_inputs, miner_id, precommits[0].info.seal_proof, + params.aggregate_proof_type, ¶ms.aggregate_proof, )?; @@ -4728,6 +4733,7 @@ fn verify_aggregate_seal( proof_inputs: &[SectorSealProofInput], miner_actor_id: ActorID, seal_proof: RegisteredSealProof, + aggregate_proof: RegisteredAggregateProof, proof_bytes: &RawBytes, ) -> Result<(), ActorError> { let seal_verify_inputs = @@ -4736,7 +4742,7 @@ fn verify_aggregate_seal( rt.verify_aggregate_seals(&AggregateSealVerifyProofAndInfos { miner: miner_actor_id, seal_proof, - aggregate_proof: RegisteredAggregateProof::SnarkPackV2, + aggregate_proof, proof: proof_bytes.clone().into(), infos: seal_verify_inputs, }) diff --git a/actors/miner/src/types.rs b/actors/miner/src/types.rs index b39174df5..f9c5220d6 100644 --- a/actors/miner/src/types.rs +++ b/actors/miner/src/types.rs @@ -145,6 +145,8 @@ pub struct ProveCommitSectors3Params { // Aggregate proof for all sectors. // Exactly one of sector_proofs or aggregate_proof must be non-empty. pub aggregate_proof: RawBytes, + // The proof type for the aggregate proof (ignored if no aggregate proof). + pub aggregate_proof_type: RegisteredAggregateProof, // Whether to abort if any sector activation fails. pub require_activation_success: bool, // Whether to abort if any notification returns a non-zero exit code. diff --git a/actors/miner/tests/util.rs b/actors/miner/tests/util.rs index ed0e65bb1..3310526c2 100644 --- a/actors/miner/tests/util.rs +++ b/actors/miner/tests/util.rs @@ -1110,6 +1110,7 @@ impl ActorHarness { } else { vec![] }, + aggregate_proof_type: RegisteredAggregateProof::SnarkPackV2, require_activation_success, require_notification_success, }; diff --git a/integration_tests/src/tests/prove_commit2_test.rs b/integration_tests/src/tests/prove_commit2_test.rs index ca48b428f..f84c5abc8 100644 --- a/integration_tests/src/tests/prove_commit2_test.rs +++ b/integration_tests/src/tests/prove_commit2_test.rs @@ -6,7 +6,9 @@ use fvm_shared::clock::ChainEpoch; use fvm_shared::deal::DealID; use fvm_shared::econ::TokenAmount; use fvm_shared::piece::{PaddedPieceSize, PieceInfo}; -use fvm_shared::sector::{RegisteredSealProof, SectorNumber, StoragePower}; +use fvm_shared::sector::{ + RegisteredAggregateProof, RegisteredSealProof, SectorNumber, StoragePower, +}; use integer_encoding::VarInt; use num_traits::Zero; @@ -225,6 +227,7 @@ pub fn prove_commit_sectors2_test(v: &dyn VM) { sector_activations: manifests.clone(), sector_proofs: proofs, aggregate_proof: RawBytes::default(), + aggregate_proof_type: RegisteredAggregateProof::SnarkPackV2, require_activation_success: true, require_notification_success: true, }; diff --git a/integration_tests/src/tests/replica_update2_test.rs b/integration_tests/src/tests/replica_update2_test.rs index a07045768..0d1cdda17 100644 --- a/integration_tests/src/tests/replica_update2_test.rs +++ b/integration_tests/src/tests/replica_update2_test.rs @@ -96,6 +96,7 @@ pub fn prove_replica_update2_test(v: &dyn VM) { sector_activations: activations, sector_proofs: proofs, aggregate_proof: RawBytes::default(), + aggregate_proof_type: RegisteredAggregateProof::SnarkPackV2, require_activation_success: true, require_notification_success: true, }; @@ -256,7 +257,7 @@ pub fn prove_replica_update2_test(v: &dyn VM) { sector_proofs: proofs, aggregate_proof: RawBytes::default(), update_proofs_type: update_proof, - aggregate_proof_type: RegisteredAggregateProof::SnarkPackV1, + aggregate_proof_type: RegisteredAggregateProof::SnarkPackV2, require_activation_success: true, require_notification_success: true, };