opentensor / subtensor

Bittensor Blockchain Layer
The Unlicense
123 stars 122 forks source link

feat: panic prevention lints #516

Closed Supremesource closed 3 weeks ago

Supremesource commented 3 weeks ago

Please add the following clippy lints into Cargo.toml in all pallets utilizing on_initalize :

[lints.clippy]
arithmetic_side_effects = "deny"
indexing_slicing = "deny"
panicking_unwrap = "deny"
out_of_bounds_indexing = "deny"

This will help us improve blockchain safety. Making sure runtime can not panic in on-initilize hook, halting the block production.

distributedstatemachine commented 3 weeks ago

The bulk of this is covered here: https://github.com/opentensor/subtensor/pull/485

cc @keithtensor