Skip to content

Commit dd01512

Browse files
authored
feat: remove the verify-seal syscall (#1853)
This is unused in the builtin actors.
1 parent bcfc903 commit dd01512

File tree

7 files changed

+0
-63
lines changed

7 files changed

+0
-63
lines changed

fvm/src/kernel/default.rs

-11
Original file line numberDiff line numberDiff line change
@@ -520,17 +520,6 @@ where
520520
}))
521521
}
522522

523-
/// Verify seal proof for sectors. This proof verifies that a sector was sealed by the miner.
524-
fn verify_seal(&self, vi: &SealVerifyInfo) -> Result<bool> {
525-
let t = self
526-
.call_manager
527-
.charge_gas(self.call_manager.price_list().on_verify_seal(vi))?;
528-
529-
// It's probably _fine_ to just let these turn into fatal errors, but seal verification is
530-
// pretty self contained, so catching panics here probably doesn't hurt.
531-
t.record(catch_and_log_panic("verifying seal", || verify_seal(vi)))
532-
}
533-
534523
fn verify_post(&self, verify_info: &WindowPoStVerifyInfo) -> Result<bool> {
535524
let t = self
536525
.call_manager

fvm/src/kernel/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ pub trait CryptoOps {
285285
pieces: &[PieceInfo],
286286
) -> Result<Cid>;
287287

288-
/// Verifies a sector seal proof.
289-
fn verify_seal(&self, vi: &SealVerifyInfo) -> Result<bool>;
290-
291288
/// Verifies a window proof of spacetime.
292289
fn verify_post(&self, verify_info: &WindowPoStVerifyInfo) -> Result<bool>;
293290

fvm/src/syscalls/crypto.rs

-19
Original file line numberDiff line numberDiff line change
@@ -124,25 +124,6 @@ pub fn compute_unsealed_sector_cid(
124124
context.memory.write_cid(&cid, cid_off, cid_len)
125125
}
126126

127-
/// Verifies a sector seal proof.
128-
///
129-
/// The return i32 indicates the status code of the verification:
130-
/// - 0: verification ok.
131-
/// - -1: verification failed.
132-
pub fn verify_seal(
133-
context: Context<'_, impl Kernel>,
134-
info_off: u32, // SealVerifyInfo
135-
info_len: u32,
136-
) -> Result<i32> {
137-
let info = context
138-
.memory
139-
.read_cbor::<SealVerifyInfo>(info_off, info_len)?;
140-
context
141-
.kernel
142-
.verify_seal(&info)
143-
.map(|v| if v { 0 } else { -1 })
144-
}
145-
146127
/// Verifies a window proof of spacetime.
147128
///
148129
/// The return i32 indicates the status code of the verification:

fvm/src/syscalls/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ pub fn bind_syscalls(
292292
crypto::recover_secp_public_key,
293293
)?;
294294
linker.bind("crypto", "hash", crypto::hash)?;
295-
linker.bind("crypto", "verify_seal", crypto::verify_seal)?;
296295
linker.bind("crypto", "verify_post", crypto::verify_post)?;
297296
linker.bind(
298297
"crypto",

sdk/src/crypto.rs

-6
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ pub fn compute_unsealed_sector_cid(
132132
}
133133
}
134134

135-
/// Verifies a sector seal proof.
136-
pub fn verify_seal(info: &SealVerifyInfo) -> SyscallResult<bool> {
137-
let info = to_vec(info).expect("failed to marshal seal verification input");
138-
unsafe { sys::crypto::verify_seal(info.as_ptr(), info.len() as u32).map(status_code_to_bool) }
139-
}
140-
141135
/// Verifies a window proof of spacetime.
142136
pub fn verify_post(info: &WindowPoStVerifyInfo) -> SyscallResult<bool> {
143137
let info = to_vec(info).expect("failed to marshal PoSt verification input");

sdk/src/sys/crypto.rs

-16
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,6 @@ super::fvm_syscalls! {
111111
cid_len: u32,
112112
) -> Result<u32>;
113113

114-
/// Verifies a sector seal proof.
115-
///
116-
/// Returns 0 to indicate that the proof was valid, -1 otherwise.
117-
///
118-
/// # Arguments
119-
///
120-
/// `info_off` and `info_len` specify the location and length of a cbor-encoded
121-
/// [`SealVerifyInfo`][fvm_shared::sector::SealVerifyInfo] in tuple representation.
122-
///
123-
/// # Errors
124-
///
125-
/// | Error | Reason |
126-
/// |---------------------|--------------------------|
127-
/// | [`IllegalArgument`] | an argument is malformed |
128-
pub fn verify_seal(info_off: *const u8, info_len: u32) -> Result<i32>;
129-
130114
/// Verifies a window proof of spacetime.
131115
///
132116
/// Returns 0 to indicate that the proof was valid, -1 otherwise.

testing/conformance/src/vm.rs

-7
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,6 @@ where
385385
Ok(vec![true; vis.len()])
386386
}
387387

388-
// NOT forwarded
389-
fn verify_seal(&self, vi: &SealVerifyInfo) -> Result<bool> {
390-
let charge = self.1.price_list.on_verify_seal(vi);
391-
let _ = self.0.charge_gas(&charge.name, charge.total())?;
392-
Ok(true)
393-
}
394-
395388
// NOT forwarded
396389
fn verify_post(&self, vi: &WindowPoStVerifyInfo) -> Result<bool> {
397390
let charge = self.1.price_list.on_verify_post(vi);

0 commit comments

Comments
 (0)