From 2f335b3de76b6ca00c5b2bfce351dd815319c712 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 13:50:31 -0500 Subject: [PATCH 01/10] =?UTF-8?q?fix(compact-block):=20=F0=9F=9A=A9=20set?= =?UTF-8?q?=20component=20feature=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/core/component/compact-block/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/core/component/compact-block/Cargo.toml b/crates/core/component/compact-block/Cargo.toml index c0ba561e12..4d85309a46 100644 --- a/crates/core/component/compact-block/Cargo.toml +++ b/crates/core/component/compact-block/Cargo.toml @@ -11,6 +11,7 @@ component = [ "tonic", "tokio-stream", "tokio", + "penumbra-governance/component", ] # proving-keys = ["penumbra-proof-params/proving-keys"] default = ["std", "component"] From ec1996f3c39178d1b899635d71c7c6ba82043d21 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 10:30:02 -0500 Subject: [PATCH 02/10] =?UTF-8?q?tests(app):=20=E2=AD=90=20move=20app=20in?= =?UTF-8?q?tegration=20tests=20into=20`tests/`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nb: this is strict code motion. --- crates/core/app/Cargo.toml | 8 ++++++++ crates/core/app/src/lib.rs | 3 --- crates/core/app/src/tests/mod.rs | 2 -- crates/core/app/{src => }/tests/spend.rs | 2 +- crates/core/app/{src => }/tests/swap_and_swap_claim.rs | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 crates/core/app/src/tests/mod.rs rename crates/core/app/{src => }/tests/spend.rs (99%) rename crates/core/app/{src => }/tests/swap_and_swap_claim.rs (99%) diff --git a/crates/core/app/Cargo.toml b/crates/core/app/Cargo.toml index 941cc7156a..c5c788edff 100644 --- a/crates/core/app/Cargo.toml +++ b/crates/core/app/Cargo.toml @@ -78,3 +78,11 @@ ed25519-consensus = {workspace = true} rand_core = {workspace = true} rand_chacha = {workspace = true} tracing-subscriber = {workspace = true} + +# Enable the feature flags to get proving keys when running tests. +[dev-dependencies.penumbra-proof-params] +workspace = true +features = [ + "bundled-proving-keys", + "download-proving-keys", +] diff --git a/crates/core/app/src/lib.rs b/crates/core/app/src/lib.rs index 99356a39f2..2feefeddce 100644 --- a/crates/core/app/src/lib.rs +++ b/crates/core/app/src/lib.rs @@ -13,9 +13,6 @@ mod mock_client; mod penumbra_host_chain; mod temp_storage_ext; -#[cfg(test)] -mod tests; - pub use crate::{ action_handler::ActionHandler, app::StateWriteExt, community_pool_ext::CommunityPoolStateReadExt, metrics::register_metrics, diff --git a/crates/core/app/src/tests/mod.rs b/crates/core/app/src/tests/mod.rs deleted file mode 100644 index d8d87e8324..0000000000 --- a/crates/core/app/src/tests/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod spend; -mod swap_and_swap_claim; diff --git a/crates/core/app/src/tests/spend.rs b/crates/core/app/tests/spend.rs similarity index 99% rename from crates/core/app/src/tests/spend.rs rename to crates/core/app/tests/spend.rs index f9208b226d..a11a79be0b 100644 --- a/crates/core/app/src/tests/spend.rs +++ b/crates/core/app/tests/spend.rs @@ -1,6 +1,6 @@ use std::{ops::Deref, sync::Arc}; -use crate::{ActionHandler, MockClient, TempStorageExt}; +use penumbra_app::{ActionHandler, MockClient, TempStorageExt}; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler as _, Component}; use decaf377_rdsa::SigningKey; diff --git a/crates/core/app/src/tests/swap_and_swap_claim.rs b/crates/core/app/tests/swap_and_swap_claim.rs similarity index 99% rename from crates/core/app/src/tests/swap_and_swap_claim.rs rename to crates/core/app/tests/swap_and_swap_claim.rs index f653449e1f..f308c9a9d9 100644 --- a/crates/core/app/src/tests/swap_and_swap_claim.rs +++ b/crates/core/app/tests/swap_and_swap_claim.rs @@ -6,7 +6,7 @@ use penumbra_sct::{ }; use std::{ops::Deref, sync::Arc}; -use crate::{MockClient, TempStorageExt}; +use penumbra_app::{MockClient, TempStorageExt}; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler, Component}; use decaf377::Fq; From 966e2937b7fe0f63f3d63c44532ac3dc3006fb83 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 11:05:28 -0500 Subject: [PATCH 03/10] =?UTF-8?q?tests(app):=20=E2=88=85=20add=20penumbra-?= =?UTF-8?q?mock-consensus=20scaffold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this introduces a small, failing test case that attempts to instantiate an app with a mock consensus engine. additional logic and other interfaces will be fleshed out in forthcoming commits. --- Cargo.lock | 5 ++ Cargo.toml | 2 + crates/core/app/Cargo.toml | 1 + crates/core/app/tests/mock_consensus.rs | 18 ++++++++ crates/core/app/tests/spend.rs | 2 +- crates/core/app/tests/swap_and_swap_claim.rs | 2 +- crates/test/mock-consensus/Cargo.toml | 10 ++++ crates/test/mock-consensus/src/lib.rs | 48 ++++++++++++++++++++ 8 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 crates/core/app/tests/mock_consensus.rs create mode 100644 crates/test/mock-consensus/Cargo.toml create mode 100644 crates/test/mock-consensus/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 0fda3c17b9..e1499b41eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4735,6 +4735,7 @@ dependencies = [ "penumbra-governance", "penumbra-ibc", "penumbra-keys", + "penumbra-mock-consensus", "penumbra-num", "penumbra-proof-params", "penumbra-proto", @@ -5252,6 +5253,10 @@ dependencies = [ "url", ] +[[package]] +name = "penumbra-mock-consensus" +version = "0.65.0" + [[package]] name = "penumbra-num" version = "0.66.0" diff --git a/Cargo.toml b/Cargo.toml index b003121108..2f8b28f232 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ members = [ "crates/bin/pclientd", "crates/bin/pcli", "crates/wasm", + "crates/test/mock-consensus", "crates/test/tct-property-test", "crates/misc/measure", "crates/misc/tct-visualize", @@ -173,6 +174,7 @@ penumbra-funding = {default-features = false, path = "crates/core/component/fund penumbra-governance = {default-features = false, path = "crates/core/component/governance"} penumbra-ibc = {default-features = false, path = "crates/core/component/ibc"} penumbra-keys = {default-features = false, path = "crates/core/keys"} +penumbra-mock-consensus = {path = "crates/test/mock-consensus"} penumbra-num = {default-features = false, path = "crates/core/num"} penumbra-proof-params = {default-features = false, path = "crates/crypto/proof-params"} penumbra-proof-setup = {path = "crates/crypto/proof-setup"} diff --git a/crates/core/app/Cargo.toml b/crates/core/app/Cargo.toml index c5c788edff..db524f4818 100644 --- a/crates/core/app/Cargo.toml +++ b/crates/core/app/Cargo.toml @@ -75,6 +75,7 @@ ibc-proto = {workspace = true, default-features = false, features = [ [dev-dependencies] ed25519-consensus = {workspace = true} +penumbra-mock-consensus = {workspace = true} rand_core = {workspace = true} rand_chacha = {workspace = true} tracing-subscriber = {workspace = true} diff --git a/crates/core/app/tests/mock_consensus.rs b/crates/core/app/tests/mock_consensus.rs new file mode 100644 index 0000000000..7ea2475bdb --- /dev/null +++ b/crates/core/app/tests/mock_consensus.rs @@ -0,0 +1,18 @@ +//! App integration tests using mock consensus. +// +// Note: these should eventually replace the existing test cases. mock consensus tests are placed +// here while the engine is still in development. See #3588. + +use {cnidarium::TempStorage, penumbra_app::app::App, penumbra_mock_consensus::TestNode}; + +#[tokio::test] +#[should_panic] +async fn an_app_with_mock_consensus_can_be_instantiated() { + let storage = TempStorage::new().await.unwrap(); + let app = App::new(storage.latest_snapshot()); + let _engine = TestNode::<()>::builder() + .single_validator() + .app_state(() /*genesis::AppState::default()*/) + .init_chain(app) + .await; +} diff --git a/crates/core/app/tests/spend.rs b/crates/core/app/tests/spend.rs index a11a79be0b..e82a3a7b7a 100644 --- a/crates/core/app/tests/spend.rs +++ b/crates/core/app/tests/spend.rs @@ -1,9 +1,9 @@ use std::{ops::Deref, sync::Arc}; -use penumbra_app::{ActionHandler, MockClient, TempStorageExt}; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler as _, Component}; use decaf377_rdsa::SigningKey; +use penumbra_app::{ActionHandler, MockClient, TempStorageExt}; use penumbra_asset::Value; use penumbra_compact_block::component::CompactBlockManager; use penumbra_keys::{test_keys, PayloadKey}; diff --git a/crates/core/app/tests/swap_and_swap_claim.rs b/crates/core/app/tests/swap_and_swap_claim.rs index f308c9a9d9..3438237659 100644 --- a/crates/core/app/tests/swap_and_swap_claim.rs +++ b/crates/core/app/tests/swap_and_swap_claim.rs @@ -6,10 +6,10 @@ use penumbra_sct::{ }; use std::{ops::Deref, sync::Arc}; -use penumbra_app::{MockClient, TempStorageExt}; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler, Component}; use decaf377::Fq; +use penumbra_app::{MockClient, TempStorageExt}; use penumbra_asset::asset; use penumbra_fee::Fee; use penumbra_keys::{test_keys, Address}; diff --git a/crates/test/mock-consensus/Cargo.toml b/crates/test/mock-consensus/Cargo.toml new file mode 100644 index 0000000000..52714cbcf7 --- /dev/null +++ b/crates/test/mock-consensus/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "penumbra-mock-consensus" +authors.workspace = true +edition.workspace = true +version.workspace = true +repository.workspace = true +homepage.workspace = true +license.workspace = true + +[dependencies] diff --git a/crates/test/mock-consensus/src/lib.rs b/crates/test/mock-consensus/src/lib.rs new file mode 100644 index 0000000000..5d5d3de6aa --- /dev/null +++ b/crates/test/mock-consensus/src/lib.rs @@ -0,0 +1,48 @@ +pub struct TestNode { + _app: A, + _last_app_hash: Vec, +} + +pub mod block { + use crate::TestNode; + + struct _Builder<'e, C> { + engine: &'e mut TestNode, + } +} + +pub struct Builder; + +impl TestNode { + pub fn builder() -> Builder { + Builder + } +} + +impl Builder { + // TODO: add other convenience methods for validator config? + + /// Creates a single validator with a randomly generated key. + pub fn single_validator(self) -> Self { + todo!(); + } + + pub fn app_state(self, _: ()) -> Self { + todo!() + } + + pub fn app_state_bytes(self, _: Vec) -> Self { + todo!() + } + + // this should take the `consensus` thing from pd/main.rs + pub async fn init_chain(self, _: A) -> TestNode { + // https://rustdoc.penumbra.zone/main/tower_abci/v037/struct.ServerBuilder.html + // Engine should be parameterized by the C here + // init_chain should be parameterized by the C here + // + // C: Service + Send + Clone + 'static, + // C::Future: Send + 'static, + todo!() + } +} From 54938078d56cedfc8b09c553a30364506d90c283 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 13:07:53 -0500 Subject: [PATCH 04/10] =?UTF-8?q?refactor(genesis):=20=F0=9F=94=A6=20hoist?= =?UTF-8?q?=20genesis=20state=20out=20of=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 20 ++++++++++++++ Cargo.toml | 3 ++- crates/bin/pd/Cargo.toml | 1 + crates/bin/pd/src/consensus.rs | 10 +++---- crates/bin/pd/src/migrate.rs | 4 +-- crates/bin/pd/src/testnet/config.rs | 2 +- crates/bin/pd/src/testnet/generate.rs | 26 ++++++++++--------- crates/core/app/Cargo.toml | 1 + crates/core/app/src/app/mod.rs | 9 ++++--- crates/core/app/src/genesis.rs | 4 --- crates/core/app/src/lib.rs | 1 - crates/core/app/src/temp_storage_ext.rs | 6 ++--- crates/core/genesis/Cargo.toml | 22 ++++++++++++++++ .../app_state.rs => genesis/src/lib.rs} | 0 deployments/scripts/rust-docs | 1 + 15 files changed, 77 insertions(+), 33 deletions(-) delete mode 100644 crates/core/app/src/genesis.rs create mode 100644 crates/core/genesis/Cargo.toml rename crates/core/{app/src/genesis/app_state.rs => genesis/src/lib.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index e1499b41eb..9b46ed637e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4609,6 +4609,7 @@ dependencies = [ "penumbra-custody", "penumbra-dex", "penumbra-fee", + "penumbra-genesis", "penumbra-governance", "penumbra-ibc", "penumbra-keys", @@ -4732,6 +4733,7 @@ dependencies = [ "penumbra-distributions", "penumbra-fee", "penumbra-funding", + "penumbra-genesis", "penumbra-governance", "penumbra-ibc", "penumbra-keys", @@ -5099,6 +5101,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "penumbra-genesis" +version = "0.65.0" +dependencies = [ + "anyhow", + "penumbra-community-pool", + "penumbra-distributions", + "penumbra-fee", + "penumbra-funding", + "penumbra-governance", + "penumbra-ibc", + "penumbra-proto", + "penumbra-sct", + "penumbra-shielded-pool", + "penumbra-stake", + "serde", +] + [[package]] name = "penumbra-governance" version = "0.66.0" diff --git a/Cargo.toml b/Cargo.toml index 2f8b28f232..76a9a574a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ members = [ "crates/misc/measure", "crates/misc/tct-visualize", "crates/bench", - "tools/summonerd", "crates/core/component/funding", + "tools/summonerd", "crates/core/component/funding", "crates/core/genesis", ] # Optimize for small binaries in just the wasm crate. @@ -172,6 +172,7 @@ penumbra-distributions = {default-features = false, path = "crates/core/componen penumbra-fee = {default-features = false, path = "crates/core/component/fee"} penumbra-funding = {default-features = false, path = "crates/core/component/funding"} penumbra-governance = {default-features = false, path = "crates/core/component/governance"} +penumbra-genesis = { path = "crates/core/genesis" } penumbra-ibc = {default-features = false, path = "crates/core/component/ibc"} penumbra-keys = {default-features = false, path = "crates/core/keys"} penumbra-mock-consensus = {path = "crates/test/mock-consensus"} diff --git a/crates/bin/pd/Cargo.toml b/crates/bin/pd/Cargo.toml index de91c57a90..069008e70a 100644 --- a/crates/bin/pd/Cargo.toml +++ b/crates/bin/pd/Cargo.toml @@ -55,6 +55,7 @@ penumbra-custody = {workspace = true} penumbra-tower-trace = { path = "../../util/tower-trace" } penumbra-tendermint-proxy = { path = "../../util/tendermint-proxy" } penumbra-auto-https = { path = "../../util/auto-https" } +penumbra-genesis = {workspace = true} decaf377 = {workspace = true, features = ["parallel"], default-features = true} decaf377-rdsa = {workspace = true} tower-abci = "0.11" diff --git a/crates/bin/pd/src/consensus.rs b/crates/bin/pd/src/consensus.rs index 15df818ff0..eea13c43af 100644 --- a/crates/bin/pd/src/consensus.rs +++ b/crates/bin/pd/src/consensus.rs @@ -1,7 +1,6 @@ use anyhow::Result; use cnidarium::Storage; -use penumbra_app::genesis; use tendermint::abci::Event; use tendermint::v0_37::abci::{ request, response, ConsensusRequest as Request, ConsensusResponse as Response, @@ -104,8 +103,9 @@ impl Consensus { /// the database. async fn init_chain(&mut self, init_chain: request::InitChain) -> Result { // Note that errors cannot be handled in InitChain, the application must crash. - let app_state: genesis::AppState = serde_json::from_slice(&init_chain.app_state_bytes) - .expect("can parse app_state in genesis file"); + let app_state: penumbra_genesis::AppState = + serde_json::from_slice(&init_chain.app_state_bytes) + .expect("can parse app_state in genesis file"); self.app.init_chain(&app_state).await; @@ -118,13 +118,13 @@ impl Consensus { let validators = self.app.tendermint_validator_updates(); let app_hash = match &app_state { - genesis::AppState::Checkpoint(h) => { + penumbra_genesis::AppState::Checkpoint(h) => { tracing::info!(?h, "genesis state is a checkpoint"); // If we're starting from a checkpoint, we just need to forward the app hash // back to CometBFT. self.storage.latest_snapshot().root_hash().await? } - genesis::AppState::Content(_) => { + penumbra_genesis::AppState::Content(_) => { tracing::info!("genesis state is a full configuration"); // Check that we haven't got a duplicated InitChain message for some reason: if self.storage.latest_version() != u64::MAX { diff --git a/crates/bin/pd/src/migrate.rs b/crates/bin/pd/src/migrate.rs index 724599cf27..23055c13d0 100644 --- a/crates/bin/pd/src/migrate.rs +++ b/crates/bin/pd/src/migrate.rs @@ -8,7 +8,7 @@ use std::path::PathBuf; use cnidarium::{StateDelta, StateWrite, Storage}; use jmt::RootHash; -use penumbra_app::{genesis, SUBSTORE_PREFIXES}; +use penumbra_app::SUBSTORE_PREFIXES; use penumbra_sct::component::clock::{EpochManager, EpochRead}; use penumbra_stake::{ component::validator_handler::ValidatorDataRead, genesis::Content as StakeContent, @@ -66,7 +66,7 @@ impl Migration { /* ---------- generate genesis ------------ */ let validators = migrated_state.validator_definitions().await?; - let app_state = genesis::Content { + let app_state = penumbra_genesis::Content { stake_content: StakeContent { // TODO(erwan): should remove this. validators: validators.into_iter().map(Into::into).collect(), diff --git a/crates/bin/pd/src/testnet/config.rs b/crates/bin/pd/src/testnet/config.rs index 5f6d534e33..ead16efc52 100644 --- a/crates/bin/pd/src/testnet/config.rs +++ b/crates/bin/pd/src/testnet/config.rs @@ -1,8 +1,8 @@ use anyhow::Context; use decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}; use directories::UserDirs; -use penumbra_app::genesis::AppState; use penumbra_custody::soft_kms::Config as SoftKmsConfig; +use penumbra_genesis::AppState; use penumbra_keys::keys::{SpendKey, SpendKeyBytes}; use rand::Rng; use rand_core::OsRng; diff --git a/crates/bin/pd/src/testnet/generate.rs b/crates/bin/pd/src/testnet/generate.rs index f7cf5b4bef..3bb15f1bb2 100644 --- a/crates/bin/pd/src/testnet/generate.rs +++ b/crates/bin/pd/src/testnet/generate.rs @@ -3,7 +3,7 @@ //! for Penumbra. use crate::testnet::config::{get_testnet_dir, TestnetTendermintConfig, ValidatorKeys}; use anyhow::{Context, Result}; -use penumbra_app::{genesis, params::AppParameters}; +use penumbra_app::params::AppParameters; use penumbra_governance::genesis::Content as GovernanceContent; use penumbra_keys::{keys::SpendKey, Address}; use penumbra_sct::genesis::Content as SctContent; @@ -35,7 +35,7 @@ pub struct TestnetConfig { /// The name of the network pub name: String, /// The Tendermint genesis for initial chain state. - pub genesis: Genesis, + pub genesis: Genesis, /// Path to local directory where config files will be written to pub testnet_dir: PathBuf, /// Set of validators at genesis. Uses the convenient wrapper type @@ -186,7 +186,7 @@ impl TestnetConfig { epoch_duration: Option, unbonding_epochs: Option, proposal_voting_blocks: Option, - ) -> anyhow::Result { + ) -> anyhow::Result { let default_gov_params = penumbra_governance::params::GovernanceParameters::default(); let gov_params = penumbra_governance::params::GovernanceParameters { @@ -198,7 +198,7 @@ impl TestnetConfig { // Look up default app params, so we can fill in defaults. let default_app_params = AppParameters::default(); - let app_state = genesis::Content { + let app_state = penumbra_genesis::Content { chain_id: chain_id.to_string(), stake_content: StakeContent { validators: validators.into_iter().map(Into::into).collect(), @@ -230,8 +230,8 @@ impl TestnetConfig { /// Build Tendermint genesis data, based on Penumbra initial application state. pub(crate) fn make_genesis( - app_state: genesis::Content, - ) -> anyhow::Result> { + app_state: penumbra_genesis::Content, + ) -> anyhow::Result> { // Use now as genesis time let genesis_time = Time::from_unix_timestamp( SystemTime::now() @@ -272,7 +272,7 @@ impl TestnetConfig { }, // always empty in genesis json app_hash: tendermint::AppHash::default(), - app_state: genesis::AppState::Content(app_state), + app_state: penumbra_genesis::AppState::Content(app_state), // Set empty validator set for Tendermint config, which falls back to reading // validators from the AppState, via ResponseInitChain: // https://docs.tendermint.com/v0.32/tendermint-core/using-tendermint.html @@ -282,12 +282,12 @@ impl TestnetConfig { } pub(crate) fn make_checkpoint( - genesis: Genesis, + genesis: Genesis, checkpoint: Option>, - ) -> Genesis { + ) -> Genesis { match checkpoint { Some(checkpoint) => Genesis { - app_state: genesis::AppState::Checkpoint(checkpoint), + app_state: penumbra_genesis::AppState::Checkpoint(checkpoint), ..genesis }, None => genesis, @@ -672,7 +672,8 @@ mod tests { assert_eq!(testnet_config.name, "test-chain-1234"); assert_eq!(testnet_config.genesis.validators.len(), 0); // No external address template was given, so only 1 validator will be present. - let genesis::AppState::Content(app_state) = testnet_config.genesis.app_state else { + let penumbra_genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + else { unimplemented!("TODO: support checkpointed app state") }; assert_eq!(app_state.stake_content.validators.len(), 1); @@ -699,7 +700,8 @@ mod tests { )?; assert_eq!(testnet_config.name, "test-chain-4567"); assert_eq!(testnet_config.genesis.validators.len(), 0); - let genesis::AppState::Content(app_state) = testnet_config.genesis.app_state else { + let penumbra_genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + else { unimplemented!("TODO: support checkpointed app state") }; assert_eq!(app_state.stake_content.validators.len(), 2); diff --git a/crates/core/app/Cargo.toml b/crates/core/app/Cargo.toml index db524f4818..998e52b359 100644 --- a/crates/core/app/Cargo.toml +++ b/crates/core/app/Cargo.toml @@ -36,6 +36,7 @@ penumbra-ibc = {workspace = true, features = ["component"], default-features = t penumbra-distributions = {workspace = true, default-features = true} penumbra-compact-block = {workspace = true, default-features = true} penumbra-transaction = {workspace = true, features = ["parallel"], default-features = true} +penumbra-genesis = {workspace = true} decaf377 = {workspace = true, default-features = true} decaf377-rdsa = {workspace = true} jmt = {workspace = true} diff --git a/crates/core/app/src/app/mod.rs b/crates/core/app/src/app/mod.rs index f3a6463563..f954fea57f 100644 --- a/crates/core/app/src/app/mod.rs +++ b/crates/core/app/src/app/mod.rs @@ -14,6 +14,7 @@ use penumbra_distributions::component::{Distributions, StateReadExt as _, StateW use penumbra_fee::component::{Fee, StateReadExt as _, StateWriteExt as _}; use penumbra_funding::component::Funding; use penumbra_funding::component::{StateReadExt as _, StateWriteExt as _}; +use penumbra_genesis::AppState; use penumbra_governance::component::{Governance, StateReadExt as _}; use penumbra_governance::StateWriteExt as _; use penumbra_ibc::component::{Ibc, StateWriteExt as _}; @@ -38,7 +39,7 @@ use tracing::Instrument; use crate::action_handler::ActionHandler; use crate::params::AppParameters; -use crate::{genesis, CommunityPoolStateReadExt, PenumbraHost}; +use crate::{CommunityPoolStateReadExt, PenumbraHost}; pub mod state_key; @@ -94,13 +95,13 @@ impl App { events } - pub async fn init_chain(&mut self, app_state: &genesis::AppState) { + pub async fn init_chain(&mut self, app_state: &AppState) { let mut state_tx = self .state .try_begin_transaction() .expect("state Arc should not be referenced elsewhere"); match app_state { - genesis::AppState::Content(genesis) => { + AppState::Content(genesis) => { state_tx.put_chain_id(genesis.chain_id.clone()); Sct::init_chain(&mut state_tx, Some(&genesis.sct_content)).await; ShieldedPool::init_chain(&mut state_tx, Some(&genesis.shielded_pool_content)).await; @@ -127,7 +128,7 @@ impl App { .await .expect("must be able to finish compact block"); } - genesis::AppState::Checkpoint(_) => { + AppState::Checkpoint(_) => { ShieldedPool::init_chain(&mut state_tx, None).await; Distributions::init_chain(&mut state_tx, None).await; Staking::init_chain(&mut state_tx, None).await; diff --git a/crates/core/app/src/genesis.rs b/crates/core/app/src/genesis.rs deleted file mode 100644 index fec0c2f6c9..0000000000 --- a/crates/core/app/src/genesis.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod app_state; - -pub use app_state::AppState; -pub use app_state::Content; diff --git a/crates/core/app/src/lib.rs b/crates/core/app/src/lib.rs index 2feefeddce..5621e163fb 100644 --- a/crates/core/app/src/lib.rs +++ b/crates/core/app/src/lib.rs @@ -2,7 +2,6 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod app; -pub mod genesis; pub mod metrics; pub mod params; pub mod rpc; diff --git a/crates/core/app/src/temp_storage_ext.rs b/crates/core/app/src/temp_storage_ext.rs index 882f9fa7d3..20bf4f8655 100644 --- a/crates/core/app/src/temp_storage_ext.rs +++ b/crates/core/app/src/temp_storage_ext.rs @@ -1,20 +1,20 @@ use std::ops::Deref; -use crate::genesis; use async_trait::async_trait; use cnidarium::TempStorage; +use penumbra_genesis::AppState; use crate::app::App; #[async_trait] pub trait TempStorageExt: Sized { - async fn apply_genesis(self, genesis: genesis::AppState) -> anyhow::Result; + async fn apply_genesis(self, genesis: AppState) -> anyhow::Result; async fn apply_default_genesis(self) -> anyhow::Result; } #[async_trait] impl TempStorageExt for TempStorage { - async fn apply_genesis(self, genesis: genesis::AppState) -> anyhow::Result { + async fn apply_genesis(self, genesis: AppState) -> anyhow::Result { // Check that we haven't already applied a genesis state: if self.latest_version() != u64::MAX { anyhow::bail!("database already initialized"); diff --git a/crates/core/genesis/Cargo.toml b/crates/core/genesis/Cargo.toml new file mode 100644 index 0000000000..95944c99ef --- /dev/null +++ b/crates/core/genesis/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "penumbra-genesis" +authors.workspace = true +edition.workspace = true +version.workspace = true +repository.workspace = true +homepage.workspace = true +license.workspace = true + +[dependencies] +anyhow = { workspace = true } +penumbra-community-pool = { workspace = true } +penumbra-distributions = { workspace = true } +penumbra-fee = { workspace = true } +penumbra-funding = { workspace = true } +penumbra-governance = { workspace = true } +penumbra-ibc = { workspace = true } +penumbra-proto = { workspace = true } +penumbra-sct = { workspace = true } +penumbra-shielded-pool = { workspace = true } +penumbra-stake = { workspace = true } +serde = { workspace = true, features = ["derive"] } diff --git a/crates/core/app/src/genesis/app_state.rs b/crates/core/genesis/src/lib.rs similarity index 100% rename from crates/core/app/src/genesis/app_state.rs rename to crates/core/genesis/src/lib.rs diff --git a/deployments/scripts/rust-docs b/deployments/scripts/rust-docs index c31a56964c..8505027898 100755 --- a/deployments/scripts/rust-docs +++ b/deployments/scripts/rust-docs @@ -41,6 +41,7 @@ cargo +nightly-2024-02-01 doc --no-deps \ -p penumbra-community-pool \ -p penumbra-dex \ -p penumbra-distributions \ + -p penumbra-genesis \ -p penumbra-governance \ -p penumbra-ibc \ -p penumbra-keys \ From a3bb20cde546af8f19a111ff74c2ab3a84044a53 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 13:19:39 -0500 Subject: [PATCH 05/10] =?UTF-8?q?refactor(app):=20=F0=9F=93=B1=20penumbra-?= =?UTF-8?q?mock-client=20test=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 15 ++++++++++++++ Cargo.toml | 2 ++ crates/core/app/Cargo.toml | 1 + crates/core/app/src/lib.rs | 3 +-- crates/core/app/tests/spend.rs | 3 ++- crates/core/app/tests/swap_and_swap_claim.rs | 3 ++- crates/test/mock-client/Cargo.toml | 20 +++++++++++++++++++ .../mock-client/src/lib.rs} | 3 +-- 8 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 crates/test/mock-client/Cargo.toml rename crates/{core/app/src/mock_client.rs => test/mock-client/src/lib.rs} (99%) diff --git a/Cargo.lock b/Cargo.lock index 9b46ed637e..be80982224 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4737,6 +4737,7 @@ dependencies = [ "penumbra-governance", "penumbra-ibc", "penumbra-keys", + "penumbra-mock-client", "penumbra-mock-consensus", "penumbra-num", "penumbra-proof-params", @@ -5273,6 +5274,20 @@ dependencies = [ "url", ] +[[package]] +name = "penumbra-mock-client" +version = "0.65.0" +dependencies = [ + "anyhow", + "cnidarium", + "penumbra-compact-block", + "penumbra-dex", + "penumbra-keys", + "penumbra-sct", + "penumbra-shielded-pool", + "penumbra-tct", +] + [[package]] name = "penumbra-mock-consensus" version = "0.65.0" diff --git a/Cargo.toml b/Cargo.toml index 76a9a574a7..b95c65caff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ members = [ "crates/bin/pclientd", "crates/bin/pcli", "crates/wasm", + "crates/test/mock-client", "crates/test/mock-consensus", "crates/test/tct-property-test", "crates/misc/measure", @@ -175,6 +176,7 @@ penumbra-governance = {default-features = false, path = "crates/core/component/g penumbra-genesis = { path = "crates/core/genesis" } penumbra-ibc = {default-features = false, path = "crates/core/component/ibc"} penumbra-keys = {default-features = false, path = "crates/core/keys"} +penumbra-mock-client = {path = "crates/test/mock-client"} penumbra-mock-consensus = {path = "crates/test/mock-consensus"} penumbra-num = {default-features = false, path = "crates/core/num"} penumbra-proof-params = {default-features = false, path = "crates/crypto/proof-params"} diff --git a/crates/core/app/Cargo.toml b/crates/core/app/Cargo.toml index 998e52b359..709c9d1fc1 100644 --- a/crates/core/app/Cargo.toml +++ b/crates/core/app/Cargo.toml @@ -77,6 +77,7 @@ ibc-proto = {workspace = true, default-features = false, features = [ [dev-dependencies] ed25519-consensus = {workspace = true} penumbra-mock-consensus = {workspace = true} +penumbra-mock-client = {workspace = true} rand_core = {workspace = true} rand_chacha = {workspace = true} tracing-subscriber = {workspace = true} diff --git a/crates/core/app/src/lib.rs b/crates/core/app/src/lib.rs index 5621e163fb..4f370a945a 100644 --- a/crates/core/app/src/lib.rs +++ b/crates/core/app/src/lib.rs @@ -8,14 +8,13 @@ pub mod rpc; mod action_handler; mod community_pool_ext; -mod mock_client; mod penumbra_host_chain; mod temp_storage_ext; pub use crate::{ action_handler::ActionHandler, app::StateWriteExt, community_pool_ext::CommunityPoolStateReadExt, metrics::register_metrics, - mock_client::MockClient, penumbra_host_chain::PenumbraHost, temp_storage_ext::TempStorageExt, + penumbra_host_chain::PenumbraHost, temp_storage_ext::TempStorageExt, }; use once_cell::sync::Lazy; diff --git a/crates/core/app/tests/spend.rs b/crates/core/app/tests/spend.rs index e82a3a7b7a..02c79fb3a0 100644 --- a/crates/core/app/tests/spend.rs +++ b/crates/core/app/tests/spend.rs @@ -3,10 +3,11 @@ use std::{ops::Deref, sync::Arc}; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler as _, Component}; use decaf377_rdsa::SigningKey; -use penumbra_app::{ActionHandler, MockClient, TempStorageExt}; +use penumbra_app::{ActionHandler, TempStorageExt}; use penumbra_asset::Value; use penumbra_compact_block::component::CompactBlockManager; use penumbra_keys::{test_keys, PayloadKey}; +use penumbra_mock_client::MockClient; use penumbra_num::Amount; use penumbra_sct::{ component::{clock::EpochManager, source::SourceContext}, diff --git a/crates/core/app/tests/swap_and_swap_claim.rs b/crates/core/app/tests/swap_and_swap_claim.rs index 3438237659..412f65ab31 100644 --- a/crates/core/app/tests/swap_and_swap_claim.rs +++ b/crates/core/app/tests/swap_and_swap_claim.rs @@ -9,10 +9,11 @@ use std::{ops::Deref, sync::Arc}; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler, Component}; use decaf377::Fq; -use penumbra_app::{MockClient, TempStorageExt}; +use penumbra_app::TempStorageExt; use penumbra_asset::asset; use penumbra_fee::Fee; use penumbra_keys::{test_keys, Address}; +use penumbra_mock_client::MockClient; use penumbra_num::Amount; use penumbra_shielded_pool::component::ShieldedPool; use penumbra_transaction::Transaction; diff --git a/crates/test/mock-client/Cargo.toml b/crates/test/mock-client/Cargo.toml new file mode 100644 index 0000000000..a8ecc75839 --- /dev/null +++ b/crates/test/mock-client/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "penumbra-mock-client" +authors.workspace = true +edition.workspace = true +version.workspace = true +repository.workspace = true +homepage.workspace = true +license.workspace = true + +[dependencies] +anyhow = {workspace = true} +cnidarium = {workspace = true, default-features = true} +penumbra-compact-block = {workspace = true, default-features = true} +penumbra-dex = {workspace = true, default-features = true} +penumbra-keys = {workspace = true, default-features = true} +penumbra-sct = {workspace = true, default-features = true} +penumbra-shielded-pool = {workspace = true, features = [ + "component", +], default-features = true} +penumbra-tct = {workspace = true, default-features = true} diff --git a/crates/core/app/src/mock_client.rs b/crates/test/mock-client/src/lib.rs similarity index 99% rename from crates/core/app/src/mock_client.rs rename to crates/test/mock-client/src/lib.rs index 761a431f31..abb616abb3 100644 --- a/crates/core/app/src/mock_client.rs +++ b/crates/test/mock-client/src/lib.rs @@ -1,5 +1,3 @@ -use std::collections::BTreeMap; - use cnidarium::StateRead; use penumbra_compact_block::{component::StateReadExt as _, CompactBlock, StatePayload}; use penumbra_dex::swap::SwapPlaintext; @@ -7,6 +5,7 @@ use penumbra_keys::FullViewingKey; use penumbra_sct::component::tree::SctRead; use penumbra_shielded_pool::{note, Note}; use penumbra_tct as tct; +use std::collections::BTreeMap; /// A bare-bones mock client for use exercising the state machine. pub struct MockClient { From d89552a3bb45b5ee80b30e9781822b3510cb451c Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 13:59:27 -0500 Subject: [PATCH 06/10] =?UTF-8?q?refactor(app):=20=F0=9F=A7=AA=20pull=20`T?= =?UTF-8?q?empStorageExt`=20into=20test=20suite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/core/app/src/lib.rs | 3 +- .../common/mod.rs} | 6 ++-- crates/core/app/tests/spend.rs | 6 ++-- crates/core/app/tests/swap_and_swap_claim.rs | 30 +++++++++---------- 4 files changed, 22 insertions(+), 23 deletions(-) rename crates/core/app/{src/temp_storage_ext.rs => tests/common/mod.rs} (97%) diff --git a/crates/core/app/src/lib.rs b/crates/core/app/src/lib.rs index 4f370a945a..0dea1ea09c 100644 --- a/crates/core/app/src/lib.rs +++ b/crates/core/app/src/lib.rs @@ -9,12 +9,11 @@ pub mod rpc; mod action_handler; mod community_pool_ext; mod penumbra_host_chain; -mod temp_storage_ext; pub use crate::{ action_handler::ActionHandler, app::StateWriteExt, community_pool_ext::CommunityPoolStateReadExt, metrics::register_metrics, - penumbra_host_chain::PenumbraHost, temp_storage_ext::TempStorageExt, + penumbra_host_chain::PenumbraHost, }; use once_cell::sync::Lazy; diff --git a/crates/core/app/src/temp_storage_ext.rs b/crates/core/app/tests/common/mod.rs similarity index 97% rename from crates/core/app/src/temp_storage_ext.rs rename to crates/core/app/tests/common/mod.rs index 20bf4f8655..74df55887a 100644 --- a/crates/core/app/src/temp_storage_ext.rs +++ b/crates/core/app/tests/common/mod.rs @@ -1,10 +1,8 @@ -use std::ops::Deref; - use async_trait::async_trait; use cnidarium::TempStorage; +use penumbra_app::app::App; use penumbra_genesis::AppState; - -use crate::app::App; +use std::ops::Deref; #[async_trait] pub trait TempStorageExt: Sized { diff --git a/crates/core/app/tests/spend.rs b/crates/core/app/tests/spend.rs index 02c79fb3a0..dbae6114ce 100644 --- a/crates/core/app/tests/spend.rs +++ b/crates/core/app/tests/spend.rs @@ -1,9 +1,10 @@ -use std::{ops::Deref, sync::Arc}; +mod common; +use self::common::TempStorageExt; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler as _, Component}; use decaf377_rdsa::SigningKey; -use penumbra_app::{ActionHandler, TempStorageExt}; +use penumbra_app::ActionHandler; use penumbra_asset::Value; use penumbra_compact_block::component::CompactBlockManager; use penumbra_keys::{test_keys, PayloadKey}; @@ -17,6 +18,7 @@ use penumbra_shielded_pool::{component::ShieldedPool, SpendPlan}; use penumbra_transaction::{Transaction, TransactionBody, TransactionParameters}; use penumbra_txhash::{AuthorizingData, EffectHash, TransactionContext}; use rand_core::SeedableRng; +use std::{ops::Deref, sync::Arc}; use tendermint::abci; #[tokio::test] diff --git a/crates/core/app/tests/swap_and_swap_claim.rs b/crates/core/app/tests/swap_and_swap_claim.rs index 412f65ab31..8cdd1a113c 100644 --- a/crates/core/app/tests/swap_and_swap_claim.rs +++ b/crates/core/app/tests/swap_and_swap_claim.rs @@ -1,32 +1,32 @@ -use ark_ff::UniformRand; -use penumbra_compact_block::component::CompactBlockManager as _; -use penumbra_sct::{ - component::{clock::EpochManager, source::SourceContext as _, StateReadExt as _}, - epoch::Epoch, -}; -use std::{ops::Deref, sync::Arc}; +mod common; +use self::common::TempStorageExt; +use ark_ff::UniformRand; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler, Component}; use decaf377::Fq; -use penumbra_app::TempStorageExt; use penumbra_asset::asset; +use penumbra_compact_block::component::CompactBlockManager as _; +use penumbra_dex::{ + component::{Dex, StateReadExt as _}, + swap::{SwapPlaintext, SwapPlan}, + swap_claim::SwapClaimPlan, + TradingPair, +}; use penumbra_fee::Fee; use penumbra_keys::{test_keys, Address}; use penumbra_mock_client::MockClient; use penumbra_num::Amount; +use penumbra_sct::{ + component::{clock::EpochManager, source::SourceContext as _, StateReadExt as _}, + epoch::Epoch, +}; use penumbra_shielded_pool::component::ShieldedPool; use penumbra_transaction::Transaction; use rand_core::SeedableRng; +use std::{ops::Deref, sync::Arc}; use tendermint::abci; -use penumbra_dex::{ - component::{Dex, StateReadExt as _}, - swap::{SwapPlaintext, SwapPlan}, - swap_claim::SwapClaimPlan, - TradingPair, -}; - #[tokio::test] async fn swap_and_swap_claim() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); From 7a2d20feddf0c204158b534484ae39a45fc0e9be Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 15:23:11 -0500 Subject: [PATCH 07/10] =?UTF-8?q?chore(flake):=20=F0=9F=A5=A3=20update=20l?= =?UTF-8?q?ockfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index c63cd7c4e9..9ffd206c04 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1707268954, + "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", "type": "github" }, "original": { @@ -51,11 +51,11 @@ ] }, "locked": { - "lastModified": 1704075545, - "narHash": "sha256-L3zgOuVKhPjKsVLc3yTm2YJ6+BATyZBury7wnhyc8QU=", + "lastModified": 1707358215, + "narHash": "sha256-Nuhi8KEJ2e+2nTimSyEIPqN5eh7ECVWd+AnPXG6L+SY=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a0df72e106322b67e9c6e591fe870380bd0da0d5", + "rev": "dd917bb1b67fc049fd56fe6de70266a9ab74a4aa", "type": "github" }, "original": { From e9cc0064ba8b43582825c56fa47dc76e338a6da5 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 15:41:34 -0500 Subject: [PATCH 08/10] =?UTF-8?q?chore(flake):=20=F0=9F=99=84=20use=20rust?= =?UTF-8?q?up=20instead=20of=20overlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when new versions of rust are released, there is a period before the new version appears in the overlay. this, in the worst case, can leave me (a foolish nix user) with a different toolchain than used in CI, with no way to easily rectify this. we could (should?) use a toolchain file, but i'm not going to introduce one purely for nix's sake. eugh. --- flake.lock | 26 +------------------------- flake.nix | 14 +++----------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 9ffd206c04..587cbdef51 100644 --- a/flake.lock +++ b/flake.lock @@ -37,31 +37,7 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1707358215, - "narHash": "sha256-Nuhi8KEJ2e+2nTimSyEIPqN5eh7ECVWd+AnPXG6L+SY=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "dd917bb1b67fc049fd56fe6de70266a9ab74a4aa", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" + "nixpkgs": "nixpkgs" } }, "systems": { diff --git a/flake.nix b/flake.nix index 1a13f84a13..e2139bf19b 100644 --- a/flake.nix +++ b/flake.nix @@ -4,22 +4,14 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; }; - outputs = { self, nixpkgs, flake-utils, rust-overlay }: + outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let - overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { - inherit system overlays; + inherit system; }; nativeBuildInputs = with pkgs; [ pkg-config @@ -27,7 +19,7 @@ buildInputs = with pkgs; [ clang openssl - rust-bin.stable.latest.default + rustup ]; in with pkgs; From 11f003072ed3fe02bf8fd415dfddf30500f9c433 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 15:51:42 -0500 Subject: [PATCH 09/10] =?UTF-8?q?feat(ci):=20=F0=9F=94=A8=20print=20up=20t?= =?UTF-8?q?o=20128=20lines=20of=20uncommitted=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c68d904b97..0dff0f723c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,6 +30,7 @@ jobs: if [[ -n "$s" ]]; then echo "ERROR: found modified files that should be committed:" echo "$s" + git diff | head -n 128 exit 1 else echo "OK: no uncommitted changes detected" From 045e43c64615e5d2910a7598604faade9e51af58 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Thu, 8 Feb 2024 15:57:43 -0500 Subject: [PATCH 10/10] =?UTF-8?q?chore(lockfile):=20=E2=9D=93=20update=20l?= =?UTF-8?q?ockfile=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be80982224..14afd8d153 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5104,7 +5104,7 @@ dependencies = [ [[package]] name = "penumbra-genesis" -version = "0.65.0" +version = "0.66.0" dependencies = [ "anyhow", "penumbra-community-pool", @@ -5276,7 +5276,7 @@ dependencies = [ [[package]] name = "penumbra-mock-client" -version = "0.65.0" +version = "0.66.0" dependencies = [ "anyhow", "cnidarium", @@ -5290,7 +5290,7 @@ dependencies = [ [[package]] name = "penumbra-mock-consensus" -version = "0.65.0" +version = "0.66.0" [[package]] name = "penumbra-num"