Skip to content

Commit e00667d

Browse files
committed
use feature verify-signature instead of no-verify-signature
1 parent 82418e1 commit e00667d

File tree

12 files changed

+21
-21
lines changed

12 files changed

+21
-21
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
os: [ubuntu-latest, macos-latest]
31-
name: [build, check-m2-native, check-clippy, test-fvm, test, integration, conformance, calibration]
31+
name: [build, check-m2-native, check-clippy, check-clippy-verify-signature, test-fvm, test, integration, conformance, calibration]
3232
include:
3333
- name: build
3434
key: v3
@@ -47,11 +47,11 @@ jobs:
4747
command: clippy
4848
# we disable default features because rust will otherwise unify them and turn on opencl in CI.
4949
args: --all --all-targets --no-default-features
50-
- name: check-clippy(no-verify-signature)
50+
- name: check-clippy-verify-signature
5151
key: v3
5252
command: clippy
5353
# we disable default features because rust will otherwise unify them and turn on opencl in CI.
54-
args: --all --all-targets --no-default-features --features no-verify-signature
54+
args: --all --all-targets --no-default-features --features verify-signature
5555
- name: test-fvm
5656
key: v3-cov
5757
push: true

fvm/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fvm = { path = ".", features = ["testing"], default-features = false }
4848
coverage-helper = { workspace = true }
4949

5050
[features]
51-
default = ["opencl"]
51+
default = ["opencl", "verify-signature"]
5252
opencl = ["filecoin-proofs-api/opencl"]
5353
cuda = ["filecoin-proofs-api/cuda"]
5454
cuda-supraseal = ["filecoin-proofs-api/cuda-supraseal"]
@@ -58,7 +58,7 @@ m2-native = []
5858
upgrade-actor = []
5959
gas_calibration = []
6060
nv23-dev = []
61-
# Use this feature to remove `verify_signature` syscall that is supposed to be removed by FIP-0079,
61+
# Use this feature to keep `verify_signature` syscall that is supposed to be removed by FIP-0079,
6262
# The current implementation keeps it by default for backward compatibility reason.
6363
# See <https://github.com/filecoin-project/ref-fvm/issues/2001>
64-
no-verify-signature = []
64+
verify-signature = []

fvm/src/kernel/default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ impl<C> CryptoOps for DefaultKernel<C>
573573
where
574574
C: CallManager,
575575
{
576-
#[cfg(not(feature = "no-verify-signature"))]
576+
#[cfg(feature = "verify-signature")]
577577
fn verify_signature(
578578
&self,
579579
sig_type: SignatureType,

fvm/src/kernel/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub trait ActorOps {
220220
fn balance_of(&self, actor_id: ActorID) -> Result<TokenAmount>;
221221
}
222222

223-
#[cfg(not(feature = "no-verify-signature"))]
223+
#[cfg(feature = "verify-signature")]
224224
/// Cryptographic primitives provided by the kernel.
225225
#[delegatable_trait]
226226
pub trait CryptoOps {
@@ -263,7 +263,7 @@ pub trait CryptoOps {
263263
fn hash(&self, code: u64, data: &[u8]) -> Result<Multihash>;
264264
}
265265

266-
#[cfg(feature = "no-verify-signature")]
266+
#[cfg(not(feature = "verify-signature"))]
267267
/// Cryptographic primitives provided by the kernel.
268268
#[delegatable_trait]
269269
pub trait CryptoOps {

fvm/src/syscalls/crypto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
syscall_error,
1313
};
1414

15-
#[cfg(not(feature = "no-verify-signature"))]
15+
#[cfg(feature = "verify-signature")]
1616
/// Verifies that a signature is valid for an address and plaintext.
1717
///
1818
/// The return i32 indicates the status code of the verification:

fvm/src/syscalls/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ where
315315
if cfg!(feature = "m2-native") {
316316
linker.link_syscall("actor", "install_actor", actor::install_actor)?;
317317
}
318-
#[cfg(not(feature = "no-verify-signature"))]
318+
#[cfg(feature = "verify-signature")]
319319
linker.link_syscall("crypto", "verify_signature", crypto::verify_signature)?;
320320
linker.link_syscall(
321321
"crypto",

sdk/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ fvm_shared = { workspace = true }
2121
fvm_ipld_encoding = { workspace = true }
2222

2323
[features]
24-
default = []
24+
default = ["verify-signature"]
2525
m2-native = []
2626
upgrade-actor = []
27-
# Use this feature to remove `verify_signature` syscall that is supposed to be removed by FIP-0079,
27+
# Use this feature to keep `verify_signature` syscall that is supposed to be removed by FIP-0079,
2828
# The current implementation keeps it by default for backward compatibility reason.
2929
# See <https://github.com/filecoin-project/ref-fvm/issues/2001>
30-
no-verify-signature = []
30+
verify-signature = []

sdk/src/crypto.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use num_traits::FromPrimitive;
2121

2222
use crate::{status_code_to_bool, sys, SyscallResult};
2323

24-
#[cfg(not(feature = "no-verify-signature"))]
24+
#[cfg(feature = "verify-signature")]
2525
/// Verifies that a signature is valid for an address and plaintext.
2626
///
2727
/// NOTE: This only supports f1 and f3 addresses.
@@ -47,7 +47,7 @@ pub fn verify_signature(
4747
}
4848
}
4949

50-
#[cfg(feature = "no-verify-signature")]
50+
#[cfg(not(feature = "verify-signature"))]
5151
/// Verifies that a signature is valid for an address and plaintext.
5252
///
5353
/// NOTE: This only supports f1 and f3 addresses.

sdk/src/sys/crypto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ super::fvm_syscalls! {
2828
/// | Error | Reason |
2929
/// |---------------------|------------------------------------------------------|
3030
/// | [`IllegalArgument`] | signature, address, or plaintext buffers are invalid |
31-
#[cfg(not(feature = "no-verify-signature"))]
31+
#[cfg(feature = "verify-signature")]
3232
pub fn verify_signature(
3333
sig_type: u32,
3434
sig_off: *const u8,

testing/test_actors/actors/fil-syscall-actor/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ crate-type = ["cdylib"] ## cdylib is necessary for Wasm build
1717

1818
[features]
1919
coverage = ["minicov"]
20-
no-verify-signature = ["fvm_sdk/no-verify-signature"]
20+
verify-signature = ["fvm_sdk/verify-signature"]

testing/test_actors/actors/fil-syscall-actor/src/actor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn test_secp_signature() {
9898
// test that calling sdk::sys::crypto::verify_signature with invalid parameters result
9999
// in correct error value
100100
//
101-
#[cfg(not(feature = "no-verify-signature"))]
101+
#[cfg(feature = "verify-signature")]
102102
unsafe {
103103
let sig_type = signature.signature_type();
104104
let sig_bytes = signature.bytes();

testing/test_actors/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ fn main() -> Result<(), Box<dyn Error>> {
9999
.expect("failed to write to manifest");
100100
}
101101

102-
// Generate syscall actor with no-verify-signature feature.
102+
// Generate syscall actor with verify-signature feature.
103103
{
104104
let (var, pkg) = ("SYSCALL_ACTOR_BINARY_FIP0079", "fil_syscall_actor");
105105
let mut cmd = Command::new(cargo);
106106
cmd.arg("build")
107107
.arg(format!("-p={pkg}"))
108-
// .arg(format!("--features=no-verify-signature"))
108+
.arg("--features=verify-signature")
109109
.arg(format!("--target={WASM_TARGET}"))
110110
.arg("--profile=wasm")
111111
.arg("--locked")

0 commit comments

Comments
 (0)