Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename helium to local testnet/regtest #4911

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
6 changes: 3 additions & 3 deletions contrib/tools/puppet-chain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion contrib/tools/puppet-chain/config.toml.default
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion contrib/tools/puppet-chain/local-leader.toml.default
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 2 additions & 2 deletions stackslib/src/burnchains/burnchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<B: BurnchainHeaderReader>(
db: &mut SortitionDB,
burnchain_db: &mut BurnchainDB,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions stackslib/src/chainstate/stacks/db/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a more explicit naming as it adds extra terms, while its goal is of removing them.
eg. REGTEST_BLOCK_LIMIT or REGTEST_OR_MOCKNET_BLOCK_LIMIT.

I am open to any suggestions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ASuciuX regtest and mocknet refer to local testnet nodes, hence why I suggested reconciling to "local" whenever "helium" was being used interchangeably for both. Past the CLI and into the runloops, regtest and mocknet are used for the respective Bitcoin burnchains. Reconciling might help create that boundary between the Stacks node and its burnchains. With that said, I'm okay with renaming to REGTEST_OR_MOCKNET_BLOCK_LIMIT. I don't think there will be other chains that would complicate this convention (e.g. REGTEST_OR_MOCKNET_OR_SIMNET_BLOCK_LIMIT). Thoughts?

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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the above comment. And for the others as well.

network_epoch: PEER_VERSION_EPOCH_2_1,
},
})
Expand All @@ -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),
Expand Down Expand Up @@ -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,
})
}
Expand All @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions stackslib/src/clarity_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -241,7 +241,7 @@ fn run_analysis<C: ClarityStorage>(
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,
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions stackslib/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions testnet/stacks-node/Stacks.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -2114,8 +2114,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
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 {
Expand Down
Loading