Skip to content
Draft
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
453 changes: 230 additions & 223 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ version = "3.16.0"
# Keep dependencies sorted alphabetically
[workspace.dependencies]
# stacks-core git dependencies
clarity = { git = "https://github.com/stacks-network/stacks-core.git", rev = "cecca4ac19cdc836c8f806dae0c63a90f0087fb9", package = "clarity", default-features = false }
clarity-types = { git = "https://github.com/stacks-network/stacks-core.git", rev = "cecca4ac19cdc836c8f806dae0c63a90f0087fb9", package = "clarity-types" }
stacks-common = { git = "https://github.com/stacks-network/stacks-core.git", rev = "cecca4ac19cdc836c8f806dae0c63a90f0087fb9", package = "stacks-common", default-features = false }
pox-locking = { git = "https://github.com/stacks-network/stacks-core.git", rev = "cecca4ac19cdc836c8f806dae0c63a90f0087fb9", package = "pox-locking", default-features = false }
stackslib = { git = "https://github.com/stacks-network/stacks-core.git", rev = "cecca4ac19cdc836c8f806dae0c63a90f0087fb9", package = "stackslib", default-features = false }
clarity = { git = "https://github.com/hstove-stacks/stacks-core.git", branch = "feat/epoch-3-5-rc", package = "clarity", default-features = false }
clarity-types = { git = "https://github.com/hstove-stacks/stacks-core.git", branch = "feat/epoch-3-5-rc", package = "clarity-types" }
stacks-common = { git = "https://github.com/hstove-stacks/stacks-core.git", branch = "feat/epoch-3-5-rc", package = "stacks-common", default-features = false }
pox-locking = { git = "https://github.com/hstove-stacks/stacks-core.git", branch = "feat/epoch-3-5-rc", package = "pox-locking", default-features = false }
stackslib = { git = "https://github.com/hstove-stacks/stacks-core.git", branch = "feat/epoch-3-5-rc", package = "stackslib", default-features = false }

# Internal crates
clarinet-defaults = { path = "components/clarinet-defaults" }
Expand Down
14 changes: 8 additions & 6 deletions components/clarinet-cli/src/frontend/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2354,12 +2354,14 @@ fn devnet_start(cmd: DevnetStart, clarinetrc: ClarinetRC) {
},
_ => Err("Unable to retrieve config"),
};
let differ = DevnetDiffConfig::new();
let compatible = differ.is_compatible(&devnet_config.unwrap());
if let Err(incompatibles) = compatible {
display_devnet_incompatibilities(incompatibles);
prompt_user_to_continue();
display_devnet_incompatibilities_continue()
if !cmd.no_snapshot {
let differ = DevnetDiffConfig::new();
let compatible = differ.is_compatible(&devnet_config.unwrap());
if let Err(incompatibles) = compatible {
display_devnet_incompatibilities(incompatibles);
prompt_user_to_continue();
display_devnet_incompatibilities_continue()
}
}
let config = StartConfig {
devnet: orchestrator,
Expand Down
1 change: 0 additions & 1 deletion components/clarinet-deployments/src/onchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ pub fn apply_on_chain_deployment(
EpochSpec::Epoch3_2 => devnet.epoch_3_2,
EpochSpec::Epoch3_3 => devnet.epoch_3_3,
EpochSpec::Epoch3_4 => devnet.epoch_3_4,
// Clarinet always keeps optional support for a future epoch
EpochSpec::Epoch3_5 => devnet.epoch_3_5.unwrap_or(u64::MAX),
};
let mut epoch_transition_successful =
Expand Down
9 changes: 7 additions & 2 deletions components/clarinet-deployments/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl From<StacksEpochId> for EpochSpec {
StacksEpochId::Epoch32 => EpochSpec::Epoch3_2,
StacksEpochId::Epoch33 => EpochSpec::Epoch3_3,
StacksEpochId::Epoch34 => EpochSpec::Epoch3_4,
StacksEpochId::Epoch35 => EpochSpec::Epoch3_5,
StacksEpochId::Epoch10 => unreachable!("epoch 1.0 is not supported"),
}
}
Expand All @@ -83,7 +84,7 @@ impl From<EpochSpec> for StacksEpochId {
EpochSpec::Epoch3_2 => StacksEpochId::Epoch32,
EpochSpec::Epoch3_3 => StacksEpochId::Epoch33,
EpochSpec::Epoch3_4 => StacksEpochId::Epoch34,
EpochSpec::Epoch3_5 => unreachable!(),
EpochSpec::Epoch3_5 => StacksEpochId::Epoch35,
}
}
}
Expand Down Expand Up @@ -1603,13 +1604,17 @@ mod tests {
[[burnchain.epochs]]
epoch_name = "3.4"
start_height = 12

[[burnchain.epochs]]
epoch_name = "3.5"
start_height = 147
"#
}
);
}

#[test]
fn test_epoch_config_with_optional_next_epoch() {
fn test_epoch_config_with_epoch_3_5() {
let devnet_config = DevnetConfig {
epoch_2_0: 1,
epoch_2_05: 2,
Expand Down
9 changes: 5 additions & 4 deletions components/clarinet-files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ pub use network_manifest::{
DEFAULT_BITCOIN_NODE_IMAGE, DEFAULT_DERIVATION_PATH, DEFAULT_DOCKER_PLATFORM,
DEFAULT_EPOCH_2_0, DEFAULT_EPOCH_2_05, DEFAULT_EPOCH_2_1, DEFAULT_EPOCH_2_2, DEFAULT_EPOCH_2_3,
DEFAULT_EPOCH_2_4, DEFAULT_EPOCH_2_5, DEFAULT_EPOCH_3_0, DEFAULT_EPOCH_3_1, DEFAULT_EPOCH_3_2,
DEFAULT_EPOCH_3_3, DEFAULT_FAUCET_MNEMONIC, DEFAULT_FIRST_BURN_HEADER_HEIGHT,
DEFAULT_POSTGRES_IMAGE, DEFAULT_POX_PREPARE_LENGTH, DEFAULT_POX_REWARD_LENGTH,
DEFAULT_STACKER_MNEMONIC, DEFAULT_STACKS_API_IMAGE, DEFAULT_STACKS_EXPLORER_IMAGE,
DEFAULT_STACKS_MINER_MNEMONIC, DEFAULT_STACKS_NODE_IMAGE, DEFAULT_STACKS_SIGNER_IMAGE,
DEFAULT_EPOCH_3_3, DEFAULT_FAUCET_MNEMONIC,
DEFAULT_FIRST_BURN_HEADER_HEIGHT, DEFAULT_POSTGRES_IMAGE, DEFAULT_POX_PREPARE_LENGTH,
DEFAULT_POX_REWARD_LENGTH, DEFAULT_STACKER_MNEMONIC, DEFAULT_STACKS_API_IMAGE,
DEFAULT_STACKS_EXPLORER_IMAGE, DEFAULT_STACKS_MINER_MNEMONIC, DEFAULT_STACKS_NODE_IMAGE,
DEFAULT_STACKS_SIGNER_IMAGE,
};
pub use project_manifest::{
ProjectManifest, ProjectManifestFile, RequirementConfig, INVALID_CLARITY_VERSION,
Expand Down
15 changes: 11 additions & 4 deletions components/clarinet-files/src/network_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ pub const DEFAULT_EPOCH_2_3: u64 = 103;
pub const DEFAULT_EPOCH_2_4: u64 = 104;
pub const DEFAULT_EPOCH_2_5: u64 = 108;
pub const DEFAULT_EPOCH_3_0: u64 = 142;
pub const DEFAULT_EPOCH_3_1: u64 = 144;
pub const DEFAULT_EPOCH_3_2: u64 = 146;
pub const DEFAULT_EPOCH_3_3: u64 = 148;
pub const DEFAULT_EPOCH_3_4: u64 = 150;
pub const DEFAULT_EPOCH_3_1: u64 = 143;
pub const DEFAULT_EPOCH_3_2: u64 = 144;
pub const DEFAULT_EPOCH_3_3: u64 = 145;
pub const DEFAULT_EPOCH_3_4: u64 = 146;

// Currently, the pox-4 contract has these values hardcoded:
// https://github.com/stacks-network/stacks-core/blob/e09ab931e2f15ff70f3bb5c2f4d7afb[…]42bd7bec6/stackslib/src/chainstate/stacks/boot/pox-testnet.clar
Expand Down Expand Up @@ -368,6 +368,7 @@ pub struct AccountConfig {
pub derivation: String,
pub balance: u64,
pub sbtc_balance: u64,
pub btc_balance: u64,
pub stx_address: String,
pub btc_address: String,
pub is_mainnet: bool,
Expand Down Expand Up @@ -474,6 +475,10 @@ impl NetworkManifest {
Some(Value::Integer(balance)) => *balance as u64,
_ => 1_000_000_000, // mint 10 sBTC by default
};
let btc_balance = match account_settings.get("btc_balance") {
Some(Value::Integer(balance)) => *balance as u64,
_ => 0,
};

let mut mnemonic = match account_settings.get("mnemonic") {
Some(Value::String(phrase)) => match mnemonic_from_phrase(phrase) {
Expand Down Expand Up @@ -560,6 +565,7 @@ impl NetworkManifest {
derivation,
balance,
sbtc_balance,
btc_balance,
stx_address,
btc_address,
is_mainnet,
Expand Down Expand Up @@ -844,6 +850,7 @@ impl NetworkManifest {
derivation: stacker_derivation_path.clone(),
balance: 100_000_000_000_000,
sbtc_balance: 1_000_000_000,
btc_balance: 500_000_000,
stx_address,
btc_address,
is_mainnet: false,
Expand Down
3 changes: 2 additions & 1 deletion components/clarinet-sdk-wasm/src/ts_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ const STACKS_EPOCH_ID_STRING: &'static str = r#"export type StacksEpochId =
| "Epoch31"
| "Epoch32"
| "Epoch33"
| "Epoch34";"#;
| "Epoch34"
| "Epoch35";"#;

#[wasm_bindgen(typescript_custom_section)]
const CLARITY_VERSION_STRING: &'static str = r#"export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4" | "Clarity5";"#;
Expand Down
2 changes: 1 addition & 1 deletion components/clarinet-sdk/node/tests/deployment-plan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { describe, expect, it, beforeEach, afterEach } from "vitest";
import { initSimnet, generateDeployement } from "..";
import { Cl } from "@stacks/transactions";

const nbOfBootContracts = 26;
const nbOfBootContracts = 28;

const deploymentPlanPath = path.join(
process.cwd(),
Expand Down
2 changes: 1 addition & 1 deletion components/clarinet-sdk/node/tests/simnet-usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const address2 = "ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG";

let simnet: Simnet;

const nbOfBootContracts = 26;
const nbOfBootContracts = 28;
const latestEpochStr = "3.4";

const deploymentPlanPath = path.join(
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
clarity = { workspace = true, default-features = false, features = ["developer-mode"] }
clarity-types = { workspace = true, features = ["developer-mode"] }
ls-types = "0.0.3"
ls-types = "0.0.6"
regex = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions components/clarity-lsp/src/common/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ pub fn process_mutating_request(
version: Some(String::from(env!("CARGO_PKG_VERSION"))),
}),
capabilities: get_capabilities(&initialization_options),
offset_encoding: None,
}))
})
}
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-lsp/src/common/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use clarinet_files::{paths, FileAccessor, ProjectManifest, StacksNetwork};
use clarity::types::StacksEpochId;
use clarity::vm::analysis::ContractAnalysis;
use clarity::vm::ast::{build_ast, ContractAST};
use clarity::vm::costs::ExecutionCost;
use clarity::vm::diagnostic::{Diagnostic, Diagnostic as ClarityDiagnostic, Level as ClarityLevel};
use clarity::vm::types::{QualifiedContractIdentifier, StandardPrincipalData};
use clarity::vm::{ClarityName, ClarityVersion, EvaluationResult, SymbolicExpression};
Expand All @@ -22,7 +23,6 @@ use clarity_repl::repl::session::AnnotatedExecutionResult;
use clarity_repl::repl::ContractDeployer;
use clarity_repl::utils::{get_env_simnet_spans, CHECK_ENVIRONMENTS};
use clarity_static_cost::static_cost::StaticCost;
use clarity_types::execution_cost::ExecutionCost;
use ls_types::{
CompletionItem, Diagnostic as LspDiagnostic, DiagnosticSeverity, DiagnosticTag, DocumentSymbol,
Hover, Location, MessageType, Position, Range, SignatureHelp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use std::sync::LazyLock;

use clarinet_defaults::{DEFAULT_CLARITY_VERSION, DEFAULT_EPOCH};
use clarity::types::StacksEpochId;
use clarity::vm::analysis::errors::RuntimeCheckErrorKind;
pub use clarity::vm::analysis::types::ContractAnalysis;
use clarity::vm::ast::ContractAST;
use clarity::vm::representations::{SymbolicExpression, TraitDefinition};
use clarity::vm::types::{FunctionSignature, TypeSignatureExt};
use clarity::vm::{ClarityName, ClarityVersion, SymbolicExpressionType};
use clarity_types::errors::analysis::RuntimeCheckErrorKind;
use clarity_types::types::signatures::CallableSubtype;
use clarity_types::types::{
PrincipalData, QualifiedContractIdentifier, SequenceSubtype, TraitIdentifier, TypeSignature,
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/linter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use clarity_types::diagnostic::Level as ClarityDiagnosticLevel;
use clarity::vm::diagnostic::Level as ClarityDiagnosticLevel;
#[cfg(feature = "json_schema")]
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/at_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Lint for AtBlock<'_> {
#[cfg(test)]
mod tests {
use clarity::types::StacksEpochId;
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::AtBlock;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/case_binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Lint for CaseBinding<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseBinding;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/case_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Lint for CaseConst<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseConst;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Lint for CaseDataVar<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseDataVar;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/case_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl Lint for CaseFn<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseFn;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/case_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Lint for CaseMap<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseMap;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/case_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Lint for CaseToken<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseToken;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/case_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl Lint for CaseTrait<'_, '_> {
#[cfg(test)]
mod tests {
use clarity::types::StacksEpochId;
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::CaseTrait;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/error_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl Lint for ErrorConst<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::ErrorConst;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub use unused_trait::UnusedTrait;

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::{CaseConst, UnusedConst};
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ impl Lint for NoopChecker<'_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::NoopChecker;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl Lint for PanicChecker<'_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::PanicChecker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Lint for UnnecessaryAsMaxLen<'_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::UnnecessaryAsMaxLen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl Lint for UnnecessaryPublic<'_, '_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::UnnecessaryPublic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl Lint for UnusedBinding<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::{Diagnostic, Level};
use clarity::vm::diagnostic::{Diagnostic, Level};
use indoc::indoc;

use super::UnusedBinding;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/unused_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Lint for UnusedConst<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::UnusedConst;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl Lint for UnusedDataVar<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::UnusedDataVar;
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-repl/src/analysis/lints/unused_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Lint for UnusedMap<'_, '_> {

#[cfg(test)]
mod tests {
use clarity_types::diagnostic::Level;
use clarity::vm::diagnostic::Level;
use indoc::indoc;

use super::UnusedMap;
Expand Down
Loading
Loading