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
20 changes: 0 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,6 @@
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "executable 'stacks-node' -- mocknet",
"cargo": {
"args": [
"build",
"--bin=stacks-node",
"--package=stacks-node"
],
"filter": {
"name": "stacks-node",
"kind": "bin"
}
},
"args": [
"mocknet"
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6408-remove-helium.removed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed `helium` network mode and its legacy Stacks 2.x run loop. This included the `Node` struct, `Tenure` struct, `RunLoopCallbacks`, and related test infrastructure incompatible with Epoch 3 (Nakamoto). Shared genesis utilities relocated to `genesis.rs`. Use [Clarinet](https://github.com/hirosystems/clarinet) or `nakamoto-neon` mode for local development.
1 change: 1 addition & 0 deletions changelog.d/6553-remove-mocknet.removed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed `mocknet` network mode. This used a simulated in-process burnchain incompatible with Epoch 3 (Nakamoto). Use [Clarinet](https://github.com/hirosystems/clarinet) or a private testnet (`nakamoto-neon` mode) for local development.
2 changes: 1 addition & 1 deletion contrib/stacks-inspect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cargo build -p stacks-inspect

```
--config <CONFIG_FILE> Path to stacks-node configuration file
--network-config <NETWORK> Use a predefined network (helium, mainnet, mocknet, xenon)
--network-config <NETWORK> Use a predefined network (mainnet, xenon)
--version Show version information
--help Show help
```
Expand Down
2 changes: 1 addition & 1 deletion contrib/stacks-inspect/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub struct Cli {
#[arg(long, global = true, value_name = "CONFIG_FILE")]
pub config: Option<String>,

/// Use a predefined network configuration (helium, mainnet, mocknet, xenon)
/// Use a predefined network configuration (mainnet, xenon)
#[arg(long = "network-config", global = true, value_name = "NETWORK")]
pub network_config: Option<String>,

Expand Down
2 changes: 0 additions & 2 deletions contrib/stacks-inspect/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,7 @@ fn build_common_opts(cli: &Cli) -> CommonOpts {
// Handle --network-config option
if let Some(ref network) = cli.network_config {
let config_file = match network.to_lowercase().as_str() {
"helium" => ConfigFile::helium(),
"mainnet" => ConfigFile::mainnet(),
"mocknet" => ConfigFile::mocknet(),
"xenon" => ConfigFile::xenon(),
other => {
eprintln!("Unknown network choice `{other}`");
Expand Down
13 changes: 2 additions & 11 deletions docs/follower.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,9 @@ events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
auth_token = "your-secret-token"
```

## Local Development (Mocknet)
## Local Development

For local development without a Bitcoin node, use mocknet mode:

```bash
stacks-node start --config=mocknet.toml
```

Mocknet runs a simulated burnchain in-process, removes execution cost limits,
and requires pre-funded test accounts via `[[ustx_balance]]` entries.
See [`mocknet.toml`](../sample/conf/mocknet.toml).
For local development, use [Clarinet](https://github.com/hirosystems/clarinet) for contract development, or run a private testnet with `nakamoto-neon` mode and a local bitcoind regtest node.

## Environment Variables

Expand All @@ -99,7 +91,6 @@ These environment variables affect node behavior and cannot be set via TOML:
| --- | --- |
| [`mainnet-follower-conf.toml`](../sample/conf/mainnet-follower-conf.toml) | Mainnet follower |
| [`testnet-follower-conf.toml`](../sample/conf/testnet-follower-conf.toml) | Testnet follower |
| [`mocknet.toml`](../sample/conf/mocknet.toml) | Local mocknet development |

## Further Reading

Expand Down
1 change: 0 additions & 1 deletion docs/mining.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ signer configuration and the critical miner-signer coordination settings.
| [`mainnet-follower-conf.toml`](../sample/conf/mainnet-follower-conf.toml) | Mainnet follower (read-only node) |
| [`testnet-follower-conf.toml`](../sample/conf/testnet-follower-conf.toml) | Testnet follower |
| [`testnet-signer.toml`](../sample/conf/testnet-signer.toml) | Testnet node-side signer config |
| [`mocknet.toml`](../sample/conf/mocknet.toml) | Local mocknet development |

## RBF Configuration

Expand Down
2 changes: 1 addition & 1 deletion sample/conf/mainnet-miner-conf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ p2p_bind = "0.0.0.0:20444"
# bootstrap_node = "02e...@seed.mainnet.hiro.so:20444"

# Human-readable node name (used in logging).
# Default: "helium-node"
# Default: "stacks-node"
# name = "my-stacks-miner"

# Disable microblocks (not used in Nakamoto / Epoch 3.0+).
Expand Down
50 changes: 0 additions & 50 deletions sample/conf/mocknet.toml

This file was deleted.

2 changes: 1 addition & 1 deletion sample/conf/signer/mainnet-signer-conf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ node_host = "127.0.0.1:20443"
endpoint = "0.0.0.0:30000"

# REQUIRED: Network selection.
# Valid values: "mainnet", "testnet", "mocknet"
# Valid values: "mainnet", "testnet"
network = "mainnet"

# REQUIRED: Authorization password for the node's block proposal endpoint.
Expand Down
97 changes: 0 additions & 97 deletions stacks-node/Stacks.toml

This file was deleted.

39 changes: 10 additions & 29 deletions stacks-node/src/burnchains/bitcoin_regtest_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ use stacks_common::deps_common::bitcoin::blockdata::transaction::{
use stacks_common::deps_common::bitcoin::network::serialize::{serialize, serialize_hex};
use stacks_common::deps_common::bitcoin::util::hash::Sha256dHash;
use stacks_common::types::chainstate::BurnchainHeaderHash;
use stacks_common::util::hash::{hex_bytes, Hash160};
#[cfg(test)]
use stacks_common::util::hash::hex_bytes;
use stacks_common::util::hash::Hash160;
use stacks_common::util::secp256k1::Secp256k1PublicKey;
use stacks_common::util::sleep_ms;

Expand Down Expand Up @@ -571,7 +573,7 @@ impl BitcoinRegtestController {
let coordinator_comms = match self.use_coordinator.as_ref() {
Some(x) => x.clone(),
None => {
// pre-PoX helium node
// no coordinator — fall back to direct indexer sync
let tip = self.receive_blocks_helium();
let height = tip.block_snapshot.block_height;
return Ok((tip, height));
Expand Down Expand Up @@ -1948,6 +1950,7 @@ impl BitcoinRegtestController {
}

/// Instruct a regtest Bitcoin node to build the next block.
#[cfg(test)]
pub fn build_next_block(&self, num_blocks: u64) {
debug!("Generate {num_blocks} block(s)");
let public_key_bytes = match &self.config.burnchain.local_mining_public_key {
Expand All @@ -1960,25 +1963,9 @@ impl BitcoinRegtestController {
.expect("FATAL: invalid public key bytes");
let address = self.get_miner_address(StacksEpochId::Epoch21, &public_key);

let result = self
.get_rpc_client()
.generate_to_address(num_blocks, &address);
/*
Temporary: not using `BitcoinRpcClientResultExt::ok_or_log_panic` (test code related),
because we need this logic available outside `#[cfg(test)]` due to Helium network.

After the Helium cleanup (https://github.com/stacks-network/stacks-core/issues/6408),
we can:
- move `build_next_block` behind `#[cfg(test)]`
- simplify this match by using `ok_or_log_panic`.
*/
match result {
Ok(_) => {}
Err(e) => {
error!("Bitcoin RPC failure: error generating block {e:?}");
panic!();
}
}
self.get_rpc_client()
.generate_to_address(num_blocks, &address)
.ok_or_log_panic("error generating block");
}

/// Instruct a regtest Bitcoin node to build an empty block.
Expand Down Expand Up @@ -2365,14 +2352,8 @@ impl BurnchainController for BitcoinRegtestController {
&mut self,
target_block_height_opt: Option<u64>,
) -> Result<(BurnchainTip, u64), BurnchainControllerError> {
let (burnchain_tip, burnchain_height) = if self.config.burnchain.mode == "helium" {
// Helium: this node is responsible for mining new burnchain blocks
self.build_next_block(1);
self.receive_blocks(true, None)?
} else {
// Neon: this node is waiting on a block to be produced
self.receive_blocks(true, target_block_height_opt)?
};
let (burnchain_tip, burnchain_height) =
self.receive_blocks(true, target_block_height_opt)?;

// Evaluate process_exit_at_block_height setting
if let Some(cap) = self.config.burnchain.process_exit_at_block_height {
Expand Down
Loading
Loading