Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
734ece6
feat(macros): feature gate `smplx-test`
gerau Oct 27, 2026
a44b4f6
feat(simplex): feature gate `smplx-test`
gerau Oct 27, 2026
9b88867
Merge pull request #190 from gerau/feat/feature-gate-smplx-test
Arvolear Nov 2, 2026
357f23e
docs(sdk): fix wrong rustdoc for finalize_strict and UTXO unblinded g…
schoen Oct 27, 2026
d1540fb
docs(test): document the scenario-based fuzz engine in rustdoc
schoen Oct 27, 2026
281770b
docs(sdk): document providers and networks in rustdoc
schoen Oct 27, 2026
ec926ee
docs(sdk): document the signer's behavior in rustdoc
schoen Oct 27, 2026
a83bc73
docs(sdk): document the transaction module's behavior in rustdoc
schoen Oct 27, 2026
5f9a0ed
docs(sdk): document programs, verbosity and utilities in rustdoc
schoen Oct 27, 2026
00f3ab9
Merge pull request #192 from schoen/docs/rustdoc-fixes
Arvolear Nov 5, 2026
f64ab87
Merge pull request #193 from schoen/docs/rustdoc-fuzz
Arvolear Nov 5, 2026
9ed4641
Merge pull request #194 from schoen/docs/rustdoc-program
Arvolear Nov 5, 2026
917ea9d
Merge pull request #195 from schoen/docs/rustdoc-provider
Arvolear Nov 5, 2026
1ba3784
Merge pull request #196 from schoen/docs/rustdoc-signer
Arvolear Nov 5, 2026
bf0954d
Merge pull request #197 from schoen/docs/rustdoc-transaction
Arvolear Nov 5, 2026
e47df47
fix comments and test names
Arvolear Nov 5, 2026
6915eda
Merge pull request #206 from BlockstreamResearch/fix/comments
Arvolear Nov 5, 2026
0b05f75
Remove dependency on `jq` for `simplexup`
schoen Nov 6, 2026
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
2 changes: 1 addition & 1 deletion .github/scripts/setup-simplex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ main() {
SIMPLEX_BIN_DIR="$SIMPLEX_DIR/bin"
BIN_PATH="$SIMPLEX_BIN_DIR/simplexup"

# Ensure bin directory exists and download simplexup into it
# Create the bin directory and download simplexup there
mkdir -p "$SIMPLEX_BIN_DIR"
say "Fetching ${FILE_PATH} from ${RAW_URL}"

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
edition = "2024"

[workspace.dependencies]
smplx-macros = { path = "./crates/macros", version = "=0.2.0" }
smplx-macros = { path = "./crates/macros", version = "=0.2.0", default-features = false }
smplx-build = { path = "./crates/build", version = "=0.2.0" }
smplx-test = { path = "./crates/test", version = "=0.2.0" }
smplx-regtest = { path = "./crates/regtest", version = "=0.2.0" }
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ In your report, please include as much information as you can, including:

* a description of the vulnerability and how it could be exploited
* its potential impact (e.g. privacy leak, denial of service, theft of funds)
* steps or code for reproducing it
* a proposed patch for remedying it
* steps or code for reproducing the vulnerability
* a proposed patch, if you have one

Also, provide us with a secure means to contact you with any follow up questions we might have.

## Considerations

Please take care not to violate the privacy of users in your report. For example, stack traces or exploit scripts sent to us should never contain private keys or personally identifiable information.

Give us at least one week to investigate the vulnerability you found and up to 90 days to fix it. Also, please give us reasonable advanced notice if at any point you intend to disclose the vulnerability to anyone else.
Give us at least one week to investigate the vulnerability you found and up to 90 days to fix the issue. Also, please give us reasonable advanced notice if at any point you intend to disclose the vulnerability to anyone else.

In general, please investigate and report bugs in a way that makes a reasonable, good faith effort not to be disruptive or harmful to us, this software's users, or the users of dependent projects.

Expand Down
2 changes: 1 addition & 1 deletion crates/build/src/config/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct RawDependency {
rev: Option<String>,
/// The specific tag to download (only applicable if `git` is provided).
tag: Option<String>,
/// The specific branch to download (only applicable if `branch` is provided).
/// The specific branch to download (only applicable if `git` is provided).
branch: Option<String>,
/// The specific directory with contracts to download (only applicable if `git` is provided).
package: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion crates/build/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl ArtifactsGenerator {
.map_err(|e| BuildError::DependencyMap(e.to_string()))
}

/// Processes a single `.simf` source file and write it to metadata:
/// Processes a single `.simf` source file into its metadata:
/// - Writes its content to the mirrored path under `simf_out_dir`
/// - Extracts the contract name
///
Expand Down
2 changes: 1 addition & 1 deletion crates/build/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl ArtifactsResolver {
let repo_name = clean_url.split('/').next_back()?;

// Only fields that are actually set take part in the key, so adding a new
// optional field never changes the directory of dependencies that don't use it.
// optional field never changes the directory of dependencies that don't set the field.
let reference = reference.map(|reference| match reference {
GitRef::Rev(rev) => format!("rev={rev}"),
GitRef::Tag(tag) => format!("tag={tag}"),
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pub enum CommandError {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),

#[error("Verbosity level should be either -v or -vv, got: -v x {0}")]
BadVersbosityMode(u8),
#[error("Verbosity must be -v or -vv, got {0} -v flags")]
BadVerbosityMode(u8),

#[error("test command failed with exit status {0}")]
TestFailed(i32),
Expand Down
6 changes: 2 additions & 4 deletions crates/cli/src/commands/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ impl Format {
Ok(Self::normalize_status(status))
}

/// Resolves the file path to the `simfmt` binary in the same directory where `simplex` is situated.
/// Given that `simfmt` would be placed in one directory with `simplex`, this is suitable for our usecase.
/// The path to the `simfmt` binary next to the `simplex` binary, where `simplexup` installs both.
///
/// # Warning
/// Can fail to search for binary when env isn't set and `simfmt` binary lies in the other directory.
/// Even when `simfmt` is visible through PATH.
/// Doesn't find a `simfmt` in another directory, even one on `PATH`, unless the env variable is set.
#[inline]
fn simfmt_binary() -> Result<PathBuf, FmtError> {
Ok(env::current_exe()
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Install {
/// at `reference`, keeping only `package` when it is set.
///
/// 1. Clone the history without contents and any checks.
/// 2. If `package` is set, restrict the checkout to it.
/// 2. If `package` is set, restrict the checkout to that directory.
/// 3. Check out `rev` (or the cloned ref), downloading only the files it needs.
fn git_commands(url: &str, reference: Option<&GitRef>, package: Option<&str>, target_dir: &Path) -> Vec<Command> {
let mut clone = Command::new("git");
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use smplx_test::{TestConfig, smplx_test_marker};
use super::core::{TestArguments, TestFlags};
use super::error::CommandError;

/// Nextest dsl variable to filter and use only simplex tests
/// Nextest filter expression that selects only Simplex tests.
const SMPLX_NEXTEST_DSL_TEST_MARKER: &str = concat!("test(/", smplx_test_marker!(), "$/)");
const SMPLX_NEXTEST_FUZZ_DSL_TEST_MARKER: &str = concat!("test(/", smplx_test_marker!(fuzz), "$/)");
const DEFAULT_THREADS_NUMBER: usize = 1;
Expand All @@ -26,7 +26,7 @@ impl Test {
let cache_path = Self::get_test_config_cache_name()?;

if flags.verbose > Verbosity::MAX_VERBOSITY_LEVEL {
return Err(CommandError::BadVersbosityMode(flags.verbose));
return Err(CommandError::BadVerbosityMode(flags.verbose));
}

config.verbosity = std::cmp::max(config.verbosity, Verbosity::new(flags.verbose));
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/config/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub enum ConfigError {
#[error("Unable to get env variable: {0}")]
UnableToGetEnv(#[from] std::env::VarError),

#[error("Path doesn't a file: '{0}'")]
#[error("Path isn't a file: '{0}'")]
PathIsNotFile(PathBuf),

#[error("Path doesn't exist: '{0}'")]
Expand Down
6 changes: 5 additions & 1 deletion crates/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ proc-macro = true
[lints]
workspace = true

[features]
default = ["test"]
test = ["dep:smplx-test"]

[dependencies]
smplx-build = { workspace = true }
smplx-test = { workspace = true }
smplx-test = { workspace = true, optional = true }

syn = { version = "3.0.8", default-features = false, features = ["parsing", "proc-macro"] }
2 changes: 2 additions & 0 deletions crates/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub fn include_simf(tokenstream: TokenStream) -> TokenStream {
}
}

#[cfg(feature = "test")]
#[proc_macro_attribute]
pub fn test(args: TokenStream, input: TokenStream) -> TokenStream {
let input = syn::parse_macro_input!(input as syn::ItemFn);
Expand All @@ -22,6 +23,7 @@ pub fn test(args: TokenStream, input: TokenStream) -> TokenStream {
}
}

#[cfg(feature = "test")]
#[proc_macro_attribute]
pub fn fuzz(args: TokenStream, input: TokenStream) -> TokenStream {
let input = syn::parse_macro_input!(input as syn::ItemFn);
Expand Down
2 changes: 1 addition & 1 deletion crates/regtest/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(super) fn get_elementsd_bin_args(config: &RegtestConfig) -> Vec<String> {
];

if let Some(port) = config.rpc_port {
// A lib works with autoassigned rpcport, so we are required to do this woodoo
// The node library picks the RPC port itself, so a fixed port needs explicit bind settings
args.push("-rpcbind=127.0.0.1".to_string());
args.push(format!("-rpcbind=127.0.0.1:{port}"));
args.push("-rpcallowip=127.0.0.1/8".to_string());
Expand Down
7 changes: 5 additions & 2 deletions crates/sdk/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/// Dummy signature, which is used for fee estimation
/// A placeholder for a witness signature that the signer replaces, for example at the end of a
/// [`ProgramSignature::at_path`](crate::transaction::ProgramSignature::at_path) path.
pub const DUMMY_SIGNATURE: [u8; 64] = [1; 64];

/// Minimal acceptable fee for nodes to relay a transaction
/// The smallest policy-asset surplus `Signer::finalize_strict` accepts, and the smallest blinded
/// change output the signer creates. It isn't a minimum fee: the fee follows the fee rate and can
/// be smaller.
pub const MIN_FEE: u64 = 10;

/// The smallest explicit output Elements relays by default for any standard script.
Expand Down
16 changes: 9 additions & 7 deletions crates/sdk/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ use crate::program::TrackerLogLevel;

static GLOBAL_CONFIG: OnceLock<GlobalConfig> = OnceLock::new();

/// A structure to represent the global configuration settings for the application.
/// The process-wide verbosity of program execution.
///
/// Verbosity `Debug` or `Trace` also compiles programs with debug symbols, which changes their
/// CMRs and addresses. An application that works with contracts deployed by others should leave
/// verbosity at `None`, or set [`Program::with_debug_symbols`](crate::program::Program::with_debug_symbols)
/// on each program.
#[derive(Clone, Copy, Debug, Default)]
pub struct GlobalConfig {
verbosity: Verbosity,
}

impl GlobalConfig {
/// Sets the global configuration for the SDK.
///
/// This function allows setting a global configuration which includes
/// the logging level for `simplicity` contracts execution.
/// It must be called exactly once during the application's lifetime.
/// Sets the process-wide verbosity. It can be set only once per process.
///
/// # Errors
/// Returns an error containing the newly created `GlobalConfig` if the global configuration has already been initialized.
pub fn set_global_config(verbosity: Verbosity) -> Result<(), GlobalConfig> {
GLOBAL_CONFIG.set(GlobalConfig { verbosity })
}

/// Returns the default log level if `GLOBAL_CONFIG` is not initialized
/// The tracker log level for the configured verbosity, or `TrackerLogLevel::None` if it was
/// never set.
pub fn get_log_level() -> TrackerLogLevel {
GLOBAL_CONFIG
.get()
Expand Down
1 change: 0 additions & 1 deletion crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub mod program;
pub mod provider;
/// Traits and mechanisms for signing transactions and satisfying witness requirements.
pub mod signer;
/// Constructs and builders for assembling, tracking, and managing Elements transactions.
pub mod transaction;
/// General utility functions, conversions, and helper tools.
pub mod utils;
Loading
Loading