Skip to content

Commit

Permalink
penumbra: fix incorrect replaces
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Dec 25, 2024
1 parent 7653e29 commit 929450b
Show file tree
Hide file tree
Showing 37 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion crates/bin/pcli/src/command/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct InitCmd {
// pcli init inside of the test harness (where we override that)
// will correctly set the URL, even though we don't subsequently
// read it from the environment.
env = "penumbra_sdk_NODE_PD_URL",
env = "PENUMBRA_NODE_PD_URL",
parse(try_from_str = Url::parse),
)]
grpc_url: Url,
Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pcli/src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Opt {
#[clap(subcommand)]
pub cmd: Command,
/// The home directory used to store configuration and data.
#[clap(long, default_value_t = default_home(), env = "penumbra_sdk_PCLI_HOME")]
#[clap(long, default_value_t = default_home(), env = "PENUMBRA_PCLI_HOME")]
pub home: Utf8PathBuf,
/// Override the GRPC URL that will be used to connect to a fullnode.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pcli/tests/network_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! These tests are marked with `#[ignore]`, but can be run with:
//! `cargo test --package pcli -- --ignored --test-threads 1`
//!
//! Tests against the network in the `penumbra_sdk_NODE_PD_URL` environment variable.
//! Tests against the network in the `PENUMBRA_NODE_PD_URL` environment variable.
//!
//! Tests assume that the initial state of the test account is after genesis,
//! where no tokens have been delegated, and the address with index 0
Expand Down
4 changes: 2 additions & 2 deletions crates/bin/pclientd/tests/network_integration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Basic integration testing of `pclientd` versus a target testnet.
//!
//! Tests against the network in the `penumbra_sdk_NODE_PD_URL` environment variable.
//! Tests against the network in the `PENUMBRA_NODE_PD_URL` environment variable.
//!
//! Tests assume that the initial state of the test account is after genesis,
//! where no tokens have been delegated, and the address with index 0
Expand Down Expand Up @@ -34,7 +34,7 @@ use penumbra_sdk_view::ViewClient;
fn generate_config() -> anyhow::Result<PclientdConfig> {
Ok(PclientdConfig {
full_viewing_key: test_keys::FULL_VIEWING_KEY.clone(),
grpc_url: std::env::var("penumbra_sdk_NODE_PD_URL")
grpc_url: std::env::var("PENUMBRA_NODE_PD_URL")
.unwrap_or_else(|_| "http://127.0.0.1:8080".to_owned())
.parse()?,
bind_addr: "127.0.0.1:8081".parse()?,
Expand Down
26 changes: 13 additions & 13 deletions crates/bin/pd/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ pub enum RootCommand {
Start {
/// The path used to store all `pd`-related data and configuration.
/// If unset, defaults to ~/.penumbra/network_data/node0/pd.
#[clap(long, env = "penumbra_sdk_PD_HOME", display_order = 100)]
#[clap(long, env = "PENUMBRA_PD_HOME", display_order = 100)]
home: Option<PathBuf>,
/// Bind the ABCI server to this socket.
///
/// The ABCI server is used by Tendermint to drive the application state.
#[clap(
short,
long,
env = "penumbra_sdk_PD_ABCI_BIND",
env = "PENUMBRA_PD_ABCI_BIND",
default_value = "127.0.0.1:26658",
display_order = 400
)]
Expand All @@ -41,7 +41,7 @@ pub enum RootCommand {
/// If `grpc_auto_https` is set, this defaults to `0.0.0.0:443` and uses HTTPS.
///
/// If `grpc_auto_https` is not set, this defaults to `127.0.0.1:8080` without HTTPS.
#[clap(short, long, env = "penumbra_sdk_PD_GRPC_BIND", display_order = 201)]
#[clap(short, long, env = "PENUMBRA_PD_GRPC_BIND", display_order = 201)]
grpc_bind: Option<SocketAddr>,
/// If set, serve gRPC using auto-managed HTTPS with this domain name.
///
Expand All @@ -64,7 +64,7 @@ pub enum RootCommand {
#[clap(
short,
long,
env = "penumbra_sdk_PD_METRICS_BIND",
env = "PENUMBRA_PD_METRICS_BIND",
default_value = "127.0.0.1:9000",
display_order = 300
)]
Expand All @@ -79,7 +79,7 @@ pub enum RootCommand {
#[clap(
short,
long,
env = "penumbra_sdk_PD_COMETBFT_PROXY_URL",
env = "PENUMBRA_PD_COMETBFT_PROXY_URL",
default_value = "http://127.0.0.1:26657",
display_order = 401,
// Support old arg name for a while, as we migrate Tendermint -> CometBFT.
Expand All @@ -104,7 +104,7 @@ pub enum RootCommand {
/// Export the storage state the full node.
Export {
/// The home directory of the full node.
#[clap(long, env = "penumbra_sdk_PD_HOME", display_order = 100)]
#[clap(long, env = "PENUMBRA_PD_HOME", display_order = 100)]
home: PathBuf,
/// The directory where the exported node state will be written.
#[clap(long, display_order = 200, alias = "export-path")]
Expand All @@ -123,7 +123,7 @@ pub enum RootCommand {
/// The home directory of the full node.
///
/// Migration is performed in-place on the home directory.
#[clap(long, env = "penumbra_sdk_PD_HOME", display_order = 100)]
#[clap(long, env = "PENUMBRA_PD_HOME", display_order = 100)]
home: Option<PathBuf>,
/// If set, also migrate the CometBFT state located in this home directory.
/// If both `--home` and `--comet-home` are unset, will attempt to migrate
Expand Down Expand Up @@ -218,17 +218,17 @@ pub enum NetworkCommand {
/// Requires a URL for the CometBFT RPC for the bootstrap node.
Join {
/// URL of the remote CometBFT RPC endpoint for bootstrapping connection.
#[clap(env = "penumbra_sdk_PD_JOIN_URL")]
#[clap(env = "PENUMBRA_PD_JOIN_URL")]
node: Url,
/// Optional URL of archived node state in .tar.gz format. The archive will be
/// downloaded and extracted locally, allowing the node to join a network at a block height
/// higher than 0. Supports loading the archive from a local file, if set with file scheme
/// explicitly, e.g. `file:///path/to/archive.tar.gz`.
#[clap(long, env = "penumbra_sdk_PD_ARCHIVE_URL")]
#[clap(long, env = "PENUMBRA_PD_ARCHIVE_URL")]
archive_url: Option<Url>,
/// Human-readable name to identify node on network
// Default: 'node-#'
#[clap(long, env = "penumbra_sdk_PD_TM_MONIKER")]
#[clap(long, env = "PENUMBRA_PD_TM_EXTERNAL_ADDR")]
moniker: Option<String>,
/// Public URL to advertise for this node's Tendermint P2P service.
/// Setting this option will instruct other nodes on the network to connect
Expand All @@ -238,19 +238,19 @@ pub enum NetworkCommand {
/// When generating Tendermint config, use this socket to bind the Tendermint RPC service.
#[clap(
long,
env = "penumbra_sdk_PD_TM_RPC_BIND",
env = "PENUMBRA_PD_TM_RPC_BIND",
default_value = "0.0.0.0:26657"
)]
tendermint_rpc_bind: SocketAddr,
/// When generating Tendermint config, use this socket to bind the Tendermint P2P service.
#[clap(
long,
env = "penumbra_sdk_PD_TM_P2P_BIND",
env = "PENUMBRA_PD_TM_P2P_BIND",
default_value = "0.0.0.0:26656"
)]
tendermint_p2p_bind: SocketAddr,
/// Leave the downloaded archive file on disk after extraction.
#[clap(long, env = "penumbra_sdk_PD_LEAVE_ARCHIVE", action)]
#[clap(long, env = "PENUMBRA_PD_LEAVE_ARCHIVE", action)]
leave_archive: bool,
},

Expand Down
6 changes: 3 additions & 3 deletions crates/bin/pd/tests/network_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use url::Url;
async fn check_cors_headers() -> anyhow::Result<()> {
let client = reqwest::Client::new();
let pd_url =
std::env::var("penumbra_sdk_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string());
std::env::var("PENUMBRA_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string());
let r = client.get(pd_url).send().await?;
assert_eq!(r.headers().get("access-control-allow-origin").unwrap(), "*");
assert_eq!(
Expand All @@ -39,7 +39,7 @@ async fn check_cors_headers() -> anyhow::Result<()> {
async fn check_minifront_http_ok() -> anyhow::Result<()> {
let client = reqwest::Client::new();
let pd_url =
std::env::var("penumbra_sdk_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string());
std::env::var("PENUMBRA_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string());
let r = client.get(pd_url).send().await?;
assert_eq!(r.status(), StatusCode::OK);
Ok(())
Expand All @@ -50,7 +50,7 @@ async fn check_minifront_http_ok() -> anyhow::Result<()> {
/// Validate that gRPC server reflection is enabled and working, by calling out
/// to `grpcurl` and verifying that it can view methods. See GH4392 for context.
async fn check_grpc_server_reflection() -> anyhow::Result<()> {
let pd_url: Url = std::env::var("penumbra_sdk_NODE_PD_URL")
let pd_url: Url = std::env::var("PENUMBRA_NODE_PD_URL")
.unwrap_or("http://localhost:8080".to_string())
.parse()
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions crates/core/app/src/action_handler/actions/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ impl AppActionHandler for ProposalSubmit {
/// hashes of two arbitrary strings.
static COMMUNITY_POOL_FULL_VIEWING_KEY: Lazy<FullViewingKey> = Lazy::new(|| {
// We start with two different personalization strings for the hash function:
let ak_personalization = b"penumbra_sdk_CP_ak";
let nk_personalization = b"penumbra_sdk_CP_nk";
let ak_personalization = b"Penumbra_CP_ak";
let nk_personalization = b"Penumbra_CP_nk";

// We pick two different arbitrary strings to hash:
let ak_hash_input =
Expand Down
2 changes: 1 addition & 1 deletion crates/core/app/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pub fn register_metrics() {
);
}

pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total";
pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total";
4 changes: 2 additions & 2 deletions crates/core/app/tests/app_blocktimes_increment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn mock_tendermint_block_times_correct() -> anyhow::Result<()> {
// This should use the default time callback of 5s
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.with_initial_timestamp(start_time)
.init_chain(consensus)
.await
Expand Down Expand Up @@ -67,7 +67,7 @@ async fn mock_tendermint_block_times_correct() -> anyhow::Result<()> {
// This should use the default time callback of 5s
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.with_initial_timestamp(start_time)
// Set a callback to add 13 seconds instead
.ts_callback(move |t| t.checked_add(block_duration).unwrap())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EPOCH_DURATION: u64 = 8;
async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> {
// Install a test logger, acquire some temporary storage, and start the test node.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Configure an AppState with slightly shorter epochs than usual.
let app_state = AppState::Content(
Expand All @@ -47,7 +47,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> {
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
}?;
Expand Down
4 changes: 2 additions & 2 deletions crates/core/app/tests/app_can_deposit_into_community_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod common;
async fn app_can_deposit_into_community_pool() -> anyhow::Result<()> {
// Install a test logger, and acquire some temporary storage.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Define our application state, and start the test node.
let mut test_node = {
Expand All @@ -39,7 +39,7 @@ async fn app_can_deposit_into_community_pool() -> anyhow::Result<()> {
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
.tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PROPOSAL_VOTING_BLOCKS: u64 = 3;
async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> {
// Install a test logger, and acquire some temporary storage.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Define a helper to get the current community pool balance.
let pool_balance = || async { storage.latest_snapshot().community_pool_balance().await };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PROPOSAL_VOTING_BLOCKS: u64 = 3;
async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> {
// Install a test logger, and acquire some temporary storage.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Define a helper to get the current community pool balance.
let pool_balance = || async { storage.latest_snapshot().community_pool_balance().await };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ mod common;
async fn app_can_spend_notes_and_detect_outputs() -> anyhow::Result<()> {
// Install a test logger, acquire some temporary storage, and start the test node.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;
let mut test_node = {
let app_state = AppState::Content(
genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()),
);
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
.tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const COUNT: usize = SWEEP_COUNT + 1;
async fn app_can_sweep_a_collection_of_small_notes() -> anyhow::Result<()> {
// Install a test logger, and acquire some temporary storage.
let guard = common::set_tracing_subscriber_with_env_filter("info".into());
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Instantiate a mock tendermint proxy, which we will connect to the test node.
let proxy = penumbra_sdk_mock_tendermint_proxy::TestNodeProxy::new::<Consensus>();
Expand Down
4 changes: 2 additions & 2 deletions crates/core/app/tests/app_can_undelegate_from_a_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const UNBONDING_DELAY: u64 = 4;
async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> {
// Install a test logger, acquire some temporary storage, and start the test node.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Helper function to get the latest block height.
let get_latest_height = || async {
Expand Down Expand Up @@ -73,7 +73,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> {
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
}?;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/app/tests/app_check_dex_vcb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::{ops::Deref, sync::Arc};
/// This bug was fixed in #4643.
async fn dex_vcb_tracks_multiswap() -> anyhow::Result<()> {
let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1776);
let storage = TempStorage::new_with_penumbra_sdk_prefixes()
let storage = TempStorage::new_with_penumbra_prefixes()
.await?
.apply_default_genesis()
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mod common;
async fn app_rejects_validator_definitions_with_invalid_auth_sigs() -> anyhow::Result<()> {
// Install a test logger, and acquire some temporary storage.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Start the test node.
let mut node = {
Expand All @@ -34,7 +34,7 @@ async fn app_rejects_validator_definitions_with_invalid_auth_sigs() -> anyhow::R
);
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
}?;
Expand Down
4 changes: 2 additions & 2 deletions crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async fn app_can_reproduce_tesnet_75_vcb_close() -> anyhow::Result<()> {

common::set_tracing_subscriber_with_env_filter(filter)
};
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;
let app_state = AppState::Content(
genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()),
);
Expand All @@ -75,7 +75,7 @@ async fn app_can_reproduce_tesnet_75_vcb_close() -> anyhow::Result<()> {
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
}?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod common;
async fn app_tracks_uptime_for_genesis_validator_missing_blocks() -> anyhow::Result<()> {
// Install a test logger, acquire some temporary storage, and start the test node.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Start the test node.
let mut node = {
Expand All @@ -29,7 +29,7 @@ async fn app_tracks_uptime_for_genesis_validator_missing_blocks() -> anyhow::Res
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
}?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod common;
async fn app_tracks_uptime_for_genesis_validator_missing_blocks() -> anyhow::Result<()> {
// Install a test logger, acquire some temporary storage, and start the test node.
let guard = common::set_tracing_subscriber();
let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?;
let storage = TempStorage::new_with_penumbra_prefixes().await?;

// Start the test node.
let mut node = {
Expand All @@ -29,7 +29,7 @@ async fn app_tracks_uptime_for_genesis_validator_missing_blocks() -> anyhow::Res
let consensus = Consensus::new(storage.as_ref().clone());
TestNode::builder()
.single_validator()
.with_penumbra_sdk_auto_app_state(app_state)?
.with_penumbra_auto_app_state(app_state)?
.init_chain(consensus)
.await
}?;
Expand Down
Loading

0 comments on commit 929450b

Please sign in to comment.