Skip to content

Commit 5cd7f3b

Browse files
expand experimental_spec_shaking_v2 feature doc
1 parent 6121af0 commit 5cd7f3b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

soroban-sdk/src/_features.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,22 @@
2828
//!
2929
//! ## `experimental_spec_shaking_v2`
3030
//!
31-
//! Enables spec shaking, a mechanism for stripping unused type and event
32-
//! definitions from a contract's spec after building.
31+
//! Enables v2 spec shaking, an improved mechanism for controlling which type,
32+
//! event, and function definitions appear in a contract's spec.
33+
//!
34+
//! ### Spec Shaking v1 (default, no feature flag)
35+
//!
36+
//! - Lib imports (via `contractimport!`): exported
37+
//! - Wasm imports (via `contractimport!`): not exported
38+
//! - `pub` types: exported
39+
//! - Non-`pub` types: not exported
40+
//! - All events: exported
41+
//! - All functions: exported
42+
//!
43+
//! ### Spec Shaking v2 (this feature)
44+
//!
45+
//! - Everything exported (types, events, functions, imports)
46+
//! - Unused entries shaken out using dead code / spec elimination
3347
//!
3448
//! A contract's spec (the `contractspecv0` custom section in the Wasm binary)
3549
//! contains entries for every function, type, and event defined by the contract.

0 commit comments

Comments
 (0)