diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index 63bb65aa96..90f0111063 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -172,6 +172,13 @@ pub enum TestnetCommand { /// can be voted on. #[clap(long)] proposal_voting_blocks: Option, + /// The fixed gas price for all transactions on the network. + /// Described as "simple" because the single value will be reused + /// for all gas price types: block space, compact block space, verification, and execution. + /// The numeric value is one-thousandths of the staking token, + /// so `--gas-price-simple=1000` means all transactions will have a cost of 1penumbra. + #[clap(long)] + gas_price_simple: Option, /// Base hostname for a validator's p2p service. If multiple validators /// exist in the genesis, e.g. via `--validators-input-file`, then /// numeric suffixes are automatically added, e.g. "-0", "-1", etc. diff --git a/crates/bin/pd/src/main.rs b/crates/bin/pd/src/main.rs index 4fbfeaa91a..368d4066a3 100644 --- a/crates/bin/pd/src/main.rs +++ b/crates/bin/pd/src/main.rs @@ -305,6 +305,7 @@ async fn main() -> anyhow::Result<()> { allocations_input_file, validators_input_file, chain_id, + gas_price_simple, preserve_chain_id, external_addresses, proposal_voting_blocks, @@ -364,6 +365,7 @@ async fn main() -> anyhow::Result<()> { epoch_duration, unbonding_delay, proposal_voting_blocks, + gas_price_simple, )?; tracing::info!( n_validators = t.validators.len(), diff --git a/crates/bin/pd/src/testnet/generate.rs b/crates/bin/pd/src/testnet/generate.rs index d8585200f1..cc1d1a46e6 100644 --- a/crates/bin/pd/src/testnet/generate.rs +++ b/crates/bin/pd/src/testnet/generate.rs @@ -4,6 +4,7 @@ use crate::testnet::config::{get_testnet_dir, TestnetTendermintConfig, ValidatorKeys}; use anyhow::{Context, Result}; use penumbra_app::params::AppParameters; +use penumbra_fee::genesis::Content as FeeContent; use penumbra_governance::genesis::Content as GovernanceContent; use penumbra_keys::{keys::SpendKey, Address}; use penumbra_sct::genesis::Content as SctContent; @@ -69,6 +70,7 @@ impl TestnetConfig { epoch_duration: Option, unbonding_delay: Option, proposal_voting_blocks: Option, + gas_price_simple: Option, ) -> anyhow::Result { let external_addresses = external_addresses.unwrap_or_default(); @@ -98,6 +100,7 @@ impl TestnetConfig { epoch_duration, unbonding_delay, proposal_voting_blocks, + gas_price_simple, )?; let genesis = Self::make_genesis(app_state)?; @@ -186,6 +189,7 @@ impl TestnetConfig { epoch_duration: Option, unbonding_delay: Option, proposal_voting_blocks: Option, + gas_price_simple: Option, ) -> anyhow::Result { let default_gov_params = penumbra_governance::params::GovernanceParameters::default(); @@ -198,6 +202,8 @@ impl TestnetConfig { // Look up default app params, so we can fill in defaults. let default_app_params = AppParameters::default(); + let gas_price_simple = gas_price_simple.unwrap_or_default(); + let app_state = penumbra_app::genesis::Content { chain_id: chain_id.to_string(), stake_content: StakeContent { @@ -210,6 +216,16 @@ impl TestnetConfig { ..Default::default() }, }, + fee_content: FeeContent { + fee_params: penumbra_fee::params::FeeParameters { + fixed_gas_prices: penumbra_fee::GasPrices { + block_space_price: gas_price_simple, + compact_block_space_price: gas_price_simple, + verification_price: gas_price_simple, + execution_price: gas_price_simple, + }, + }, + }, governance_content: GovernanceContent { governance_params: gov_params, }, @@ -349,6 +365,7 @@ pub fn testnet_generate( validators_input_file: Option, allocations_input_file: Option, proposal_voting_blocks: Option, + gas_price_simple: Option, ) -> anyhow::Result<()> { tracing::info!(?chain_id, "Generating network config"); let t = TestnetConfig::generate( @@ -363,6 +380,7 @@ pub fn testnet_generate( epoch_duration, unbonding_delay, proposal_voting_blocks, + gas_price_simple, )?; tracing::info!( n_validators = t.validators.len(), @@ -668,6 +686,7 @@ mod tests { None, None, None, + None, )?; assert_eq!(testnet_config.name, "test-chain-1234"); assert_eq!(testnet_config.genesis.validators.len(), 0); @@ -697,6 +716,7 @@ mod tests { None, None, None, + None, )?; assert_eq!(testnet_config.name, "test-chain-4567"); assert_eq!(testnet_config.genesis.validators.len(), 0); diff --git a/deployments/scripts/smoke-test.sh b/deployments/scripts/smoke-test.sh index 4473218351..b00d60d2c1 100755 --- a/deployments/scripts/smoke-test.sh +++ b/deployments/scripts/smoke-test.sh @@ -48,7 +48,7 @@ cargo build --quiet --release --bin pd echo "Generating testnet config..." EPOCH_DURATION="${EPOCH_DURATION:-50}" UNBONDING_DELAY="${UNBONDING_DELAY:-50}" -cargo run --quiet --release --bin pd -- testnet generate --unbonding-delay "$UNBONDING_DELAY" --epoch-duration "$EPOCH_DURATION" --timeout-commit 500ms +cargo run --quiet --release --bin pd -- testnet generate --unbonding-delay "$UNBONDING_DELAY" --epoch-duration "$EPOCH_DURATION" --timeout-commit 500ms --gas-price-simple 5 echo "Starting CometBFT..." cometbft start --log_level=error --home "${HOME}/.penumbra/testnet_data/node0/cometbft" > "${SMOKE_LOG_DIR}/comet.log" &