Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions sdk/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,35 @@ serde_repr = "0.1.7"
sha3 = "0.10.4"
base64 = "0.13"
itoa = "1.0.1"

[workspace.lints.clippy]
# === Code Quality: Prevent incomplete/placeholder code ===
todo = "deny"

# === True Bugs: Compiler can prove these are wrong ===
eq_op = "warn" # x == x, x != x, etc.
modulo_one = "warn" # x % 1 (always returns 0)
out_of_bounds_indexing = "warn" # Compiler-checked out of bounds access

# === Security Audit Support ===
undocumented_unsafe_blocks = "warn" # Document why unsafe is needed

# === Potential Runtime Errors ===
unchecked_duration_subtraction = "warn" # Can panic on underflow
panicking_overflow_checks = "warn" # Overflow checks that panic in release
if_let_mutex = "warn" # Can cause deadlocks

# === Performance: Catch accidental inefficiencies ===
or_fun_call = "warn" # Use .unwrap_or_else instead of .unwrap_or
set_contains_or_insert = "warn" # Use .entry() API instead
stable_sort_primitive = "warn" # Unstable sort is faster for primitives

# === Logic Bugs ===
suspicious_operation_groupings = "warn" # Likely copy-paste errors

# === Data Structure Misuse ===
iter_over_hash_type = "warn" # Non-deterministic iteration order
non_send_fields_in_send_ty = "warn" # Breaks thread safety

# === SDK-specific: Help developers avoid common mistakes ===
wildcard_dependencies = "warn" # Prevent supply chain issues in published crates
3 changes: 3 additions & 0 deletions sdk/rust/serde_wormhole/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
base64.workspace = true
itoa.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions sdk/rust/supported-chains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
serde.workspace = true
thiserror.workspace = true
3 changes: 3 additions & 0 deletions sdk/rust/vaas-serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[lints]
workspace = true

[lib]
name = "wormhole_sdk"

Expand Down
4 changes: 4 additions & 0 deletions sdk/rust/vaas-serde/src/vaa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ impl<P> From<(Header, Body<P>)> for Vaa<P> {
}

impl Header {
#[allow(
clippy::todo,
reason = "VAA body verification not yet implemented - this function is not currently used in the SDK"
)]
pub fn verify(&self, _body: &[u8], _addrs: &[GuardianAddress]) -> anyhow::Result<Digest> {
todo!("VAA body verification")
}
Expand Down
34 changes: 34 additions & 0 deletions svm/wormhole-core-shims/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,37 @@ codegen-units = 1
opt-level = 3
incremental = false
codegen-units = 1

[workspace.lints.clippy]
# === Code Quality: Prevent incomplete/placeholder code ===
todo = "deny"
unimplemented = "deny" # Uncomment if you want to be strict about this too

# === True Bugs: Compiler can prove these are wrong ===
eq_op = "warn" # x == x, x != x, etc.
modulo_one = "warn" # x % 1 (always returns 0)
out_of_bounds_indexing = "warn" # Compiler-checked out of bounds access

# === Stack Management: Critical for Solana (32KB stack limit) ===
large_stack_arrays = "warn"
large_stack_frames = "warn"

# === Security Audit Support ===
undocumented_unsafe_blocks = "warn" # Document why unsafe is needed

# === Potential Runtime Errors ===
unchecked_duration_subtraction = "warn" # Can panic on underflow
panicking_overflow_checks = "warn" # Overflow checks that panic in release
if_let_mutex = "warn" # Can cause deadlocks

# === Performance: Catch accidental inefficiencies ===
or_fun_call = "warn" # Use .unwrap_or_else instead of .unwrap_or
set_contains_or_insert = "warn" # Use .entry() API instead
stable_sort_primitive = "warn" # Unstable sort is faster for primitives

# === Logic Bugs ===
suspicious_operation_groupings = "warn" # Likely copy-paste errors

# === Data Structure Misuse ===
iter_over_hash_type = "warn" # Non-deterministic iteration order
non_send_fields_in_send_ty = "warn" # Breaks thread safety
3 changes: 3 additions & 0 deletions svm/wormhole-core-shims/crates/definitions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
Expand Down
3 changes: 3 additions & 0 deletions svm/wormhole-core-shims/crates/shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lints]
workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
Expand Down
Loading