diff --git a/.gitignore b/.gitignore index 5069c47120..7453d67648 100644 --- a/.gitignore +++ b/.gitignore @@ -58,7 +58,7 @@ testnet/index.html # will have compiled files and executables /target/ -/testnet/helium/target/ +/testnet/regtest/target/ /contrib/tools/puppet-chain/target/ /contrib/core-contract-tests/.cache/ diff --git a/contrib/tools/puppet-chain/README.md b/contrib/tools/puppet-chain/README.md index 1a50d51031..976614e711 100644 --- a/contrib/tools/puppet-chain/README.md +++ b/contrib/tools/puppet-chain/README.md @@ -3,16 +3,16 @@ ## Getting started ```bash -$ cat helium.conf +$ cat regtest.conf chain=regtest disablewallet=0 txindex=1 server=1 -rpcuser=helium-node +rpcuser=regtest-node rpcpassword=secret // Start bitcoind -$ bitcoind -conf=helium.conf +$ bitcoind -conf=regtest.conf // Start puppet-chain $ DYNAMIC_GENESIS_TIMESTAMP=1 cargo run local-leader.toml.default diff --git a/contrib/tools/puppet-chain/config.toml.default b/contrib/tools/puppet-chain/config.toml.default index b77f1ee39c..b690e9db24 100644 --- a/contrib/tools/puppet-chain/config.toml.default +++ b/contrib/tools/puppet-chain/config.toml.default @@ -4,7 +4,7 @@ block_time = 7000 miner_address = "mx2uds6sgnn9znABQ6iDSSmXY9K5D4SHF9" faucet_address = "n2pGfZaAVztWqFzuy8iLS3VSuHB2SimWUR" bitcoind_rpc_host = "127.0.0.1:18443" -bitcoind_rpc_user = "helium-node" +bitcoind_rpc_user = "regtest-node" bitcoind_rpc_pass = "secret" genesis_timestamp = 1588615296 whitelisted_rpc_calls = [ diff --git a/contrib/tools/puppet-chain/local-leader.toml.default b/contrib/tools/puppet-chain/local-leader.toml.default index 443187aaed..8f75109d20 100644 --- a/contrib/tools/puppet-chain/local-leader.toml.default +++ b/contrib/tools/puppet-chain/local-leader.toml.default @@ -4,7 +4,7 @@ block_time = 30000 miner_address = "mtFzK54XtpktHj7fKonFExEPEGkUMsiXdy" faucet_address = "mrzLDS7LT3otAnpiRWGYkWipdnAZJaXAZQ" bitcoind_rpc_host = "127.0.0.1:18443" -bitcoind_rpc_user = "helium-node" +bitcoind_rpc_user = "regtest-node" bitcoind_rpc_pass = "secret" genesis_timestamp = 1590765126 whitelisted_rpc_calls = [ diff --git a/stackslib/src/burnchains/burnchain.rs b/stackslib/src/burnchains/burnchain.rs index 348a472a6f..6defd5e763 100644 --- a/stackslib/src/burnchains/burnchain.rs +++ b/stackslib/src/burnchains/burnchain.rs @@ -1079,7 +1079,7 @@ impl Burnchain { } /// Hand off the block to the ChainsCoordinator _and_ process the sortition - /// *only* to be used by legacy stacks node interfaces, like the Helium node + /// *only* to be used by legacy stacks node interfaces, like the local testnet node fn process_block_and_sortition_deprecated( db: &mut SortitionDB, burnchain_db: &mut BurnchainDB, @@ -1113,7 +1113,7 @@ impl Burnchain { // extract block-commit metadata // Do not emit sortition/burn block events to event observer in this method, because this - // method is deprecated and only used in defunct helium nodes + // method is deprecated and only used in defunct local testnet nodes db.evaluate_sortition( &header, diff --git a/stackslib/src/chainstate/stacks/db/transactions.rs b/stackslib/src/chainstate/stacks/db/transactions.rs index 35ba532667..ecd82ed547 100644 --- a/stackslib/src/chainstate/stacks/db/transactions.rs +++ b/stackslib/src/chainstate/stacks/db/transactions.rs @@ -8687,14 +8687,14 @@ pub mod test { epoch_id: StacksEpochId::Epoch2_05, start_height: 1, end_height: 2, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_05, }, _ => StacksEpoch { epoch_id: StacksEpochId::Epoch21, start_height: 2, end_height: u64::MAX, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_1, }, }) @@ -8708,7 +8708,7 @@ pub mod test { epoch_id: StacksEpochId::Epoch10, start_height: 0, end_height: 0, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_0, }), StacksEpochId::Epoch20 => self.get_stacks_epoch(0), @@ -8916,7 +8916,7 @@ pub mod test { epoch_id: StacksEpochId::Epoch21, start_height: 0, end_height: u64::MAX, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_1, }) } @@ -8929,7 +8929,7 @@ pub mod test { epoch_id: StacksEpochId::Epoch10, start_height: 0, end_height: 0, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_0, }), _ => self.get_stacks_epoch(0), diff --git a/stackslib/src/clarity_cli.rs b/stackslib/src/clarity_cli.rs index 7d2b53eb0e..c3db7c1617 100644 --- a/stackslib/src/clarity_cli.rs +++ b/stackslib/src/clarity_cli.rs @@ -62,7 +62,7 @@ use crate::clarity::vm::{ }; use crate::clarity_vm::database::marf::{MarfedKV, WritableMarfStore}; use crate::clarity_vm::database::MemoryBackingStore; -use crate::core::{StacksEpochId, BLOCK_LIMIT_MAINNET_205, HELIUM_BLOCK_LIMIT_20}; +use crate::core::{StacksEpochId, BLOCK_LIMIT_MAINNET_205, LOCAL_TESTNET_BLOCK_LIMIT_20}; use crate::util_lib::boot::{boot_code_addr, boot_code_id}; use crate::util_lib::db::{sqlite_open, FromColumn}; use crate::util_lib::strings::StacksString; @@ -241,7 +241,7 @@ fn run_analysis( if mainnet { BLOCK_LIMIT_MAINNET_205.clone() } else { - HELIUM_BLOCK_LIMIT_20.clone() + LOCAL_TESTNET_BLOCK_LIMIT_20.clone() }, &mut marf_kv.get_clarity_db(header_db, &NULL_BURN_STATE_DB), DEFAULT_CLI_EPOCH, @@ -429,7 +429,7 @@ where if mainnet { BLOCK_LIMIT_MAINNET_205.clone() } else { - HELIUM_BLOCK_LIMIT_20.clone() + LOCAL_TESTNET_BLOCK_LIMIT_20.clone() }, &mut db, DEFAULT_CLI_EPOCH, diff --git a/stackslib/src/core/mod.rs b/stackslib/src/core/mod.rs index b4a3d834f5..b275fda4cf 100644 --- a/stackslib/src/core/mod.rs +++ b/stackslib/src/core/mod.rs @@ -236,12 +236,12 @@ pub const BLOCK_LIMIT_MAINNET_21: ExecutionCost = ExecutionCost { }; // Block limit for the testnet in Stacks 2.0. -pub const HELIUM_BLOCK_LIMIT_20: ExecutionCost = ExecutionCost { +pub const LOCAL_TESTNET_BLOCK_LIMIT_20: ExecutionCost = ExecutionCost { write_length: 15_0_000_000, write_count: 5_0_000, read_length: 1_000_000_000, read_count: 5_0_000, - // allow much more runtime in helium blocks than mainnet + // allow much more runtime in local testnet blocks than mainnet runtime: 100_000_000_000, }; @@ -408,42 +408,42 @@ lazy_static! { epoch_id: StacksEpochId::Epoch20, start_height: 0, end_height: 1000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_0 }, StacksEpoch { epoch_id: StacksEpochId::Epoch2_05, start_height: 1000, end_height: 2000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_05 }, StacksEpoch { epoch_id: StacksEpochId::Epoch21, start_height: 2000, end_height: 3000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_1 }, StacksEpoch { epoch_id: StacksEpochId::Epoch22, start_height: 3000, end_height: 4000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_2 }, StacksEpoch { epoch_id: StacksEpochId::Epoch23, start_height: 4000, end_height: 5000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_3 }, StacksEpoch { epoch_id: StacksEpochId::Epoch24, start_height: 5000, end_height: 6000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_4 }, StacksEpoch { diff --git a/testnet/stacks-node/Stacks.toml b/testnet/stacks-node/Stacks.toml index 0e4aed80a9..482a3594e0 100644 --- a/testnet/stacks-node/Stacks.toml +++ b/testnet/stacks-node/Stacks.toml @@ -1,5 +1,5 @@ [node] -name = "helium-node" +name = "regtest-node" rpc_bind = "127.0.0.1:20443" ## Settings for local testnet, relying on a local bitcoind server @@ -9,17 +9,17 @@ rpc_bind = "127.0.0.1:20443" ## disablewallet=0 ## txindex=1 ## server=1 -## rpcuser=helium-node +## rpcuser=regtest-node ## rpcpassword=secret ## # [burnchain] # chain = "bitcoin" -# mode = "helium" +# mode = "regtest" # peer_host = "127.0.0.1" # peer_port = 18444 # rpc_port = 18443 # rpc_ssl = false -# username = "helium-node" +# username = "regtest-node" # password = "secret" # timeout = 30 # local_mining_public_key = "04ee0b1602eb18fef7986887a7e8769a30c9df981d33c8380d255edef003abdcd243a0eb74afdf6740e6c423e62aec631519a24cf5b1d62bf8a3e06ddc695dcb77" diff --git a/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs b/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs index 30f088a96f..c10dc8d89a 100644 --- a/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs +++ b/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs @@ -433,8 +433,8 @@ impl BitcoinRegtestController { } } - /// Helium (devnet) blocks receiver. Returns the new burnchain tip. - fn receive_blocks_helium(&mut self) -> BurnchainTip { + /// Local testnet blocks receiver. Returns the new burnchain tip. + fn receive_blocks_local_testnet(&mut self) -> BurnchainTip { let mut burnchain = self.get_burnchain(); let (block_snapshot, state_transition) = loop { match burnchain.sync_with_indexer_deprecated(&mut self.indexer) { @@ -500,8 +500,8 @@ impl BitcoinRegtestController { let coordinator_comms = match self.use_coordinator.as_ref() { Some(x) => x.clone(), None => { - // pre-PoX helium node - let tip = self.receive_blocks_helium(); + // pre-PoX local testnet node + let tip = self.receive_blocks_local_testnet(); let height = tip.block_snapshot.block_height; return Ok((tip, height)); } @@ -2114,8 +2114,8 @@ impl BurnchainController for BitcoinRegtestController { &mut self, target_block_height_opt: Option, ) -> 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 + let (burnchain_tip, burnchain_height) = if self.config.burnchain.mode == "regtest" { + // Local testnet: this node is responsible for mining new burnchain blocks self.build_next_block(1); self.receive_blocks(true, None)? } else { diff --git a/testnet/stacks-node/src/config.rs b/testnet/stacks-node/src/config.rs index 1f6d182f68..c20f7dbbe3 100644 --- a/testnet/stacks-node/src/config.rs +++ b/testnet/stacks-node/src/config.rs @@ -402,7 +402,7 @@ impl ConfigFile { } } - pub fn helium() -> ConfigFile { + pub fn regtest() -> ConfigFile { // ## Settings for local testnet, relying on a local bitcoind server // ## running with the following bitcoin.conf: // ## @@ -410,17 +410,17 @@ impl ConfigFile { // ## disablewallet=0 // ## txindex=1 // ## server=1 - // ## rpcuser=helium - // ## rpcpassword=helium + // ## rpcuser=user + // ## rpcpassword=pass // ## let burnchain = BurnchainConfigFile { - mode: Some("helium".to_string()), + mode: Some("regtest".to_string()), commit_anchor_block_within: Some(10_000), rpc_port: Some(18443), peer_port: Some(18444), peer_host: Some("0.0.0.0".to_string()), - username: Some("helium".to_string()), - password: Some("helium".to_string()), + username: Some("user".to_string()), + password: Some("pass".to_string()), local_mining_public_key: Some("04ee0b1602eb18fef7986887a7e8769a30c9df981d33c8380d255edef003abdcd243a0eb74afdf6740e6c423e62aec631519a24cf5b1d62bf8a3e06ddc695dcb77".to_string()), ..BurnchainConfigFile::default() }; @@ -505,7 +505,7 @@ pub struct Config { } lazy_static! { - static ref HELIUM_DEFAULT_CONNECTION_OPTIONS: ConnectionOptions = ConnectionOptions { + static ref LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS: ConnectionOptions = ConnectionOptions { inbox_maxlen: 100, outbox_maxlen: 100, timeout: 15, @@ -978,8 +978,8 @@ impl Config { }; let supported_modes = [ + "regtest", "mocknet", - "helium", "neon", "argon", "krypton", @@ -995,8 +995,8 @@ impl Config { )); } - if burnchain.mode == "helium" && burnchain.local_mining_public_key.is_none() { - return Err(format!("Config is missing the setting `burnchain.local_mining_public_key` (mandatory for helium)")); + if burnchain.mode == "regtest" && burnchain.local_mining_public_key.is_none() { + return Err(format!("Config is missing the setting `burnchain.local_mining_public_key` (mandatory for regtest)")); } let is_mainnet = burnchain.mode == "mainnet"; @@ -1119,7 +1119,7 @@ impl Config { let connection_options = match config_file.connection_options { Some(opts) => opts.into_config(is_mainnet)?, - None => HELIUM_DEFAULT_CONNECTION_OPTIONS.clone(), + None => LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.clone(), }; let estimation = match config_file.fee_estimation { @@ -1347,7 +1347,7 @@ impl std::default::Default for Config { let node = NodeConfig::default(); let burnchain = BurnchainConfig::default(); - let connection_options = HELIUM_DEFAULT_CONNECTION_OPTIONS.clone(); + let connection_options = LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.clone(); let estimation = FeeEstimationConfig::default(); let mainnet = burnchain.mode == "mainnet"; @@ -1472,7 +1472,7 @@ impl BurnchainConfig { match self.mode.as_str() { "mainnet" => ("mainnet".to_string(), BitcoinNetworkType::Mainnet), "xenon" => ("testnet".to_string(), BitcoinNetworkType::Testnet), - "helium" | "neon" | "argon" | "krypton" | "mocknet" | "nakamoto-neon" => { + "regtest" | "neon" | "argon" | "krypton" | "mocknet" | "nakamoto-neon" => { ("regtest".to_string(), BitcoinNetworkType::Regtest) } other => panic!("Invalid stacks-node mode: {other}"), @@ -2071,7 +2071,7 @@ impl Default for NodeConfig { let mut seed = [0u8; 32]; rng.fill_bytes(&mut seed); - let name = "helium-node"; + let name = "regtest-node"; NodeConfig { name: name.to_string(), seed: seed.to_vec(), @@ -2406,7 +2406,7 @@ impl ConnectionOptionsFile { .map_err(|e| format!("Invalid connection_option.public_ip_address: {}", e)) }) .transpose()?; - let mut read_only_call_limit = HELIUM_DEFAULT_CONNECTION_OPTIONS + let mut read_only_call_limit = LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS .read_only_call_limit .clone(); self.read_only_call_limit_write_length.map(|x| { @@ -2428,74 +2428,78 @@ impl ConnectionOptionsFile { read_only_call_limit, inbox_maxlen: self .inbox_maxlen - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.inbox_maxlen), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.inbox_maxlen), outbox_maxlen: self .outbox_maxlen - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.outbox_maxlen), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.outbox_maxlen), timeout: self .timeout - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.timeout), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.timeout), idle_timeout: self .idle_timeout - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.idle_timeout), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.idle_timeout), heartbeat: self .heartbeat - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.heartbeat), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.heartbeat), private_key_lifetime: self .private_key_lifetime - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.private_key_lifetime), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.private_key_lifetime), num_neighbors: self .num_neighbors - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.num_neighbors), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.num_neighbors), num_clients: self .num_clients - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.num_clients), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.num_clients), soft_num_neighbors: self .soft_num_neighbors - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.soft_num_neighbors), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.soft_num_neighbors), soft_num_clients: self .soft_num_clients - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.soft_num_clients), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.soft_num_clients), max_neighbors_per_host: self .max_neighbors_per_host - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.max_neighbors_per_host), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.max_neighbors_per_host), max_clients_per_host: self .max_clients_per_host - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.max_clients_per_host), - soft_max_neighbors_per_host: self - .soft_max_neighbors_per_host - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.soft_max_neighbors_per_host), - soft_max_neighbors_per_org: self - .soft_max_neighbors_per_org - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.soft_max_neighbors_per_org), - soft_max_clients_per_host: self - .soft_max_clients_per_host - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.soft_max_clients_per_host), - walk_interval: self - .walk_interval - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.walk_interval.clone()), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.max_clients_per_host), + soft_max_neighbors_per_host: self.soft_max_neighbors_per_host.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.soft_max_neighbors_per_host + }), + soft_max_neighbors_per_org: self.soft_max_neighbors_per_org.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.soft_max_neighbors_per_org + }), + soft_max_clients_per_host: self.soft_max_clients_per_host.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.soft_max_clients_per_host + }), + walk_interval: self.walk_interval.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS + .walk_interval + .clone() + }), dns_timeout: self .dns_timeout .map(|dns_timeout| dns_timeout as u128) - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.dns_timeout), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.dns_timeout), max_inflight_blocks: self .max_inflight_blocks - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.max_inflight_blocks), - max_inflight_attachments: self - .max_inflight_attachments - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.max_inflight_attachments), - maximum_call_argument_size: self - .maximum_call_argument_size - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.maximum_call_argument_size), - download_interval: self - .download_interval - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.download_interval.clone()), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.max_inflight_blocks), + max_inflight_attachments: self.max_inflight_attachments.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.max_inflight_attachments + }), + maximum_call_argument_size: self.maximum_call_argument_size.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.maximum_call_argument_size + }), + download_interval: self.download_interval.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS + .download_interval + .clone() + }), inv_sync_interval: self .inv_sync_interval - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.inv_sync_interval), + .unwrap_or_else(|| LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.inv_sync_interval), inv_reward_cycles: self.inv_reward_cycles.unwrap_or_else(|| { if is_mainnet { - HELIUM_DEFAULT_CONNECTION_OPTIONS.inv_reward_cycles + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS.inv_reward_cycles } else { // testnet reward cycles are a bit smaller (and blocks can go by // faster), so make our inventory @@ -2508,9 +2512,11 @@ impl ConnectionOptionsFile { disable_inbound_handshakes: self.disable_inbound_handshakes.unwrap_or(false), disable_block_download: self.disable_block_download.unwrap_or(false), force_disconnect_interval: self.force_disconnect_interval, - max_http_clients: self - .max_http_clients - .unwrap_or_else(|| HELIUM_DEFAULT_CONNECTION_OPTIONS.max_http_clients.clone()), + max_http_clients: self.max_http_clients.unwrap_or_else(|| { + LOCAL_TESTNET_DEFAULT_CONNECTION_OPTIONS + .max_http_clients + .clone() + }), connect_timeout: self.connect_timeout.unwrap_or(10), handshake_timeout: self.handshake_timeout.unwrap_or(5), max_sockets: self.max_sockets.unwrap_or(800) as usize, diff --git a/testnet/stacks-node/src/main.rs b/testnet/stacks-node/src/main.rs index 41b7426278..de23a892a7 100644 --- a/testnet/stacks-node/src/main.rs +++ b/testnet/stacks-node/src/main.rs @@ -51,7 +51,7 @@ pub use self::config::{Config, ConfigFile}; pub use self::event_dispatcher::EventDispatcher; pub use self::keychain::Keychain; pub use self::node::{ChainTip, Node}; -pub use self::run_loop::{helium, neon}; +pub use self::run_loop::{local, neon}; pub use self::tenure::Tenure; use crate::chain_data::MinerStats; use crate::neon_node::{BlockMinerThread, TipCandidate}; @@ -290,6 +290,8 @@ fn main() { let mut args = Arguments::from_env(); let subcommand = args.subcommand().unwrap().unwrap_or_default(); + warn_deprecated_subcommands(subcommand.as_str()); + info!("{}", version()); let mine_start: Option = args @@ -308,9 +310,9 @@ fn main() { args.finish(); ConfigFile::mocknet() } - "helium" => { + "regtest" | "helium" => { args.finish(); - ConfigFile::helium() + ConfigFile::regtest() } "testnet" => { args.finish(); @@ -432,10 +434,10 @@ fn main() { let num_round: u64 = 0; // Infinite number of rounds - if conf.burnchain.mode == "helium" || conf.burnchain.mode == "mocknet" { - let mut run_loop = helium::RunLoop::new(conf); + if conf.burnchain.mode == "regtest" || conf.burnchain.mode == "mocknet" { + let mut run_loop = local::RunLoop::new(conf); if let Err(e) = run_loop.start(num_round) { - warn!("Helium runloop exited: {}", e); + warn!("Local runloop exited with error: {}", e); return; } } else if conf.burnchain.mode == "neon" @@ -477,14 +479,14 @@ mainnet\t\tStart a node that will join and stream blocks from the public mainnet mocknet\t\tStart a node based on a fast local setup emulating a burnchain. Ideal for smart contract development. -helium\t\tStart a node based on a local setup relying on a local instance of bitcoind. +regtest\t\tStart a node based on a local setup relying on a local instance of bitcoind. \t\tThe following bitcoin.conf is expected: \t\t chain=regtest \t\t disablewallet=0 \t\t txindex=1 \t\t server=1 -\t\t rpcuser=helium -\t\t rpcpassword=helium +\t\t rpcuser=user +\t\t rpcpassword=pass testnet\t\tStart a node that will join and stream blocks from the public testnet, relying on Bitcoin Testnet. @@ -511,5 +513,12 @@ OPTIONAL ARGUMENTS: ", argv[0]); } +/// Prints a warning if the subcommand has been deprecated. +fn warn_deprecated_subcommands(subcommand: &str) { + if subcommand == "helium" { + warn!("Subcommand 'helium' is deprecated and will be removed in future versions. Use 'stacks-node regtest' to use a local Bitcoin node (regtest)"); + } +} + #[cfg(test)] pub mod tests; diff --git a/testnet/stacks-node/src/node.rs b/testnet/stacks-node/src/node.rs index 2c78b4c187..aa691fd9d4 100644 --- a/testnet/stacks-node/src/node.rs +++ b/testnet/stacks-node/src/node.rs @@ -150,7 +150,7 @@ pub fn get_names(use_test_chainstate_data: bool) -> Box Result<(), BurnchainControllerError> { // Initialize and start the burnchain. let mut burnchain: Box = match &self.config.burnchain.mode[..] { - "helium" => Box::new(BitcoinRegtestController::new(self.config.clone(), None)), + "regtest" => Box::new(BitcoinRegtestController::new(self.config.clone(), None)), "mocknet" => MocknetController::generic(self.config.clone()), _ => unreachable!(), }; diff --git a/testnet/stacks-node/src/run_loop/mod.rs b/testnet/stacks-node/src/run_loop/mod.rs index b824793e17..c389d54faa 100644 --- a/testnet/stacks-node/src/run_loop/mod.rs +++ b/testnet/stacks-node/src/run_loop/mod.rs @@ -1,5 +1,5 @@ pub mod boot_nakamoto; -pub mod helium; +pub mod local; pub mod nakamoto; pub mod neon; diff --git a/testnet/stacks-node/src/tenure.rs b/testnet/stacks-node/src/tenure.rs index 5dd67cddab..8f3e2c1010 100644 --- a/testnet/stacks-node/src/tenure.rs +++ b/testnet/stacks-node/src/tenure.rs @@ -17,7 +17,7 @@ use stacks_common::types::chainstate::VRFSeed; use stacks_common::util::hash::Hash160; use stacks_common::util::vrf::VRFProof; -/// Only used by the Helium (Mocknet) node +/// Only used by the local testnet node use super::node::ChainTip; use super::{BurnchainTip, Config}; diff --git a/testnet/stacks-node/src/tests/bitcoin_regtest.rs b/testnet/stacks-node/src/tests/bitcoin_regtest.rs index 5f8b1aabd3..b53241ee42 100644 --- a/testnet/stacks-node/src/tests/bitcoin_regtest.rs +++ b/testnet/stacks-node/src/tests/bitcoin_regtest.rs @@ -12,7 +12,7 @@ use stacks_common::util::hash::hex_bytes; use super::PUBLISH_CONTRACT; use crate::config::InitialBalance; -use crate::helium::RunLoop; +use crate::local::RunLoop; use crate::tests::to_addr; use crate::Config; @@ -162,10 +162,10 @@ fn bitcoind_integration(segwit_flag: bool) { let mut conf = super::new_test_conf(); conf.burnchain.commit_anchor_block_within = 2000; conf.burnchain.burn_fee_cap = BITCOIND_INT_TEST_COMMITS; - conf.burnchain.mode = "helium".to_string(); + conf.burnchain.mode = "regtest".to_string(); conf.burnchain.peer_host = "127.0.0.1".to_string(); conf.burnchain.rpc_port = 18443; - conf.burnchain.username = Some("helium-node".to_string()); + conf.burnchain.username = Some("regtest-node".to_string()); conf.burnchain.password = Some("secret".to_string()); conf.burnchain.local_mining_public_key = Some("04ee0b1602eb18fef7986887a7e8769a30c9df981d33c8380d255edef003abdcd243a0eb74afdf6740e6c423e62aec631519a24cf5b1d62bf8a3e06ddc695dcb77".to_string()); diff --git a/testnet/stacks-node/src/tests/integrations.rs b/testnet/stacks-node/src/tests/integrations.rs index 694d27ca15..44091e25be 100644 --- a/testnet/stacks-node/src/tests/integrations.rs +++ b/testnet/stacks-node/src/tests/integrations.rs @@ -40,7 +40,7 @@ use super::{ SK_3, }; use crate::config::InitialBalance; -use crate::helium::RunLoop; +use crate::local::RunLoop; use crate::tests::make_sponsored_stacks_transfer_on_testnet; const OTHER_CONTRACT: &'static str = " diff --git a/testnet/stacks-node/src/tests/mempool.rs b/testnet/stacks-node/src/tests/mempool.rs index 6221c6cf11..fc2db184d2 100644 --- a/testnet/stacks-node/src/tests/mempool.rs +++ b/testnet/stacks-node/src/tests/mempool.rs @@ -28,7 +28,7 @@ use super::{ make_coinbase, make_contract_call, make_contract_publish, make_poison, make_stacks_transfer, serialize_sign_standard_single_sig_tx_anchor_mode_version, to_addr, SK_1, SK_2, }; -use crate::helium::RunLoop; +use crate::local::RunLoop; use crate::Keychain; const FOO_CONTRACT: &'static str = "(define-public (foo) (ok 1)) diff --git a/testnet/stacks-node/src/tests/mod.rs b/testnet/stacks-node/src/tests/mod.rs index 0b8c379f7c..a0869658cd 100644 --- a/testnet/stacks-node/src/tests/mod.rs +++ b/testnet/stacks-node/src/tests/mod.rs @@ -46,7 +46,7 @@ use stacks_common::util::hash::{hex_bytes, to_hex}; use super::burnchains::bitcoin_regtest_controller::ParsedUTXO; use super::neon_node::{BlockMinerThread, TipCandidate}; use super::Config; -use crate::helium::RunLoop; +use crate::local::RunLoop; use crate::tests::neon_integrations::{get_chain_info, next_block_and_wait}; use crate::BitcoinRegtestController; diff --git a/testnet/stacks-node/src/tests/nakamoto_integrations.rs b/testnet/stacks-node/src/tests/nakamoto_integrations.rs index 8570b0aeff..0fc7c3b3c9 100644 --- a/testnet/stacks-node/src/tests/nakamoto_integrations.rs +++ b/testnet/stacks-node/src/tests/nakamoto_integrations.rs @@ -59,7 +59,7 @@ use stacks::chainstate::stacks::{ }; use stacks::core::mempool::MAXIMUM_MEMPOOL_TX_CHAINING; use stacks::core::{ - StacksEpoch, StacksEpochId, BLOCK_LIMIT_MAINNET_10, HELIUM_BLOCK_LIMIT_20, + StacksEpoch, StacksEpochId, BLOCK_LIMIT_MAINNET_10, LOCAL_TESTNET_BLOCK_LIMIT_20, PEER_VERSION_EPOCH_1_0, PEER_VERSION_EPOCH_2_0, PEER_VERSION_EPOCH_2_05, PEER_VERSION_EPOCH_2_1, PEER_VERSION_EPOCH_2_2, PEER_VERSION_EPOCH_2_3, PEER_VERSION_EPOCH_2_4, PEER_VERSION_EPOCH_2_5, PEER_VERSION_EPOCH_3_0, PEER_VERSION_TESTNET, @@ -125,56 +125,56 @@ lazy_static! { epoch_id: StacksEpochId::Epoch20, start_height: 0, end_height: 1, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_0 }, StacksEpoch { epoch_id: StacksEpochId::Epoch2_05, start_height: 1, end_height: 2, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_05 }, StacksEpoch { epoch_id: StacksEpochId::Epoch21, start_height: 2, end_height: 3, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_1 }, StacksEpoch { epoch_id: StacksEpochId::Epoch22, start_height: 3, end_height: 4, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_2 }, StacksEpoch { epoch_id: StacksEpochId::Epoch23, start_height: 4, end_height: 5, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_3 }, StacksEpoch { epoch_id: StacksEpochId::Epoch24, start_height: 5, end_height: 201, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_4 }, StacksEpoch { epoch_id: StacksEpochId::Epoch25, start_height: 201, end_height: 231, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_5 }, StacksEpoch { epoch_id: StacksEpochId::Epoch30, start_height: 231, end_height: STACKS_EPOCH_MAX, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_3_0 }, ]; diff --git a/testnet/stacks-node/src/tests/neon_integrations.rs b/testnet/stacks-node/src/tests/neon_integrations.rs index fb1535685a..4f4f81a9b4 100644 --- a/testnet/stacks-node/src/tests/neon_integrations.rs +++ b/testnet/stacks-node/src/tests/neon_integrations.rs @@ -42,7 +42,7 @@ use stacks::codec::StacksMessageCodec; use stacks::core::mempool::MemPoolWalkTxTypes; use stacks::core::{ self, StacksEpoch, StacksEpochId, BLOCK_LIMIT_MAINNET_20, BLOCK_LIMIT_MAINNET_205, - BLOCK_LIMIT_MAINNET_21, CHAIN_ID_TESTNET, HELIUM_BLOCK_LIMIT_20, PEER_VERSION_EPOCH_1_0, + BLOCK_LIMIT_MAINNET_21, CHAIN_ID_TESTNET, LOCAL_TESTNET_BLOCK_LIMIT_20, PEER_VERSION_EPOCH_1_0, PEER_VERSION_EPOCH_2_0, PEER_VERSION_EPOCH_2_05, PEER_VERSION_EPOCH_2_1, PEER_VERSION_EPOCH_2_2, PEER_VERSION_EPOCH_2_3, PEER_VERSION_EPOCH_2_4, PEER_VERSION_EPOCH_2_5, PEER_VERSION_TESTNET, @@ -107,21 +107,21 @@ fn inner_neon_integration_test_conf(seed: Option>) -> (Config, StacksAdd epoch_id: StacksEpochId::Epoch20, start_height: 0, end_height: 1000, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_0, }, StacksEpoch { epoch_id: StacksEpochId::Epoch2_05, start_height: 1000, end_height: 1000000 - 1, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_05, }, StacksEpoch { epoch_id: StacksEpochId::Epoch21, start_height: 1000000 - 1, end_height: 9223372036854775807, - block_limit: HELIUM_BLOCK_LIMIT_20.clone(), + block_limit: LOCAL_TESTNET_BLOCK_LIMIT_20.clone(), network_epoch: PEER_VERSION_EPOCH_2_1, }, ]);