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

Conversation

ldiego08
Copy link

Description

This PR renames helium to either regtest or local testnet, depending on the context. It provides a starting point to the migration from noble gas names to standard network names (regtest, mocknet, testnet, mainnet).

The following changes have been applied:

  • Renamed the stacks-node helium subcommand to stacks-node regtest The helium subcommand is intended to run Stacks with a local regtest Bitcoin node (for mocknet, there's a mocknet subcommand), hence it has been renamed to regtest.

  • Refactored stacks-node code to use the term local testnet instead of helium Beyond the CLI subcommand, "helium" is used interchangeably to refer to Stacks running with a local regtest or mocknet Bitcoin node (inferring it's for local development). Therefore, the helium.rs runloop file has been renamed to local.rs, comments now use "local testnet," and variables are updated to local_testnet.

If these names aren't the best, any suggestions are appreciated!

Based on a discussion with @wileyj

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@ldiego08 ldiego08 marked this pull request as ready for review June 28, 2024 14:52
@ldiego08 ldiego08 requested review from a team as code owners June 28, 2024 14:52
@ldiego08 ldiego08 requested a review from ASuciuX July 4, 2024 19:59
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

I see here there are a lot move possible networks so in this context LOCAL_TESTNET would refer to more network besides regtest and mocknet. @ldiego08 I'm curious how you think this should be treated based on this. And thanks again for making this PR!

Copy link
Author

Choose a reason for hiding this comment

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

@ASuciuX, while this function (and thus this constant) isn't used by runloops outside of regtest and mocknet (and some tests), other generic CLI commands like stacks-node check-config do utilize it. Therefore, it can be concluded that more networks are indeed involved here. Additionally, a function like into_config from a generic struct like ConnectionOptionsFile suggests a general-purpose use.

We could rename it to simply DEFAULT_CONNECTION_OPTIONS since there isn't another set of default connection options anyway. What do you think?

I would also suggest revisiting these config structs in a separate PR to refactor and document them for clarity.

@@ -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.

@ASuciuX
Copy link
Contributor

ASuciuX commented Jul 4, 2024

Also, tests passed successfully using

RUST_BACKTRACE=full BITCOIND_TEST=1 cargo test -- --test-threads=1

after modifying locally what I also modified on one of my PRs.

@ldiego08 ldiego08 requested a review from ASuciuX July 8, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants