From ba866f6ce1311171b0e3b00aeeb58fbf3c174c16 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 10:14:27 -0500 Subject: [PATCH 01/19] penumbra: use `penumbra-sdk` namespace in crate graph --- Cargo.lock | 684 +++++++++--------- Cargo.toml | 62 +- crates/bench/Cargo.toml | 25 +- crates/bin/pcli/Cargo.toml | 66 +- crates/bin/pclientd/Cargo.toml | 24 +- crates/bin/pd/Cargo.toml | 44 +- crates/bin/pindexer/Cargo.toml | 26 +- crates/bin/pmonitor/Cargo.toml | 20 +- crates/core/app/Cargo.toml | 91 +-- crates/core/asset/Cargo.toml | 6 +- crates/core/component/auction/Cargo.toml | 34 +- .../core/component/community-pool/Cargo.toml | 20 +- .../core/component/compact-block/Cargo.toml | 30 +- crates/core/component/dex/Cargo.toml | 34 +- .../core/component/distributions/Cargo.toml | 14 +- crates/core/component/fee/Cargo.toml | 12 +- crates/core/component/funding/Cargo.toml | 30 +- crates/core/component/governance/Cargo.toml | 36 +- crates/core/component/ibc/Cargo.toml | 16 +- crates/core/component/sct/Cargo.toml | 12 +- .../core/component/shielded-pool/Cargo.toml | 30 +- crates/core/component/stake/Cargo.toml | 36 +- crates/core/keys/Cargo.toml | 10 +- crates/core/num/Cargo.toml | 4 +- crates/core/transaction/Cargo.toml | 48 +- crates/core/txhash/Cargo.toml | 6 +- crates/crypto/decaf377-frost/Cargo.toml | 2 +- crates/crypto/eddy/Cargo.toml | 2 +- crates/crypto/proof-params/Cargo.toml | 2 +- crates/crypto/proof-setup/Cargo.toml | 20 +- crates/crypto/tct/Cargo.toml | 4 +- crates/custody/Cargo.toml | 14 +- crates/misc/measure/Cargo.toml | 6 +- crates/misc/tct-visualize/Cargo.toml | 4 +- .../tct-visualize/src/bin/tct-live-edit.rs | 2 +- .../tct-visualize/src/bin/tct-visualize.rs | 2 +- crates/proto/Cargo.toml | 2 +- crates/test/mock-client/Cargo.toml | 18 +- crates/test/mock-consensus/Cargo.toml | 2 +- crates/test/mock-tendermint-proxy/Cargo.toml | 6 +- crates/test/tct-property-test/Cargo.toml | 4 +- crates/test/tracing-subscriber/Cargo.toml | 2 +- crates/util/auto-https/Cargo.toml | 2 +- crates/util/tendermint-proxy/Cargo.toml | 6 +- crates/util/tower-trace/Cargo.toml | 2 +- crates/view/Cargo.toml | 40 +- crates/wallet/Cargo.toml | 32 +- tools/parameter-setup/Cargo.toml | 16 +- tools/summonerd/Cargo.toml | 14 +- 49 files changed, 813 insertions(+), 811 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 047ae52fee..563f3b694c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1758,7 +1758,7 @@ dependencies = [ "decaf377-rdsa", "frost-core", "frost-rerandomized", - "penumbra-proto", + "penumbra-sdk-proto", "rand_core", ] @@ -4391,27 +4391,27 @@ dependencies = [ "ndarray", "once_cell", "pbjson-types", - "penumbra-app", - "penumbra-asset", - "penumbra-auction", - "penumbra-community-pool", - "penumbra-compact-block", - "penumbra-custody", - "penumbra-dex", - "penumbra-fee", - "penumbra-governance", - "penumbra-ibc", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-transaction", - "penumbra-view", - "penumbra-wallet", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-auction", + "penumbra-sdk-community-pool", + "penumbra-sdk-compact-block", + "penumbra-sdk-custody", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-governance", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-transaction", + "penumbra-sdk-view", + "penumbra-sdk-wallet", "pin-project", "predicates 2.1.5", "rand", @@ -4461,15 +4461,15 @@ dependencies = [ "ibc-types", "metrics 0.24.1", "parking_lot", - "penumbra-app", - "penumbra-asset", - "penumbra-custody", - "penumbra-keys", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-tct", - "penumbra-transaction", - "penumbra-view", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-custody", + "penumbra-sdk-keys", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-tct", + "penumbra-sdk-transaction", + "penumbra-sdk-view", "prost", "rand", "rand_core", @@ -4531,27 +4531,27 @@ dependencies = [ "mime_guess", "once_cell", "pbjson-types", - "penumbra-app", - "penumbra-asset", - "penumbra-auction", - "penumbra-auto-https", - "penumbra-compact-block", - "penumbra-custody", - "penumbra-dex", - "penumbra-fee", - "penumbra-governance", - "penumbra-ibc", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-tendermint-proxy", - "penumbra-tower-trace", - "penumbra-transaction", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-auction", + "penumbra-sdk-auto-https", + "penumbra-sdk-compact-block", + "penumbra-sdk-custody", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-governance", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-tendermint-proxy", + "penumbra-sdk-tower-trace", + "penumbra-sdk-transaction", "pin-project", "pin-project-lite", "predicates 2.1.5", @@ -4646,7 +4646,7 @@ dependencies = [ ] [[package]] -name = "penumbra-app" +name = "penumbra-sdk-app" version = "0.81.0" dependencies = [ "anyhow", @@ -4676,33 +4676,33 @@ dependencies = [ "metrics 0.24.1", "once_cell", "parking_lot", - "penumbra-asset", - "penumbra-auction", - "penumbra-community-pool", - "penumbra-compact-block", - "penumbra-dex", - "penumbra-distributions", - "penumbra-fee", - "penumbra-funding", - "penumbra-governance", - "penumbra-ibc", - "penumbra-keys", - "penumbra-mock-client", - "penumbra-mock-consensus", - "penumbra-mock-tendermint-proxy", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-test-subscriber", - "penumbra-tower-trace", - "penumbra-transaction", - "penumbra-txhash", - "penumbra-view", - "penumbra-wallet", + "penumbra-sdk-asset", + "penumbra-sdk-auction", + "penumbra-sdk-community-pool", + "penumbra-sdk-compact-block", + "penumbra-sdk-dex", + "penumbra-sdk-distributions", + "penumbra-sdk-fee", + "penumbra-sdk-funding", + "penumbra-sdk-governance", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-mock-client", + "penumbra-sdk-mock-consensus", + "penumbra-sdk-mock-tendermint-proxy", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-test-subscriber", + "penumbra-sdk-tower-trace", + "penumbra-sdk-transaction", + "penumbra-sdk-txhash", + "penumbra-sdk-view", + "penumbra-sdk-wallet", "prost", "rand", "rand_chacha", @@ -4735,7 +4735,7 @@ dependencies = [ ] [[package]] -name = "penumbra-asset" +name = "penumbra-sdk-asset" version = "0.81.0" dependencies = [ "anyhow", @@ -4759,8 +4759,8 @@ dependencies = [ "num-bigint", "once_cell", "pbjson-types", - "penumbra-num", - "penumbra-proto", + "penumbra-sdk-num", + "penumbra-sdk-proto", "poseidon377", "proptest", "rand", @@ -4775,7 +4775,7 @@ dependencies = [ ] [[package]] -name = "penumbra-auction" +name = "penumbra-sdk-auction" version = "0.81.0" dependencies = [ "anyhow", @@ -4802,16 +4802,16 @@ dependencies = [ "metrics 0.24.1", "once_cell", "pbjson-types", - "penumbra-asset", - "penumbra-dex", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-tct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-dex", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-tct", + "penumbra-sdk-txhash", "proptest", "prost", "prost-types", @@ -4830,7 +4830,7 @@ dependencies = [ ] [[package]] -name = "penumbra-auto-https" +name = "penumbra-sdk-auto-https" version = "0.81.0" dependencies = [ "anyhow", @@ -4842,7 +4842,7 @@ dependencies = [ ] [[package]] -name = "penumbra-bench" +name = "penumbra-sdk-bench" version = "0.81.0" dependencies = [ "anyhow", @@ -4864,17 +4864,17 @@ dependencies = [ "hex", "num-bigint", "once_cell", - "penumbra-asset", - "penumbra-dex", - "penumbra-fee", - "penumbra-governance", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", + "penumbra-sdk-asset", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-governance", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", "rand", "rand_core", "regex", @@ -4886,7 +4886,7 @@ dependencies = [ ] [[package]] -name = "penumbra-community-pool" +name = "penumbra-sdk-community-pool" version = "0.81.0" dependencies = [ "anyhow", @@ -4901,13 +4901,13 @@ dependencies = [ "metrics 0.24.1", "once_cell", "pbjson-types", - "penumbra-asset", - "penumbra-keys", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-txhash", "prost", "serde", "sha2 0.10.8", @@ -4918,7 +4918,7 @@ dependencies = [ ] [[package]] -name = "penumbra-compact-block" +name = "penumbra-sdk-compact-block" version = "0.81.0" dependencies = [ "anyhow", @@ -4932,16 +4932,16 @@ dependencies = [ "futures", "im", "metrics 0.24.1", - "penumbra-dex", - "penumbra-fee", - "penumbra-governance", - "penumbra-ibc", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-governance", + "penumbra-sdk-ibc", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", "rand", "rand_core", "serde", @@ -4953,7 +4953,7 @@ dependencies = [ ] [[package]] -name = "penumbra-custody" +name = "penumbra-sdk-custody" version = "0.81.0" dependencies = [ "anyhow", @@ -4971,12 +4971,12 @@ dependencies = [ "ed25519-consensus", "futures", "hex", - "penumbra-governance", - "penumbra-keys", - "penumbra-proto", - "penumbra-stake", - "penumbra-transaction", - "penumbra-txhash", + "penumbra-sdk-governance", + "penumbra-sdk-keys", + "penumbra-sdk-proto", + "penumbra-sdk-stake", + "penumbra-sdk-transaction", + "penumbra-sdk-txhash", "prost", "rand_core", "serde", @@ -4989,7 +4989,7 @@ dependencies = [ ] [[package]] -name = "penumbra-dex" +name = "penumbra-sdk-dex" version = "0.81.0" dependencies = [ "anyhow", @@ -5019,16 +5019,16 @@ dependencies = [ "once_cell", "parking_lot", "pbjson-types", - "penumbra-asset", - "penumbra-fee", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-tct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-fee", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-tct", + "penumbra-sdk-txhash", "poseidon377", "proptest", "prost", @@ -5051,7 +5051,7 @@ dependencies = [ ] [[package]] -name = "penumbra-distributions" +name = "penumbra-sdk-distributions" version = "0.81.0" dependencies = [ "anyhow", @@ -5059,17 +5059,17 @@ dependencies = [ "cnidarium", "cnidarium-component", "getrandom", - "penumbra-asset", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", + "penumbra-sdk-asset", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", "serde", "tendermint", "tracing", ] [[package]] -name = "penumbra-eddy" +name = "penumbra-sdk-eddy" version = "0.81.0" dependencies = [ "anyhow", @@ -5087,7 +5087,7 @@ dependencies = [ ] [[package]] -name = "penumbra-fee" +name = "penumbra-sdk-fee" version = "0.81.0" dependencies = [ "anyhow", @@ -5102,9 +5102,9 @@ dependencies = [ "getrandom", "im", "metrics 0.24.1", - "penumbra-asset", - "penumbra-num", - "penumbra-proto", + "penumbra-sdk-asset", + "penumbra-sdk-num", + "penumbra-sdk-proto", "rand", "rand_core", "serde", @@ -5114,7 +5114,7 @@ dependencies = [ ] [[package]] -name = "penumbra-funding" +name = "penumbra-sdk-funding" version = "0.81.0" dependencies = [ "anyhow", @@ -5123,21 +5123,21 @@ dependencies = [ "cnidarium-component", "futures", "metrics 0.24.1", - "penumbra-asset", - "penumbra-community-pool", - "penumbra-distributions", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", + "penumbra-sdk-asset", + "penumbra-sdk-community-pool", + "penumbra-sdk-distributions", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", "serde", "tendermint", "tracing", ] [[package]] -name = "penumbra-governance" +name = "penumbra-sdk-governance" version = "0.81.0" dependencies = [ "anyhow", @@ -5162,18 +5162,18 @@ dependencies = [ "metrics 0.24.1", "once_cell", "pbjson-types", - "penumbra-asset", - "penumbra-distributions", - "penumbra-ibc", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-distributions", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-txhash", "proptest", "proptest-derive", "rand", @@ -5191,7 +5191,7 @@ dependencies = [ ] [[package]] -name = "penumbra-ibc" +name = "penumbra-sdk-ibc" version = "0.81.0" dependencies = [ "anyhow", @@ -5209,11 +5209,11 @@ dependencies = [ "num-traits", "once_cell", "pbjson-types", - "penumbra-asset", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-txhash", "prost", "serde", "serde_json", @@ -5228,7 +5228,7 @@ dependencies = [ ] [[package]] -name = "penumbra-keys" +name = "penumbra-sdk-keys" version = "0.81.0" dependencies = [ "aes", @@ -5259,9 +5259,9 @@ dependencies = [ "num-traits", "once_cell", "pbkdf2 0.12.2", - "penumbra-asset", - "penumbra-proto", - "penumbra-tct", + "penumbra-sdk-asset", + "penumbra-sdk-proto", + "penumbra-sdk-tct", "poseidon377", "proptest", "rand", @@ -5275,15 +5275,15 @@ dependencies = [ ] [[package]] -name = "penumbra-measure" +name = "penumbra-sdk-measure" version = "0.81.0" dependencies = [ "anyhow", "bytesize", "clap", "indicatif", - "penumbra-compact-block", - "penumbra-proto", + "penumbra-sdk-compact-block", + "penumbra-sdk-proto", "serde_json", "tokio", "tonic", @@ -5293,24 +5293,24 @@ dependencies = [ ] [[package]] -name = "penumbra-mock-client" +name = "penumbra-sdk-mock-client" version = "0.81.0" dependencies = [ "anyhow", "cnidarium", - "penumbra-asset", - "penumbra-compact-block", - "penumbra-dex", - "penumbra-keys", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-tct", - "penumbra-transaction", + "penumbra-sdk-asset", + "penumbra-sdk-compact-block", + "penumbra-sdk-dex", + "penumbra-sdk-keys", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-tct", + "penumbra-sdk-transaction", "rand_core", ] [[package]] -name = "penumbra-mock-consensus" +name = "penumbra-sdk-mock-consensus" version = "0.81.0" dependencies = [ "anyhow", @@ -5330,13 +5330,13 @@ dependencies = [ ] [[package]] -name = "penumbra-mock-tendermint-proxy" +name = "penumbra-sdk-mock-tendermint-proxy" version = "0.81.0" dependencies = [ "hex", "pbjson-types", - "penumbra-mock-consensus", - "penumbra-proto", + "penumbra-sdk-mock-consensus", + "penumbra-sdk-proto", "tap", "tendermint", "tendermint-proto", @@ -5345,7 +5345,7 @@ dependencies = [ ] [[package]] -name = "penumbra-num" +name = "penumbra-sdk-num" version = "0.81.0" dependencies = [ "anyhow", @@ -5369,7 +5369,7 @@ dependencies = [ "ibig", "num-bigint", "once_cell", - "penumbra-proto", + "penumbra-sdk-proto", "proptest", "rand", "rand_core", @@ -5382,24 +5382,24 @@ dependencies = [ ] [[package]] -name = "penumbra-parameter-setup" +name = "penumbra-sdk-parameter-setup" version = "0.81.0" dependencies = [ "ark-groth16", "ark-serialize", "decaf377", - "penumbra-community-pool", - "penumbra-dex", - "penumbra-governance", - "penumbra-proof-params", - "penumbra-proof-setup", - "penumbra-shielded-pool", - "penumbra-stake", + "penumbra-sdk-community-pool", + "penumbra-sdk-dex", + "penumbra-sdk-governance", + "penumbra-sdk-proof-params", + "penumbra-sdk-proof-setup", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", "rand_core", ] [[package]] -name = "penumbra-proof-params" +name = "penumbra-sdk-proof-params" version = "0.81.0" dependencies = [ "anyhow", @@ -5427,7 +5427,7 @@ dependencies = [ ] [[package]] -name = "penumbra-proof-setup" +name = "penumbra-sdk-proof-setup" version = "0.81.0" dependencies = [ "anyhow", @@ -5442,19 +5442,19 @@ dependencies = [ "blake2b_simd 1.0.2", "criterion", "decaf377", - "penumbra-dex", - "penumbra-governance", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-shielded-pool", - "penumbra-stake", + "penumbra-sdk-dex", + "penumbra-sdk-governance", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", "rand_chacha", "rand_core", "rayon", ] [[package]] -name = "penumbra-proto" +name = "penumbra-sdk-proto" version = "0.81.0" dependencies = [ "anyhow", @@ -5489,7 +5489,7 @@ dependencies = [ ] [[package]] -name = "penumbra-sct" +name = "penumbra-sdk-sct" version = "0.81.0" dependencies = [ "anyhow", @@ -5512,9 +5512,9 @@ dependencies = [ "metrics 0.24.1", "once_cell", "pbjson-types", - "penumbra-keys", - "penumbra-proto", - "penumbra-tct", + "penumbra-sdk-keys", + "penumbra-sdk-proto", + "penumbra-sdk-tct", "poseidon377", "rand", "rand_core", @@ -5525,7 +5525,7 @@ dependencies = [ ] [[package]] -name = "penumbra-shielded-pool" +name = "penumbra-sdk-shielded-pool" version = "0.81.0" dependencies = [ "anyhow", @@ -5554,15 +5554,15 @@ dependencies = [ "im", "metrics 0.24.1", "once_cell", - "penumbra-asset", - "penumbra-ibc", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-tct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-tct", + "penumbra-sdk-txhash", "poseidon377", "proptest", "prost", @@ -5579,7 +5579,7 @@ dependencies = [ ] [[package]] -name = "penumbra-stake" +name = "penumbra-sdk-stake" version = "0.81.0" dependencies = [ "anyhow", @@ -5605,16 +5605,16 @@ dependencies = [ "im", "metrics 0.24.1", "once_cell", - "penumbra-asset", - "penumbra-distributions", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-tct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-distributions", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-tct", + "penumbra-sdk-txhash", "proptest", "rand_chacha", "rand_core", @@ -5632,7 +5632,7 @@ dependencies = [ ] [[package]] -name = "penumbra-tct" +name = "penumbra-sdk-tct" version = "0.81.0" dependencies = [ "ark-ed-on-bls12-377", @@ -5651,7 +5651,7 @@ dependencies = [ "im", "once_cell", "parking_lot", - "penumbra-proto", + "penumbra-sdk-proto", "poseidon377", "proptest", "proptest-derive", @@ -5664,19 +5664,19 @@ dependencies = [ ] [[package]] -name = "penumbra-tct-property-test" +name = "penumbra-sdk-tct-property-test" version = "0.81.0" dependencies = [ "anyhow", "futures", - "penumbra-tct", + "penumbra-sdk-tct", "proptest", "proptest-derive", "tokio", ] [[package]] -name = "penumbra-tct-visualize" +name = "penumbra-sdk-tct-visualize" version = "0.81.0" dependencies = [ "anyhow", @@ -5690,7 +5690,7 @@ dependencies = [ "hex", "include-flate", "parking_lot", - "penumbra-tct", + "penumbra-sdk-tct", "prost", "rand", "rand_chacha", @@ -5707,7 +5707,7 @@ dependencies = [ ] [[package]] -name = "penumbra-tendermint-proxy" +name = "penumbra-sdk-tendermint-proxy" version = "0.81.0" dependencies = [ "anyhow", @@ -5717,8 +5717,8 @@ dependencies = [ "http 1.2.0", "metrics 0.24.1", "pbjson-types", - "penumbra-proto", - "penumbra-transaction", + "penumbra-sdk-proto", + "penumbra-sdk-transaction", "pin-project", "pin-project-lite", "sha2 0.10.8", @@ -5739,7 +5739,7 @@ dependencies = [ ] [[package]] -name = "penumbra-test-subscriber" +name = "penumbra-sdk-test-subscriber" version = "0.81.0" dependencies = [ "tracing", @@ -5747,7 +5747,7 @@ dependencies = [ ] [[package]] -name = "penumbra-tower-trace" +name = "penumbra-sdk-tower-trace" version = "0.81.0" dependencies = [ "futures", @@ -5768,7 +5768,7 @@ dependencies = [ ] [[package]] -name = "penumbra-transaction" +name = "penumbra-sdk-transaction" version = "0.81.0" dependencies = [ "anyhow", @@ -5791,22 +5791,22 @@ dependencies = [ "num-bigint", "once_cell", "pbjson-types", - "penumbra-asset", - "penumbra-auction", - "penumbra-community-pool", - "penumbra-dex", - "penumbra-fee", - "penumbra-governance", - "penumbra-ibc", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-txhash", + "penumbra-sdk-asset", + "penumbra-sdk-auction", + "penumbra-sdk-community-pool", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-governance", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-txhash", "poseidon377", "proptest", "proptest-derive", @@ -5823,20 +5823,20 @@ dependencies = [ ] [[package]] -name = "penumbra-txhash" +name = "penumbra-sdk-txhash" version = "0.81.0" dependencies = [ "anyhow", "blake2b_simd 1.0.2", "getrandom", "hex", - "penumbra-proto", - "penumbra-tct", + "penumbra-sdk-proto", + "penumbra-sdk-tct", "serde", ] [[package]] -name = "penumbra-view" +name = "penumbra-sdk-view" version = "0.81.0" dependencies = [ "anyhow", @@ -5856,25 +5856,25 @@ dependencies = [ "once_cell", "parking_lot", "pbjson-types", - "penumbra-app", - "penumbra-asset", - "penumbra-auction", - "penumbra-community-pool", - "penumbra-compact-block", - "penumbra-dex", - "penumbra-distributions", - "penumbra-fee", - "penumbra-funding", - "penumbra-governance", - "penumbra-ibc", - "penumbra-keys", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-transaction", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-auction", + "penumbra-sdk-community-pool", + "penumbra-sdk-compact-block", + "penumbra-sdk-dex", + "penumbra-sdk-distributions", + "penumbra-sdk-fee", + "penumbra-sdk-funding", + "penumbra-sdk-governance", + "penumbra-sdk-ibc", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-transaction", "prost", "r2d2", "r2d2_sqlite", @@ -5894,7 +5894,7 @@ dependencies = [ ] [[package]] -name = "penumbra-wallet" +name = "penumbra-sdk-wallet" version = "0.81.0" dependencies = [ "anyhow", @@ -5904,20 +5904,20 @@ dependencies = [ "decaf377", "hex", "once_cell", - "penumbra-app", - "penumbra-asset", - "penumbra-custody", - "penumbra-dex", - "penumbra-fee", - "penumbra-governance", - "penumbra-keys", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", - "penumbra-stake", - "penumbra-tct", - "penumbra-transaction", - "penumbra-view", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-custody", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-governance", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-transaction", + "penumbra-sdk-view", "pin-project", "proptest", "proptest-derive", @@ -5988,19 +5988,19 @@ dependencies = [ "clap", "cometindex", "num-bigint", - "penumbra-app", - "penumbra-asset", - "penumbra-auction", - "penumbra-dex", - "penumbra-fee", - "penumbra-funding", - "penumbra-governance", - "penumbra-keys", - "penumbra-num", - "penumbra-proto", - "penumbra-sct", - "penumbra-shielded-pool", - "penumbra-stake", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-auction", + "penumbra-sdk-dex", + "penumbra-sdk-fee", + "penumbra-sdk-funding", + "penumbra-sdk-governance", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-sct", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", "prost", "serde_json", "sqlx", @@ -6088,16 +6088,16 @@ dependencies = [ "indicatif", "once_cell", "pcli", - "penumbra-app", - "penumbra-asset", - "penumbra-compact-block", - "penumbra-keys", - "penumbra-num", - "penumbra-proto", - "penumbra-shielded-pool", - "penumbra-stake", - "penumbra-tct", - "penumbra-view", + "penumbra-sdk-app", + "penumbra-sdk-asset", + "penumbra-sdk-compact-block", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proto", + "penumbra-sdk-shielded-pool", + "penumbra-sdk-stake", + "penumbra-sdk-tct", + "penumbra-sdk-view", "regex", "serde", "serde_json", @@ -7885,13 +7885,13 @@ dependencies = [ "hex", "http-body 1.0.1", "metrics-tracing-context", - "penumbra-asset", - "penumbra-keys", - "penumbra-num", - "penumbra-proof-params", - "penumbra-proof-setup", - "penumbra-proto", - "penumbra-view", + "penumbra-sdk-asset", + "penumbra-sdk-keys", + "penumbra-sdk-num", + "penumbra-sdk-proof-params", + "penumbra-sdk-proof-setup", + "penumbra-sdk-proto", + "penumbra-sdk-view", "r2d2", "r2d2_sqlite", "rand", diff --git a/Cargo.toml b/Cargo.toml index 743ba37f74..ed8d76d61c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,7 +105,7 @@ push = false authors = ["Penumbra Labs Date: Wed, 25 Dec 2024 10:23:32 -0500 Subject: [PATCH 02/19] penumbra: plug into sdk crates --- crates/bench/benches/convert.rs | 8 +- crates/bench/benches/delegator_vote.rs | 14 ++-- crates/bench/benches/nullifier_derivation.rs | 14 ++-- crates/bench/benches/output.rs | 8 +- crates/bench/benches/spend.rs | 12 +-- crates/bench/benches/swap.rs | 12 +-- crates/bench/benches/swap_claim.rs | 16 ++-- crates/bin/pcli/src/command/init.rs | 22 +++--- crates/bin/pcli/src/command/migrate.rs | 12 +-- crates/bin/pcli/src/command/query.rs | 14 ++-- crates/bin/pcli/src/command/query/auction.rs | 30 ++++---- crates/bin/pcli/src/command/query/chain.rs | 6 +- .../pcli/src/command/query/community_pool.rs | 8 +- crates/bin/pcli/src/command/query/dex.rs | 12 +-- .../bin/pcli/src/command/query/governance.rs | 18 ++--- .../pcli/src/command/query/shielded_pool.rs | 10 +-- crates/bin/pcli/src/command/query/tx.rs | 4 +- .../bin/pcli/src/command/query/validator.rs | 8 +- crates/bin/pcli/src/command/threshold.rs | 4 +- crates/bin/pcli/src/command/tx.rs | 26 +++---- .../bin/pcli/src/command/tx/auction/dutch.rs | 14 ++-- .../src/command/tx/auction/dutch/debug.rs | 2 +- .../pcli/src/command/tx/auction/dutch/gda.rs | 4 +- .../pcli/src/command/tx/liquidity_position.rs | 4 +- crates/bin/pcli/src/command/tx/proposal.rs | 8 +- crates/bin/pcli/src/command/tx/replicate.rs | 4 +- .../pcli/src/command/tx/replicate/linear.rs | 16 ++-- .../bin/pcli/src/command/tx/replicate/xyk.rs | 12 +-- crates/bin/pcli/src/command/utils.rs | 4 +- crates/bin/pcli/src/command/validator.rs | 14 ++-- crates/bin/pcli/src/command/view/address.rs | 2 +- crates/bin/pcli/src/command/view/auction.rs | 16 ++-- crates/bin/pcli/src/command/view/balance.rs | 8 +- crates/bin/pcli/src/command/view/lps.rs | 6 +- .../pcli/src/command/view/noble_address.rs | 2 +- crates/bin/pcli/src/command/view/staked.rs | 10 +-- .../src/command/view/transaction_hashes.rs | 6 +- crates/bin/pcli/src/command/view/tx.rs | 6 +- crates/bin/pcli/src/command/view/wallet_id.rs | 2 +- crates/bin/pcli/src/config.rs | 10 +-- .../bin/pcli/src/dex_utils/replicate/debug.rs | 6 +- .../bin/pcli/src/dex_utils/replicate/xyk.rs | 6 +- crates/bin/pcli/src/lib.rs | 4 +- crates/bin/pcli/src/network.rs | 12 +-- crates/bin/pcli/src/opt.rs | 18 ++--- crates/bin/pcli/src/terminal.rs | 32 ++++---- crates/bin/pcli/src/transaction_view_ext.rs | 76 +++++++++---------- crates/bin/pcli/tests/debug.rs | 2 +- crates/bin/pcli/tests/network_integration.rs | 16 ++-- crates/bin/pcli/tests/proof.rs | 32 ++++---- crates/bin/pclientd/src/lib.rs | 16 ++-- .../bin/pclientd/tests/network_integration.rs | 22 +++--- crates/bin/pd/src/cli.rs | 30 ++++---- crates/bin/pd/src/lib.rs | 2 +- crates/bin/pd/src/main.rs | 18 ++--- crates/bin/pd/src/metrics.rs | 2 +- crates/bin/pd/src/migrate.rs | 6 +- crates/bin/pd/src/migrate/mainnet1.rs | 16 ++-- crates/bin/pd/src/migrate/mainnet2.rs | 12 +-- crates/bin/pd/src/migrate/reset_halt_bit.rs | 2 +- crates/bin/pd/src/migrate/simple.rs | 6 +- crates/bin/pd/src/migrate/testnet72.rs | 18 ++--- crates/bin/pd/src/migrate/testnet74.rs | 14 ++-- crates/bin/pd/src/migrate/testnet76.rs | 26 +++---- crates/bin/pd/src/migrate/testnet77.rs | 10 +-- crates/bin/pd/src/migrate/testnet78.rs | 50 ++++++------ crates/bin/pd/src/network/config.rs | 6 +- crates/bin/pd/src/network/generate.rs | 52 ++++++------- crates/bin/pd/tests/network_integration.rs | 10 +-- crates/bin/pindexer/src/block.rs | 2 +- crates/bin/pindexer/src/dex_ex/mod.rs | 18 ++--- crates/bin/pindexer/src/governance.rs | 8 +- crates/bin/pindexer/src/ibc/mod.rs | 16 ++-- crates/bin/pindexer/src/indexer_ext.rs | 8 +- crates/bin/pindexer/src/insights/mod.rs | 18 ++--- crates/bin/pindexer/src/main.rs | 2 +- crates/bin/pindexer/src/parsing.rs | 2 +- .../bin/pindexer/src/stake/delegation_txs.rs | 6 +- .../bin/pindexer/src/stake/missed_blocks.rs | 4 +- crates/bin/pindexer/src/stake/slashings.rs | 4 +- .../pindexer/src/stake/undelegation_txs.rs | 6 +- .../bin/pindexer/src/stake/validator_set.rs | 10 +-- crates/bin/pindexer/src/supply.rs | 18 ++--- crates/bin/pmonitor/src/config.rs | 4 +- crates/bin/pmonitor/src/genesis.rs | 14 ++-- crates/bin/pmonitor/src/main.rs | 24 +++--- crates/bin/pmonitor/tests/common/mod.rs | 6 +- .../bin/pmonitor/tests/common/pcli_helpers.rs | 2 +- .../cnidarium-component/src/action_handler.rs | 2 +- crates/cnidarium-component/src/lib.rs | 4 +- crates/core/app/src/action_handler/actions.rs | 6 +- .../app/src/action_handler/actions/submit.rs | 30 ++++---- .../app/src/action_handler/transaction.rs | 20 ++--- .../action_handler/transaction/stateful.rs | 10 +-- .../action_handler/transaction/stateless.rs | 4 +- crates/core/app/src/app/mod.rs | 66 ++++++++-------- crates/core/app/src/app_version/component.rs | 2 +- crates/core/app/src/community_pool_ext.rs | 12 +-- crates/core/app/src/genesis.rs | 32 ++++---- crates/core/app/src/lib.rs | 2 +- crates/core/app/src/metrics.rs | 14 ++-- crates/core/app/src/params.rs | 28 +++---- crates/core/app/src/params/change.rs | 24 +++--- crates/core/app/src/penumbra_host_chain.rs | 6 +- crates/core/app/src/rpc.rs | 22 +++--- crates/core/app/src/rpc/query.rs | 2 +- crates/core/app/src/server.rs | 6 +- crates/core/app/src/server/info.rs | 10 +-- .../app/tests/app_blocktimes_increment.rs | 8 +- ..._can_define_and_delegate_to_a_validator.rs | 58 +++++++------- .../app_can_deposit_into_community_pool.rs | 24 +++--- .../app_can_disable_community_pool_spends.rs | 44 +++++------ .../app_can_propose_community_pool_spends.rs | 48 ++++++------ .../app_can_spend_notes_and_detect_outputs.rs | 20 ++--- ...p_can_sweep_a_collection_of_small_notes.rs | 30 ++++---- .../app_can_undelegate_from_a_validator.rs | 56 +++++++------- crates/core/app/tests/app_check_dex_vcb.rs | 14 ++-- ...ator_definitions_with_invalid_auth_sigs.rs | 20 ++--- .../app_reproduce_testnet_75_vcb_close.rs | 26 +++---- ...me_for_genesis_validator_missing_blocks.rs | 10 +-- ...me_for_genesis_validator_signing_blocks.rs | 10 +-- ..._uptime_for_validators_only_once_active.rs | 42 +++++----- crates/core/app/tests/common/ibc_tests/mod.rs | 14 ++-- .../core/app/tests/common/ibc_tests/node.rs | 24 +++--- .../app/tests/common/ibc_tests/relayer.rs | 24 +++--- crates/core/app/tests/common/mod.rs | 4 +- .../core/app/tests/common/temp_storage_ext.rs | 6 +- .../app/tests/common/test_node_builder_ext.rs | 24 +++--- crates/core/app/tests/common/test_node_ext.rs | 8 +- .../app/tests/common/validator_read_ext.rs | 4 +- crates/core/app/tests/ics23_transfer.rs | 6 +- .../app/tests/mock_consensus_block_proving.rs | 28 +++---- ...onsensus_can_define_a_genesis_validator.rs | 12 +-- ...sus_can_send_a_sequence_of_empty_blocks.rs | 10 +-- crates/core/app/tests/spend.rs | 34 ++++----- crates/core/app/tests/swap_and_swap_claim.rs | 26 +++---- .../view_server_can_be_served_on_localhost.rs | 26 +++---- crates/core/asset/src/asset.rs | 46 +++++------ crates/core/asset/src/asset/denom.rs | 2 +- crates/core/asset/src/asset/denom_metadata.rs | 10 +-- crates/core/asset/src/asset/id.rs | 8 +- crates/core/asset/src/balance.rs | 6 +- crates/core/asset/src/balance/commitment.rs | 4 +- crates/core/asset/src/equivalent_value.rs | 4 +- crates/core/asset/src/estimated_price.rs | 2 +- crates/core/asset/src/value.rs | 16 ++-- .../component/auction/src/auction/dutch.rs | 10 +-- .../auction/src/auction/dutch/actions/end.rs | 6 +- .../auction/src/auction/dutch/actions/plan.rs | 4 +- .../src/auction/dutch/actions/schedule.rs | 6 +- .../auction/src/auction/dutch/actions/view.rs | 4 +- .../src/auction/dutch/actions/withdraw.rs | 6 +- .../core/component/auction/src/auction/id.rs | 2 +- .../core/component/auction/src/auction/nft.rs | 4 +- .../src/component/action_handler/dutch/end.rs | 2 +- .../action_handler/dutch/schedule.rs | 4 +- .../auction/src/component/auction.rs | 10 +-- .../auction/src/component/auction_store.rs | 8 +- .../auction/src/component/dutch_auction.rs | 20 ++--- .../auction/src/component/metrics.rs | 2 +- .../component/auction/src/component/rpc.rs | 6 +- crates/core/component/auction/src/event.rs | 6 +- crates/core/component/auction/src/genesis.rs | 2 +- crates/core/component/auction/src/params.rs | 4 +- .../core/component/auction/src/state_key.rs | 2 +- .../src/action/community_pool_deposit.rs | 6 +- .../src/action/community_pool_output.rs | 8 +- .../src/action/community_pool_spend.rs | 6 +- .../action_handler/community_pool_output.rs | 4 +- .../community-pool/src/component/state_key.rs | 2 +- .../community-pool/src/component/view.rs | 6 +- .../component/community-pool/src/genesis.rs | 4 +- .../component/community-pool/src/params.rs | 4 +- .../compact-block/src/compact_block.rs | 12 +-- .../compact-block/src/component/manager.rs | 18 ++--- .../compact-block/src/component/rpc.rs | 4 +- .../compact-block/src/component/view.rs | 6 +- .../compact-block/src/state_payload.rs | 8 +- .../dex/src/batch_swap_output_data.rs | 12 +-- crates/core/component/dex/src/candlestick.rs | 2 +- .../action_handler/position/close.rs | 2 +- .../dex/src/component/action_handler/swap.rs | 6 +- .../component/action_handler/swap_claim.rs | 10 +-- .../core/component/dex/src/component/arb.rs | 6 +- .../component/dex/src/component/chandelier.rs | 12 +-- .../src/component/circuit_breaker/value.rs | 18 ++--- .../core/component/dex/src/component/dex.rs | 12 +-- .../core/component/dex/src/component/flow.rs | 2 +- .../component/dex/src/component/metrics.rs | 12 +-- .../dex/src/component/position_manager.rs | 6 +- .../position_manager/base_liquidity_index.rs | 4 +- .../src/component/position_manager/counter.rs | 2 +- .../component/position_manager/price_index.rs | 2 +- .../dex/src/component/router/fill_route.rs | 4 +- .../dex/src/component/router/params.rs | 4 +- .../dex/src/component/router/path.rs | 4 +- .../dex/src/component/router/path_cache.rs | 2 +- .../dex/src/component/router/path_search.rs | 4 +- .../src/component/router/route_and_fill.rs | 6 +- .../dex/src/component/router/tests.rs | 4 +- .../core/component/dex/src/component/rpc.rs | 6 +- .../dex/src/component/swap_manager.rs | 8 +- .../core/component/dex/src/component/tests.rs | 34 ++++----- crates/core/component/dex/src/event.rs | 10 +-- crates/core/component/dex/src/genesis.rs | 2 +- crates/core/component/dex/src/lp/action.rs | 6 +- crates/core/component/dex/src/lp/nft.rs | 6 +- crates/core/component/dex/src/lp/order.rs | 4 +- crates/core/component/dex/src/lp/plan.rs | 4 +- crates/core/component/dex/src/lp/position.rs | 10 +-- crates/core/component/dex/src/lp/reserves.rs | 6 +- .../component/dex/src/lp/trading_function.rs | 8 +- crates/core/component/dex/src/params.rs | 6 +- crates/core/component/dex/src/state_key.rs | 8 +- crates/core/component/dex/src/swap/action.rs | 8 +- .../core/component/dex/src/swap/ciphertext.rs | 4 +- crates/core/component/dex/src/swap/payload.rs | 6 +- .../core/component/dex/src/swap/plaintext.rs | 20 ++--- crates/core/component/dex/src/swap/plan.rs | 8 +- crates/core/component/dex/src/swap/proof.rs | 24 +++--- crates/core/component/dex/src/swap/view.rs | 8 +- .../component/dex/src/swap_claim/action.rs | 14 ++-- .../core/component/dex/src/swap_claim/plan.rs | 12 +-- .../component/dex/src/swap_claim/proof.rs | 26 +++---- .../core/component/dex/src/swap_claim/view.rs | 6 +- .../core/component/dex/src/swap_execution.rs | 6 +- crates/core/component/dex/src/trading_pair.rs | 4 +- .../dex/tests/integration/harness.rs | 12 +-- .../component/distributions/src/component.rs | 4 +- .../distributions/src/component/view.rs | 4 +- .../component/distributions/src/genesis.rs | 2 +- .../component/distributions/src/params.rs | 4 +- crates/core/component/fee/src/component.rs | 6 +- .../component/fee/src/component/fee_pay.rs | 8 +- .../core/component/fee/src/component/rpc.rs | 2 +- .../core/component/fee/src/component/view.rs | 6 +- crates/core/component/fee/src/event.rs | 2 +- crates/core/component/fee/src/fee.rs | 6 +- crates/core/component/fee/src/gas.rs | 6 +- crates/core/component/fee/src/genesis.rs | 2 +- crates/core/component/fee/src/params.rs | 4 +- .../core/component/funding/src/component.rs | 18 ++--- .../funding/src/component/metrics.rs | 8 +- .../component/funding/src/component/view.rs | 2 +- crates/core/component/funding/src/event.rs | 4 +- crates/core/component/funding/src/genesis.rs | 2 +- crates/core/component/funding/src/params.rs | 4 +- .../src/action_handler/delegator_vote.rs | 6 +- .../src/action_handler/deposit_claim.rs | 4 +- .../src/action_handler/validator_vote.rs | 2 +- .../governance/src/action_handler/withdraw.rs | 4 +- .../core/component/governance/src/change.rs | 4 +- .../component/governance/src/component.rs | 4 +- .../component/governance/src/component/rpc.rs | 20 ++--- .../governance/src/component/view.rs | 28 +++---- .../governance/src/delegator_vote/action.rs | 12 +-- .../governance/src/delegator_vote/plan.rs | 16 ++-- .../governance/src/delegator_vote/proof.rs | 24 +++--- .../governance/src/delegator_vote/view.rs | 4 +- crates/core/component/governance/src/event.rs | 4 +- .../core/component/governance/src/genesis.rs | 2 +- .../core/component/governance/src/metrics.rs | 2 +- .../core/component/governance/src/params.rs | 6 +- .../core/component/governance/src/proposal.rs | 2 +- .../src/proposal_deposit_claim/action.rs | 8 +- .../component/governance/src/proposal_nft.rs | 2 +- .../governance/src/proposal_state.rs | 2 +- .../governance/src/proposal_submit/action.rs | 8 +- .../src/proposal_withdraw/action.rs | 8 +- .../component/governance/src/state_key.rs | 4 +- crates/core/component/governance/src/tally.rs | 2 +- .../governance/src/validator_vote/action.rs | 6 +- crates/core/component/governance/src/vote.rs | 2 +- .../governance/src/voting_receipt_token.rs | 2 +- .../component/ibc/src/component/channel.rs | 2 +- .../component/ibc/src/component/client.rs | 18 ++--- .../ibc/src/component/client_counter.rs | 2 +- .../component/ibc/src/component/connection.rs | 2 +- .../ibc/src/component/connection_counter.rs | 2 +- .../ibc/src/component/ibc_component.rs | 2 +- .../ibc/src/component/ics02_validation.rs | 2 +- .../component/ibc/src/component/metrics.rs | 2 +- .../msg_handler/connection_open_ack.rs | 10 +-- .../msg_handler/connection_open_try.rs | 10 +-- .../component/ibc/src/component/state_key.rs | 2 +- .../core/component/ibc/src/component/view.rs | 2 +- crates/core/component/ibc/src/genesis.rs | 2 +- crates/core/component/ibc/src/ibc_action.rs | 6 +- crates/core/component/ibc/src/ibc_token.rs | 2 +- crates/core/component/ibc/src/params.rs | 4 +- .../core/component/sct/src/component/clock.rs | 2 +- .../core/component/sct/src/component/rpc.rs | 4 +- .../core/component/sct/src/component/sct.rs | 2 +- .../core/component/sct/src/component/tree.rs | 4 +- crates/core/component/sct/src/epoch.rs | 4 +- crates/core/component/sct/src/event.rs | 4 +- crates/core/component/sct/src/genesis.rs | 2 +- .../component/sct/src/nullification_info.rs | 2 +- crates/core/component/sct/src/nullifier.rs | 10 +-- crates/core/component/sct/src/params.rs | 4 +- crates/core/component/sct/src/source.rs | 2 +- crates/core/component/sct/src/state_key.rs | 4 +- .../component/shielded-pool/src/backref.rs | 14 ++-- .../action_handler/ics20_withdrawal.rs | 2 +- .../src/component/action_handler/output.rs | 6 +- .../src/component/action_handler/spend.rs | 8 +- .../shielded-pool/src/component/assets.rs | 4 +- .../shielded-pool/src/component/fmd.rs | 4 +- .../ics20_withdrawal_with_handler.rs | 2 +- .../shielded-pool/src/component/metrics.rs | 2 +- .../src/component/note_manager.rs | 10 +-- .../shielded-pool/src/component/rpc.rs | 4 +- .../src/component/rpc/bank_query.rs | 8 +- .../src/component/rpc/transfer_query.rs | 4 +- .../src/component/shielded_pool.rs | 6 +- .../shielded-pool/src/component/transfer.rs | 14 ++-- .../component/shielded-pool/src/convert.rs | 6 +- .../core/component/shielded-pool/src/event.rs | 8 +- .../core/component/shielded-pool/src/fmd.rs | 2 +- .../component/shielded-pool/src/genesis.rs | 10 +-- .../shielded-pool/src/genesis/allocation.rs | 8 +- .../shielded-pool/src/ics20_withdrawal.rs | 12 +-- .../core/component/shielded-pool/src/note.rs | 12 +-- .../component/shielded-pool/src/note/r1cs.rs | 6 +- .../shielded-pool/src/note_payload.rs | 6 +- .../shielded-pool/src/nullifier_derivation.rs | 20 ++--- .../shielded-pool/src/output/action.rs | 8 +- .../shielded-pool/src/output/plan.rs | 16 ++-- .../shielded-pool/src/output/proof.rs | 18 ++--- .../shielded-pool/src/output/view.rs | 4 +- .../component/shielded-pool/src/params.rs | 4 +- .../core/component/shielded-pool/src/rseed.rs | 2 +- .../shielded-pool/src/spend/action.rs | 8 +- .../component/shielded-pool/src/spend/plan.rs | 12 +-- .../shielded-pool/src/spend/proof.rs | 30 ++++---- .../component/shielded-pool/src/spend/view.rs | 2 +- .../component/shielded-pool/src/state_key.rs | 2 +- crates/core/component/stake/src/changes.rs | 2 +- .../src/component/action_handler/delegate.rs | 6 +- .../component/action_handler/undelegate.rs | 6 +- .../action_handler/undelegate_claim.rs | 4 +- .../action_handler/validator_definition.rs | 2 +- .../stake/src/component/epoch_handler.rs | 8 +- .../component/stake/src/component/metrics.rs | 2 +- .../core/component/stake/src/component/rpc.rs | 2 +- .../component/stake/src/component/stake.rs | 8 +- .../validator_handler/uptime_tracker.rs | 4 +- .../validator_handler/validator_manager.rs | 10 +-- .../validator_handler/validator_store.rs | 4 +- .../stake/src/current_consensus_keys.rs | 2 +- crates/core/component/stake/src/delegate.rs | 8 +- .../component/stake/src/delegation_token.rs | 2 +- crates/core/component/stake/src/event.rs | 4 +- .../component/stake/src/funding_stream.rs | 6 +- crates/core/component/stake/src/genesis.rs | 2 +- .../component/stake/src/governance_key.rs | 2 +- .../core/component/stake/src/identity_key.rs | 2 +- crates/core/component/stake/src/lib.rs | 2 +- crates/core/component/stake/src/params.rs | 6 +- crates/core/component/stake/src/penalty.rs | 6 +- crates/core/component/stake/src/rate.rs | 10 +-- .../component/stake/src/unbonding_token.rs | 2 +- crates/core/component/stake/src/undelegate.rs | 10 +-- .../stake/src/undelegate_claim/action.rs | 6 +- .../stake/src/undelegate_claim/plan.rs | 8 +- .../stake/src/undelegate_claim/proof.rs | 16 ++-- crates/core/component/stake/src/uptime.rs | 2 +- crates/core/component/stake/src/validator.rs | 4 +- .../component/stake/src/validator/bonding.rs | 2 +- .../stake/src/validator/definition.rs | 4 +- .../component/stake/src/validator/info.rs | 2 +- .../component/stake/src/validator/state.rs | 2 +- .../component/stake/src/validator/status.rs | 4 +- crates/core/keys/src/address.rs | 4 +- crates/core/keys/src/address/view.rs | 2 +- crates/core/keys/src/keys/diversifier.rs | 4 +- crates/core/keys/src/keys/fvk.rs | 2 +- crates/core/keys/src/keys/spend.rs | 6 +- crates/core/keys/src/keys/wallet_id.rs | 4 +- crates/core/keys/src/symmetric.rs | 14 ++-- crates/core/keys/tests/test_wallet_id.rs | 4 +- crates/core/num/src/amount.rs | 4 +- crates/core/transaction/src/action.rs | 50 ++++++------ crates/core/transaction/src/action_list.rs | 10 +-- crates/core/transaction/src/auth_data.rs | 4 +- crates/core/transaction/src/detection_data.rs | 6 +- crates/core/transaction/src/gas.rs | 18 ++--- crates/core/transaction/src/is_action.rs | 16 ++-- crates/core/transaction/src/lib.rs | 2 +- crates/core/transaction/src/memo.rs | 14 ++-- crates/core/transaction/src/parameters.rs | 8 +- crates/core/transaction/src/plan.rs | 36 ++++----- crates/core/transaction/src/plan/action.rs | 36 ++++----- crates/core/transaction/src/plan/auth.rs | 2 +- crates/core/transaction/src/plan/build.rs | 8 +- crates/core/transaction/src/plan/clue.rs | 4 +- .../transaction/src/plan/detection_data.rs | 2 +- crates/core/transaction/src/plan/memo.rs | 4 +- crates/core/transaction/src/plan/spend.rs | 4 +- crates/core/transaction/src/transaction.rs | 28 +++---- crates/core/transaction/src/view.rs | 66 ++++++++-------- .../core/transaction/src/view/action_view.rs | 24 +++--- .../src/view/transaction_perspective.rs | 16 ++-- crates/core/transaction/src/witness_data.rs | 6 +- ...nerate_transaction_signing_test_vectors.rs | 46 +++++------ crates/core/txhash/src/context.rs | 2 +- crates/core/txhash/src/effect_hash.rs | 2 +- crates/core/txhash/src/transaction_id.rs | 2 +- crates/crypto/decaf377-frost/src/keys/dkg.rs | 6 +- crates/crypto/decaf377-frost/src/lib.rs | 6 +- crates/crypto/proof-setup/benches/all.rs | 2 +- crates/crypto/proof-setup/src/all.rs | 10 +-- crates/crypto/tct/src/block.rs | 2 +- crates/crypto/tct/src/commitment.rs | 2 +- crates/crypto/tct/src/epoch.rs | 2 +- crates/crypto/tct/src/internal/path.rs | 2 +- crates/crypto/tct/src/internal/proof.rs | 2 +- crates/crypto/tct/src/proof.rs | 4 +- crates/crypto/tct/src/tree.rs | 2 +- crates/custody/src/client.rs | 4 +- crates/custody/src/encrypted.rs | 2 +- crates/custody/src/null_kms.rs | 2 +- crates/custody/src/policy.rs | 10 +-- crates/custody/src/pre_auth.rs | 2 +- crates/custody/src/request.rs | 8 +- crates/custody/src/soft_kms.rs | 6 +- crates/custody/src/soft_kms/config.rs | 4 +- crates/custody/src/terminal.rs | 8 +- crates/custody/src/threshold.rs | 8 +- crates/custody/src/threshold/config.rs | 2 +- crates/custody/src/threshold/dkg.rs | 2 +- crates/custody/src/threshold/sign.rs | 10 +-- crates/misc/measure/src/main.rs | 8 +- .../tct-visualize/src/bin/tct-live-edit.rs | 2 +- .../tct-visualize/src/bin/tct-visualize.rs | 2 +- crates/misc/tct-visualize/src/live.rs | 2 +- crates/misc/tct-visualize/src/live/control.rs | 2 +- crates/misc/tct-visualize/src/live/query.rs | 2 +- crates/misc/tct-visualize/src/live/view.rs | 2 +- crates/misc/tct-visualize/src/render.rs | 2 +- .../proto/src/gen/penumbra.core.asset.v1.rs | 2 +- .../src/gen/penumbra.core.asset.v1.serde.rs | 16 ++-- crates/proto/src/lib.rs | 2 +- .../proto/src/protobuf/tendermint_compat.rs | 24 +++--- crates/test/mock-client/src/lib.rs | 28 +++---- .../test/mock-tendermint-proxy/src/proxy.rs | 12 +-- crates/test/mock-tendermint-proxy/src/stub.rs | 2 +- crates/test/tct-property-test/src/lib.rs | 2 +- .../test/tct-property-test/tests/serialize.rs | 2 +- .../tct-property-test/tests/simulate/mod.rs | 2 +- crates/test/tct-property-test/tests/spec.rs | 2 +- .../test/tct-property-test/tests/witness.rs | 2 +- crates/test/tracing-subscriber/src/lib.rs | 2 +- .../tendermint-proxy/src/tendermint_proxy.rs | 4 +- crates/view/src/client.rs | 28 +++---- crates/view/src/lib.rs | 2 +- crates/view/src/metrics.rs | 2 +- crates/view/src/note_record.rs | 12 +-- crates/view/src/planner.rs | 34 ++++----- crates/view/src/service.rs | 36 ++++----- crates/view/src/status.rs | 2 +- crates/view/src/storage.rs | 30 ++++---- crates/view/src/storage/sct.rs | 12 +-- crates/view/src/swap_record.rs | 8 +- crates/view/src/sync.rs | 14 ++-- crates/view/src/transaction_info.rs | 2 +- crates/view/src/worker.rs | 40 +++++----- crates/wallet/src/build.rs | 8 +- crates/wallet/src/plan.rs | 12 +-- tools/parameter-setup/src/main.rs | 10 +-- tools/proto-compiler/src/main.rs | 2 +- tools/summonerd/src/main.rs | 16 ++-- tools/summonerd/src/participant.rs | 6 +- tools/summonerd/src/penumbra_knower.rs | 8 +- tools/summonerd/src/phase.rs | 6 +- tools/summonerd/src/queue.rs | 4 +- tools/summonerd/src/server.rs | 4 +- tools/summonerd/src/storage.rs | 8 +- tools/summonerd/src/web.rs | 2 +- 479 files changed, 2311 insertions(+), 2311 deletions(-) diff --git a/crates/bench/benches/convert.rs b/crates/bench/benches/convert.rs index 1e6bfc98d6..dd911a46ec 100644 --- a/crates/bench/benches/convert.rs +++ b/crates/bench/benches/convert.rs @@ -2,10 +2,10 @@ use ark_relations::r1cs::{ ConstraintSynthesizer, ConstraintSystem, OptimizationGoal, SynthesisMode, }; use decaf377::{Fq, Fr}; -use penumbra_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::{fixpoint::U128x128, Amount}; -use penumbra_proof_params::{DummyWitness, CONVERT_PROOF_PROVING_KEY}; -use penumbra_shielded_pool::{ +use penumbra_sdk_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_proof_params::{DummyWitness, CONVERT_PROOF_PROVING_KEY}; +use penumbra_sdk_shielded_pool::{ ConvertCircuit, ConvertProof, ConvertProofPrivate, ConvertProofPublic, }; diff --git a/crates/bench/benches/delegator_vote.rs b/crates/bench/benches/delegator_vote.rs index db70596186..21294486ef 100644 --- a/crates/bench/benches/delegator_vote.rs +++ b/crates/bench/benches/delegator_vote.rs @@ -5,15 +5,15 @@ use ark_relations::r1cs::{ }; use decaf377::{Fq, Fr}; use decaf377_rdsa::{SpendAuth, VerificationKey}; -use penumbra_asset::Value; -use penumbra_governance::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_governance::{ DelegatorVoteCircuit, DelegatorVoteProof, DelegatorVoteProofPrivate, DelegatorVoteProofPublic, }; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_proof_params::{DummyWitness, DELEGATOR_VOTE_PROOF_PROVING_KEY}; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::Note; -use penumbra_tct as tct; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_proof_params::{DummyWitness, DELEGATOR_VOTE_PROOF_PROVING_KEY}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::Note; +use penumbra_sdk_tct as tct; use criterion::{criterion_group, criterion_main, Criterion}; use rand_core::OsRng; diff --git a/crates/bench/benches/nullifier_derivation.rs b/crates/bench/benches/nullifier_derivation.rs index 986121c15c..35f0e4b2fd 100644 --- a/crates/bench/benches/nullifier_derivation.rs +++ b/crates/bench/benches/nullifier_derivation.rs @@ -4,15 +4,15 @@ use ark_relations::r1cs::{ ConstraintSynthesizer, ConstraintSystem, OptimizationGoal, SynthesisMode, }; use decaf377::Fq; -use penumbra_asset::Value; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_proof_params::{DummyWitness, NULLIFIER_DERIVATION_PROOF_PROVING_KEY}; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_proof_params::{DummyWitness, NULLIFIER_DERIVATION_PROOF_PROVING_KEY}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{ Note, NullifierDerivationProofPrivate, NullifierDerivationProofPublic, Rseed, }; -use penumbra_shielded_pool::{NullifierDerivationCircuit, NullifierDerivationProof}; -use penumbra_tct as tct; +use penumbra_sdk_shielded_pool::{NullifierDerivationCircuit, NullifierDerivationProof}; +use penumbra_sdk_tct as tct; use criterion::{criterion_group, criterion_main, Criterion}; use rand_core::OsRng; diff --git a/crates/bench/benches/output.rs b/crates/bench/benches/output.rs index b236983ac5..9b04319fd7 100644 --- a/crates/bench/benches/output.rs +++ b/crates/bench/benches/output.rs @@ -6,10 +6,10 @@ use ark_relations::r1cs::{ use decaf377::{Fq, Fr}; use decaf377_fmd as fmd; use decaf377_ka as ka; -use penumbra_asset::{Balance, Value}; -use penumbra_keys::{keys::Diversifier, Address}; -use penumbra_proof_params::{DummyWitness, OUTPUT_PROOF_PROVING_KEY}; -use penumbra_shielded_pool::{ +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_keys::{keys::Diversifier, Address}; +use penumbra_sdk_proof_params::{DummyWitness, OUTPUT_PROOF_PROVING_KEY}; +use penumbra_sdk_shielded_pool::{ output::{OutputProofPrivate, OutputProofPublic}, Note, OutputCircuit, OutputProof, Rseed, }; diff --git a/crates/bench/benches/spend.rs b/crates/bench/benches/spend.rs index f30197e9c6..70f8f9fc9b 100644 --- a/crates/bench/benches/spend.rs +++ b/crates/bench/benches/spend.rs @@ -5,12 +5,12 @@ use ark_relations::r1cs::{ }; use decaf377::{Fq, Fr}; use decaf377_rdsa::{SpendAuth, VerificationKey}; -use penumbra_asset::Value; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_proof_params::{DummyWitness, SPEND_PROOF_PROVING_KEY}; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{Note, SpendCircuit, SpendProof, SpendProofPrivate, SpendProofPublic}; -use penumbra_tct as tct; +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_proof_params::{DummyWitness, SPEND_PROOF_PROVING_KEY}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{Note, SpendCircuit, SpendProof, SpendProofPrivate, SpendProofPublic}; +use penumbra_sdk_tct as tct; use criterion::{criterion_group, criterion_main, Criterion}; use rand_core::OsRng; diff --git a/crates/bench/benches/swap.rs b/crates/bench/benches/swap.rs index e2d4804eaf..b15a56ace8 100644 --- a/crates/bench/benches/swap.rs +++ b/crates/bench/benches/swap.rs @@ -2,16 +2,16 @@ use ark_relations::r1cs::{ ConstraintSynthesizer, ConstraintSystem, OptimizationGoal, SynthesisMode, }; use decaf377::{Fq, Fr}; -use penumbra_asset::{asset, Balance, Value}; -use penumbra_dex::{ +use penumbra_sdk_asset::{asset, Balance, Value}; +use penumbra_sdk_dex::{ swap::proof::{SwapCircuit, SwapProof, SwapProofPublic}, swap::{proof::SwapProofPrivate, SwapPlaintext}, TradingPair, }; -use penumbra_fee::Fee; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_num::Amount; -use penumbra_proof_params::{DummyWitness, SWAP_PROOF_PROVING_KEY}; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_params::{DummyWitness, SWAP_PROOF_PROVING_KEY}; use criterion::{criterion_group, criterion_main, Criterion}; use rand_core::OsRng; diff --git a/crates/bench/benches/swap_claim.rs b/crates/bench/benches/swap_claim.rs index a4d3ef0658..3c50cb7a77 100644 --- a/crates/bench/benches/swap_claim.rs +++ b/crates/bench/benches/swap_claim.rs @@ -2,18 +2,18 @@ use ark_relations::r1cs::{ ConstraintSynthesizer, ConstraintSystem, OptimizationGoal, SynthesisMode, }; use decaf377::Fq; -use penumbra_asset::asset; -use penumbra_dex::{ +use penumbra_sdk_asset::asset; +use penumbra_sdk_dex::{ swap::SwapPlaintext, swap_claim::{SwapClaimCircuit, SwapClaimProof, SwapClaimProofPrivate, SwapClaimProofPublic}, BatchSwapOutputData, TradingPair, }; -use penumbra_fee::Fee; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_num::Amount; -use penumbra_proof_params::{DummyWitness, SWAPCLAIM_PROOF_PROVING_KEY}; -use penumbra_sct::Nullifier; -use penumbra_tct as tct; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_params::{DummyWitness, SWAPCLAIM_PROOF_PROVING_KEY}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct as tct; use criterion::{criterion_group, criterion_main, Criterion}; use rand_core::OsRng; diff --git a/crates/bin/pcli/src/command/init.rs b/crates/bin/pcli/src/command/init.rs index 1a79ccf923..936a2d3788 100644 --- a/crates/bin/pcli/src/command/init.rs +++ b/crates/bin/pcli/src/command/init.rs @@ -5,8 +5,8 @@ use std::{ use anyhow::Result; use camino::Utf8PathBuf; -use penumbra_custody::threshold; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_custody::threshold; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; use rand_core::OsRng; use termion::screen::IntoAlternateScreen; use url::Url; @@ -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_NODE_PD_URL", + env = "penumbra_sdk_NODE_PD_URL", parse(try_from_str = Url::parse), )] grpc_url: Url, @@ -310,9 +310,9 @@ impl InitCmd { spend_key.full_viewing_key().clone(), if self.encrypted { let password = ActualTerminal::get_confirmed_password().await?; - CustodyConfig::Encrypted(penumbra_custody::encrypted::Config::create( + CustodyConfig::Encrypted(penumbra_sdk_custody::encrypted::Config::create( &password, - penumbra_custody::encrypted::InnerConfig::SoftKms(spend_key.into()), + penumbra_sdk_custody::encrypted::InnerConfig::SoftKms(spend_key.into()), )?) } else { CustodyConfig::SoftKms(spend_key.into()) @@ -333,9 +333,9 @@ impl InitCmd { let fvk = config.fvk().clone(); let custody_config = if self.encrypted { let password = ActualTerminal::get_confirmed_password().await?; - CustodyConfig::Encrypted(penumbra_custody::encrypted::Config::create( + CustodyConfig::Encrypted(penumbra_sdk_custody::encrypted::Config::create( &password, - penumbra_custody::encrypted::InnerConfig::Threshold(config), + penumbra_sdk_custody::encrypted::InnerConfig::Threshold(config), )?) } else { CustodyConfig::Threshold(config) @@ -373,16 +373,16 @@ impl InitCmd { x @ CustodyConfig::Encrypted(_) => x, CustodyConfig::SoftKms(spend_key) => { let password = ActualTerminal::get_confirmed_password().await?; - CustodyConfig::Encrypted(penumbra_custody::encrypted::Config::create( + CustodyConfig::Encrypted(penumbra_sdk_custody::encrypted::Config::create( &password, - penumbra_custody::encrypted::InnerConfig::SoftKms(spend_key), + penumbra_sdk_custody::encrypted::InnerConfig::SoftKms(spend_key), )?) } CustodyConfig::Threshold(c) => { let password = ActualTerminal::get_confirmed_password().await?; - CustodyConfig::Encrypted(penumbra_custody::encrypted::Config::create( + CustodyConfig::Encrypted(penumbra_sdk_custody::encrypted::Config::create( &password, - penumbra_custody::encrypted::InnerConfig::Threshold(c), + penumbra_sdk_custody::encrypted::InnerConfig::Threshold(c), )?) } }; diff --git a/crates/bin/pcli/src/command/migrate.rs b/crates/bin/pcli/src/command/migrate.rs index 4ef7228dd4..efeaa7235e 100644 --- a/crates/bin/pcli/src/command/migrate.rs +++ b/crates/bin/pcli/src/command/migrate.rs @@ -1,11 +1,11 @@ use crate::App; use anyhow::{anyhow, Context, Result}; -use penumbra_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_keys::FullViewingKey; -use penumbra_num::Amount; -use penumbra_proto::view::v1::GasPricesRequest; -use penumbra_view::ViewClient; -use penumbra_wallet::plan::Planner; +use penumbra_sdk_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::view::v1::GasPricesRequest; +use penumbra_sdk_view::ViewClient; +use penumbra_sdk_wallet::plan::Planner; use rand_core::OsRng; use std::{collections::HashMap, io::Write}; use termion::input::TermRead; diff --git a/crates/bin/pcli/src/command/query.rs b/crates/bin/pcli/src/command/query.rs index 8fe1cfe66f..119d33453b 100644 --- a/crates/bin/pcli/src/command/query.rs +++ b/crates/bin/pcli/src/command/query.rs @@ -18,7 +18,7 @@ use community_pool::CommunityPoolCmd; use dex::DexCmd; use governance::GovernanceCmd; use ibc_query::IbcCmd; -use penumbra_proto::cnidarium::v1::non_verifiable_key_value_request::Key as NVKey; +use penumbra_sdk_proto::cnidarium::v1::non_verifiable_key_value_request::Key as NVKey; use shielded_pool::ShieldedPool; use tx::Tx; pub(super) use validator::ValidatorCmd; @@ -141,7 +141,7 @@ impl QueryCmd { // TODO: this is a hack; we should replace all raw state key uses with RPC methods. if let QueryCmd::ShieldedPool(ShieldedPool::CompactBlock { height }) = self { - use penumbra_proto::core::component::compact_block::v1::{ + use penumbra_sdk_proto::core::component::compact_block::v1::{ query_service_client::QueryServiceClient as CompactBlockQueryServiceClient, CompactBlockRequest, }; @@ -177,7 +177,7 @@ impl QueryCmd { } => (key.clone(), storage_backend.clone()), }; - use penumbra_proto::cnidarium::v1::query_service_client::QueryServiceClient; + use penumbra_sdk_proto::cnidarium::v1::query_service_client::QueryServiceClient; let mut client = QueryServiceClient::new(app.pd_channel().await?); // Using an enum in the clap arguments was annoying; this is workable: @@ -187,7 +187,7 @@ impl QueryCmd { .decode(&key) .map_err(|e| anyhow::anyhow!(format!("invalid base64: {}", e)))?; - let req = penumbra_proto::cnidarium::v1::NonVerifiableKeyValueRequest { + let req = penumbra_sdk_proto::cnidarium::v1::NonVerifiableKeyValueRequest { key: Some(NVKey { inner: key_bytes }), ..Default::default() }; @@ -205,7 +205,7 @@ impl QueryCmd { } // Default to JMT "jmt" | _ => { - let req = penumbra_proto::cnidarium::v1::KeyValueRequest { + let req = penumbra_sdk_proto::cnidarium::v1::KeyValueRequest { key: key.clone(), // Command-line queries don't have a reason to include proofs as of now. proof: false, @@ -269,12 +269,12 @@ impl QueryCmd { // this code (not just this function, the whole module) is pretty shitty, // but that's maybe okay for the moment. it exists to consume the rpc. async fn watch(key_regex: String, nv_key_regex: String, app: &mut App) -> Result<()> { - use penumbra_proto::cnidarium::v1::{ + use penumbra_sdk_proto::cnidarium::v1::{ query_service_client::QueryServiceClient, watch_response as wr, }; let mut client = QueryServiceClient::new(app.pd_channel().await?); - let req = penumbra_proto::cnidarium::v1::WatchRequest { + let req = penumbra_sdk_proto::cnidarium::v1::WatchRequest { key_regex, nv_key_regex, }; diff --git a/crates/bin/pcli/src/command/query/auction.rs b/crates/bin/pcli/src/command/query/auction.rs index d75d1536a6..d7c250d699 100644 --- a/crates/bin/pcli/src/command/query/auction.rs +++ b/crates/bin/pcli/src/command/query/auction.rs @@ -3,21 +3,21 @@ use crate::App; use clap::Subcommand; use comfy_table::{presets, Table}; use comfy_table::{Cell, ContentArrangement}; -use penumbra_asset::asset::Cache; -use penumbra_asset::Value; -use penumbra_auction::auction::dutch::DutchAuction; -use penumbra_auction::auction::AuctionId; -use penumbra_dex::lp::position::{self, Position}; -use penumbra_num::fixpoint::U128x128; -use penumbra_num::Amount; -use penumbra_proto::core::component::auction::v1 as pb_auction; -use penumbra_proto::core::component::auction::v1::query_service_client::QueryServiceClient as AuctionQueryServiceClient; -use penumbra_proto::core::component::auction::v1::AuctionStateByIdRequest; -use penumbra_proto::core::component::dex::v1::query_service_client::QueryServiceClient as DexQueryServiceClient; -use penumbra_proto::core::component::dex::v1::LiquidityPositionByIdRequest; -use penumbra_proto::DomainType; -use penumbra_proto::Name; -use penumbra_view::ViewClient; +use penumbra_sdk_asset::asset::Cache; +use penumbra_sdk_asset::Value; +use penumbra_sdk_auction::auction::dutch::DutchAuction; +use penumbra_sdk_auction::auction::AuctionId; +use penumbra_sdk_dex::lp::position::{self, Position}; +use penumbra_sdk_num::fixpoint::U128x128; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::auction::v1 as pb_auction; +use penumbra_sdk_proto::core::component::auction::v1::query_service_client::QueryServiceClient as AuctionQueryServiceClient; +use penumbra_sdk_proto::core::component::auction::v1::AuctionStateByIdRequest; +use penumbra_sdk_proto::core::component::dex::v1::query_service_client::QueryServiceClient as DexQueryServiceClient; +use penumbra_sdk_proto::core::component::dex::v1::LiquidityPositionByIdRequest; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_proto::Name; +use penumbra_sdk_view::ViewClient; #[derive(Debug, Subcommand)] pub enum AuctionCmd { diff --git a/crates/bin/pcli/src/command/query/chain.rs b/crates/bin/pcli/src/command/query/chain.rs index 025efa58c5..97fcfb53cd 100644 --- a/crates/bin/pcli/src/command/query/chain.rs +++ b/crates/bin/pcli/src/command/query/chain.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Context, Result}; use comfy_table::{presets, Table}; use futures::TryStreamExt; -use penumbra_app::params::AppParameters; -use penumbra_proto::{ +use penumbra_sdk_app::params::AppParameters; +use penumbra_sdk_proto::{ core::{ app::v1::{ query_service_client::QueryServiceClient as AppQueryServiceClient, AppParametersRequest, @@ -24,7 +24,7 @@ use penumbra_proto::{ }, Message, }; -use penumbra_stake::validator; +use penumbra_sdk_stake::validator; use crate::App; diff --git a/crates/bin/pcli/src/command/query/community_pool.rs b/crates/bin/pcli/src/command/query/community_pool.rs index 404e1d7d1c..777165ea94 100644 --- a/crates/bin/pcli/src/command/query/community_pool.rs +++ b/crates/bin/pcli/src/command/query/community_pool.rs @@ -1,12 +1,12 @@ use crate::App; use anyhow::{Context, Result}; use futures::TryStreamExt; -use penumbra_asset::Value; -use penumbra_proto::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_proto::{ core::component::community_pool::v1::CommunityPoolAssetBalancesRequest, penumbra::core::component::community_pool::v1::query_service_client::QueryServiceClient as CommunityPoolQueryServiceClient, }; -use penumbra_view::ViewClient; +use penumbra_sdk_view::ViewClient; use std::io::{stdout, Write}; #[derive(Debug, clap::Subcommand)] @@ -31,7 +31,7 @@ impl CommunityPoolCmd { if let Ok(asset_id) = asset.parse() { asset_id } else { - penumbra_asset::asset::REGISTRY + penumbra_sdk_asset::asset::REGISTRY .parse_unit(asset.as_str()) .id() } diff --git a/crates/bin/pcli/src/command/query/dex.rs b/crates/bin/pcli/src/command/query/dex.rs index f963980179..98063b596c 100644 --- a/crates/bin/pcli/src/command/query/dex.rs +++ b/crates/bin/pcli/src/command/query/dex.rs @@ -3,12 +3,12 @@ use comfy_table::{presets, Table}; use futures::{Stream, StreamExt, TryStreamExt}; use std::pin::Pin; -use penumbra_asset::{asset, asset::Metadata, Value}; -use penumbra_dex::{ +use penumbra_sdk_asset::{asset, asset::Metadata, Value}; +use penumbra_sdk_dex::{ lp::position::{self, Position}, BatchSwapOutputData, DirectedTradingPair, SwapExecution, TradingPair, }; -use penumbra_proto::core::component::{ +use penumbra_sdk_proto::core::component::{ dex::v1::{ query_service_client::QueryServiceClient as DexQueryServiceClient, simulation_service_client::SimulationServiceClient, ArbExecutionRequest, @@ -20,7 +20,7 @@ use penumbra_proto::core::component::{ AssetMetadataByIdRequest, }, }; -use penumbra_view::ViewClient; +use penumbra_sdk_view::ViewClient; use tonic::transport::Channel; use crate::{ @@ -154,7 +154,7 @@ impl DexCmd { input: Value, output: asset::Id, ) -> Result { - use penumbra_proto::core::component::dex::v1::simulate_trade_request::{ + use penumbra_sdk_proto::core::component::dex::v1::simulate_trade_request::{ routing::Setting, Routing, }; let mut client = SimulationServiceClient::new(app.pd_channel().await?); @@ -248,7 +248,7 @@ impl DexCmd { table.set_header(headers); let price_string = |input: Value, output: Value| -> String { - use penumbra_dex::lp::SellOrder; + use penumbra_sdk_dex::lp::SellOrder; format!( "{}/{}", SellOrder { diff --git a/crates/bin/pcli/src/command/query/governance.rs b/crates/bin/pcli/src/command/query/governance.rs index ec8241f5cf..93a0decb65 100644 --- a/crates/bin/pcli/src/command/query/governance.rs +++ b/crates/bin/pcli/src/command/query/governance.rs @@ -5,14 +5,14 @@ use std::{ use anyhow::{Context, Result}; use futures::TryStreamExt; -use penumbra_governance::Vote; -use penumbra_proto::core::component::governance::v1::{ +use penumbra_sdk_governance::Vote; +use penumbra_sdk_proto::core::component::governance::v1::{ query_service_client::QueryServiceClient as GovernanceQueryServiceClient, AllTalliedDelegatorVotesForProposalRequest, ProposalDataRequest, ProposalListRequest, ProposalListResponse, ValidatorVotesRequest, ValidatorVotesResponse, VotingPowerAtProposalStartRequest, }; -use penumbra_stake::IdentityKey; +use penumbra_sdk_stake::IdentityKey; use serde::Serialize; use serde_json::json; @@ -169,7 +169,7 @@ impl GovernanceCmd { let mut delegator_tallies: BTreeMap< IdentityKey, - penumbra_governance::Tally, + penumbra_sdk_governance::Tally, > = client .all_tallied_delegator_votes_for_proposal( AllTalliedDelegatorVotesForProposalRequest { @@ -184,11 +184,11 @@ impl GovernanceCmd { .identity_key .expect("identity key must be set for vote response") .try_into()?; - let tally: penumbra_governance::Tally = response + let tally: penumbra_sdk_governance::Tally = response .tally .expect("tally must be set for vote response") .try_into()?; - Ok::<(IdentityKey, penumbra_governance::Tally), anyhow::Error>(( + Ok::<(IdentityKey, penumbra_sdk_governance::Tally), anyhow::Error>(( identity_key, tally, )) @@ -201,7 +201,7 @@ impl GovernanceCmd { .collect::>>()?; // Combine the two mappings - let mut total = penumbra_governance::Tally::default(); + let mut total = penumbra_sdk_governance::Tally::default(); let mut all_votes_and_power: BTreeMap = BTreeMap::new(); for (identity_key, (vote, power)) in validator_votes_and_power.into_iter() { @@ -222,7 +222,7 @@ impl GovernanceCmd { }; // Subtract delegator total from validator power, then add delegator // tally in to get the total tally for this validator: - let sub_total = penumbra_governance::Tally::from(( + let sub_total = penumbra_sdk_governance::Tally::from(( vote, power - delegator_tally.total(), )) + delegator_tally; @@ -261,7 +261,7 @@ fn json(value: &T) -> Result<()> { Ok(()) } -fn json_tally(tally: &penumbra_governance::Tally) -> serde_json::Value { +fn json_tally(tally: &penumbra_sdk_governance::Tally) -> serde_json::Value { let mut map = serde_json::Map::new(); if tally.yes() > 0 { map.insert("yes".to_string(), tally.yes().into()); diff --git a/crates/bin/pcli/src/command/query/shielded_pool.rs b/crates/bin/pcli/src/command/query/shielded_pool.rs index 68f8f81b2d..6f900778e2 100644 --- a/crates/bin/pcli/src/command/query/shielded_pool.rs +++ b/crates/bin/pcli/src/command/query/shielded_pool.rs @@ -1,8 +1,8 @@ use anyhow::Result; use colored_json::prelude::*; -use penumbra_proto::DomainType; -use penumbra_sct::{CommitmentSource, NullificationInfo, Nullifier}; -use penumbra_tct::StateCommitment; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_sct::{CommitmentSource, NullificationInfo, Nullifier}; +use penumbra_sdk_tct::StateCommitment; #[derive(Debug, clap::Subcommand)] pub enum ShieldedPool { @@ -29,7 +29,7 @@ pub enum ShieldedPool { impl ShieldedPool { pub fn key(&self) -> String { - use penumbra_sct::state_key as sct_state_key; + use penumbra_sdk_sct::state_key as sct_state_key; match self { ShieldedPool::Anchor { height } => sct_state_key::tree::anchor_by_height(*height), ShieldedPool::CompactBlock { .. } => { @@ -45,7 +45,7 @@ impl ShieldedPool { pub fn display_value(&self, bytes: &[u8]) -> Result<()> { let json = match self { ShieldedPool::Anchor { .. } => { - let anchor = penumbra_tct::Root::decode(bytes)?; + let anchor = penumbra_sdk_tct::Root::decode(bytes)?; serde_json::to_string_pretty(&anchor)? } ShieldedPool::CompactBlock { .. } => { diff --git a/crates/bin/pcli/src/command/query/tx.rs b/crates/bin/pcli/src/command/query/tx.rs index 27d8e353e4..ea0b846d47 100644 --- a/crates/bin/pcli/src/command/query/tx.rs +++ b/crates/bin/pcli/src/command/query/tx.rs @@ -1,7 +1,7 @@ use anyhow::Result; use colored_json::prelude::*; -use penumbra_proto::{util::tendermint_proxy::v1::GetTxRequest, DomainType}; -use penumbra_transaction::Transaction; +use penumbra_sdk_proto::{util::tendermint_proxy::v1::GetTxRequest, DomainType}; +use penumbra_sdk_transaction::Transaction; use crate::App; diff --git a/crates/bin/pcli/src/command/query/validator.rs b/crates/bin/pcli/src/command/query/validator.rs index 4527c0b1c2..099ccff072 100644 --- a/crates/bin/pcli/src/command/query/validator.rs +++ b/crates/bin/pcli/src/command/query/validator.rs @@ -9,9 +9,9 @@ use anyhow::{anyhow, Context, Error, Result}; use colored::Colorize; use comfy_table::{presets, Table}; use futures::TryStreamExt; -use penumbra_app::params::AppParameters; -use penumbra_num::{fixpoint::U128x128, Amount}; -use penumbra_proto::{ +use penumbra_sdk_app::params::AppParameters; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_proto::{ core::{ app::v1::{ query_service_client::QueryServiceClient as AppQueryServiceClient, AppParametersRequest, @@ -24,7 +24,7 @@ use penumbra_proto::{ }, DomainType, }; -use penumbra_stake::{ +use penumbra_sdk_stake::{ rate::RateData, validator::{self, Info, Status, Validator, ValidatorToml}, IdentityKey, Uptime, BPS_SQUARED_SCALING_FACTOR, diff --git a/crates/bin/pcli/src/command/threshold.rs b/crates/bin/pcli/src/command/threshold.rs index 16c725bb5d..b37d9c9b9a 100644 --- a/crates/bin/pcli/src/command/threshold.rs +++ b/crates/bin/pcli/src/command/threshold.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use penumbra_custody::threshold::Terminal; +use penumbra_sdk_custody::threshold::Terminal; use crate::{ config::{CustodyConfig, GovernanceCustodyConfig}, @@ -39,7 +39,7 @@ impl ThresholdCmd { }; match self { ThresholdCmd::Sign => { - penumbra_custody::threshold::follow( + penumbra_sdk_custody::threshold::follow( config.as_ref(), governance_config.as_ref(), &ActualTerminal::default(), diff --git a/crates/bin/pcli/src/command/tx.rs b/crates/bin/pcli/src/command/tx.rs index 3b5a943941..0a4cccd2c9 100644 --- a/crates/bin/pcli/src/command/tx.rs +++ b/crates/bin/pcli/src/command/tx.rs @@ -26,13 +26,13 @@ use rand_core::OsRng; use regex::Regex; use liquidity_position::PositionCmd; -use penumbra_asset::{asset, asset::Metadata, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_dex::{lp::position, swap_claim::SwapClaimPlan}; -use penumbra_fee::FeeTier; -use penumbra_governance::{proposal::ProposalToml, proposal_state::State as ProposalState, Vote}; -use penumbra_keys::{keys::AddressIndex, Address}; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_asset::{asset, asset::Metadata, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_dex::{lp::position, swap_claim::SwapClaimPlan}; +use penumbra_sdk_fee::FeeTier; +use penumbra_sdk_governance::{proposal::ProposalToml, proposal_state::State as ProposalState, Vote}; +use penumbra_sdk_keys::{keys::AddressIndex, Address}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ core::component::{ dex::v1::{ query_service_client::QueryServiceClient as DexQueryServiceClient, @@ -62,12 +62,12 @@ use penumbra_proto::{ view::v1::GasPricesRequest, Message, Name as _, }; -use penumbra_shielded_pool::Ics20Withdrawal; -use penumbra_stake::rate::RateData; -use penumbra_stake::{DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan}; -use penumbra_transaction::{gas::swap_claim_gas_cost, Transaction}; -use penumbra_view::{SpendableNoteRecord, ViewClient}; -use penumbra_wallet::plan::{self, Planner}; +use penumbra_sdk_shielded_pool::Ics20Withdrawal; +use penumbra_sdk_stake::rate::RateData; +use penumbra_sdk_stake::{DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan}; +use penumbra_sdk_transaction::{gas::swap_claim_gas_cost, Transaction}; +use penumbra_sdk_view::{SpendableNoteRecord, ViewClient}; +use penumbra_sdk_wallet::plan::{self, Planner}; use proposal::ProposalCmd; use tonic::transport::{Channel, ClientTlsConfig}; use url::Url; diff --git a/crates/bin/pcli/src/command/tx/auction/dutch.rs b/crates/bin/pcli/src/command/tx/auction/dutch.rs index 276d7c90c9..66a2964a78 100644 --- a/crates/bin/pcli/src/command/tx/auction/dutch.rs +++ b/crates/bin/pcli/src/command/tx/auction/dutch.rs @@ -7,13 +7,13 @@ use anyhow::{anyhow, bail, Context}; use clap::Subcommand; use comfy_table::presets; use dialoguer::Confirm; -use penumbra_asset::{asset::Cache, Value}; -use penumbra_auction::auction::{dutch::DutchAuction, dutch::DutchAuctionDescription, AuctionId}; -use penumbra_keys::keys::AddressIndex; -use penumbra_num::Amount; -use penumbra_proto::{view::v1::GasPricesRequest, DomainType}; -use penumbra_view::ViewClient; -use penumbra_wallet::plan::Planner; +use penumbra_sdk_asset::{asset::Cache, Value}; +use penumbra_sdk_auction::auction::{dutch::DutchAuction, dutch::DutchAuctionDescription, AuctionId}; +use penumbra_sdk_keys::keys::AddressIndex; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{view::v1::GasPricesRequest, DomainType}; +use penumbra_sdk_view::ViewClient; +use penumbra_sdk_wallet::plan::Planner; use rand::RngCore; use rand_core::OsRng; use serde_json; diff --git a/crates/bin/pcli/src/command/tx/auction/dutch/debug.rs b/crates/bin/pcli/src/command/tx/auction/dutch/debug.rs index 6fefc84878..4159e6e5f6 100644 --- a/crates/bin/pcli/src/command/tx/auction/dutch/debug.rs +++ b/crates/bin/pcli/src/command/tx/auction/dutch/debug.rs @@ -1,4 +1,4 @@ -use penumbra_auction::auction::dutch::DutchAuctionDescription; +use penumbra_sdk_auction::auction::dutch::DutchAuctionDescription; use serde::Serialize; #[derive(Debug, Clone, Serialize)] diff --git a/crates/bin/pcli/src/command/tx/auction/dutch/gda.rs b/crates/bin/pcli/src/command/tx/auction/dutch/gda.rs index 4583d208d7..9c5f058067 100644 --- a/crates/bin/pcli/src/command/tx/auction/dutch/gda.rs +++ b/crates/bin/pcli/src/command/tx/auction/dutch/gda.rs @@ -1,6 +1,6 @@ use clap::ArgEnum; -use penumbra_asset::Value; -use penumbra_auction::auction::dutch::DutchAuctionDescription; +use penumbra_sdk_asset::Value; +use penumbra_sdk_auction::auction::dutch::DutchAuctionDescription; use rand::Rng; use rand::RngCore; use rand_core::OsRng; diff --git a/crates/bin/pcli/src/command/tx/liquidity_position.rs b/crates/bin/pcli/src/command/tx/liquidity_position.rs index cf2cbb97ef..ce42e09674 100644 --- a/crates/bin/pcli/src/command/tx/liquidity_position.rs +++ b/crates/bin/pcli/src/command/tx/liquidity_position.rs @@ -1,7 +1,7 @@ use anyhow::Result; -use penumbra_asset::asset; -use penumbra_dex::{ +use penumbra_sdk_asset::asset; +use penumbra_sdk_dex::{ lp::{ position::{self, Position}, BuyOrder, SellOrder, diff --git a/crates/bin/pcli/src/command/tx/proposal.rs b/crates/bin/pcli/src/command/tx/proposal.rs index 0a32d0c67e..179cdeec6b 100644 --- a/crates/bin/pcli/src/command/tx/proposal.rs +++ b/crates/bin/pcli/src/command/tx/proposal.rs @@ -1,9 +1,9 @@ use anyhow::{Context, Result}; -use penumbra_app::params::AppParameters; -use penumbra_governance::{change::ParameterChange, Proposal, ProposalPayload}; -use penumbra_proto::DomainType; -use penumbra_transaction::TransactionPlan; +use penumbra_sdk_app::params::AppParameters; +use penumbra_sdk_governance::{change::ParameterChange, Proposal, ProposalPayload}; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_transaction::TransactionPlan; use super::FeeTier; diff --git a/crates/bin/pcli/src/command/tx/replicate.rs b/crates/bin/pcli/src/command/tx/replicate.rs index 98669824b2..47c4a476c3 100644 --- a/crates/bin/pcli/src/command/tx/replicate.rs +++ b/crates/bin/pcli/src/command/tx/replicate.rs @@ -4,8 +4,8 @@ pub mod linear; pub mod xyk; use linear::Linear; -use penumbra_dex::DirectedUnitPair; -use penumbra_proto::core::component::dex::v1::{ +use penumbra_sdk_dex::DirectedUnitPair; +use penumbra_sdk_proto::core::component::dex::v1::{ query_service_client::QueryServiceClient as DexQueryServiceClient, SpreadRequest, }; use xyk::ConstantProduct; diff --git a/crates/bin/pcli/src/command/tx/replicate/linear.rs b/crates/bin/pcli/src/command/tx/replicate/linear.rs index 90885954cb..de3dd4a37c 100644 --- a/crates/bin/pcli/src/command/tx/replicate/linear.rs +++ b/crates/bin/pcli/src/command/tx/replicate/linear.rs @@ -2,15 +2,15 @@ use anyhow::Context; use dialoguer::Confirm; use rand_core::{CryptoRngCore, OsRng}; -use penumbra_asset::Value; -use penumbra_dex::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_dex::{ lp::{position::Position, Reserves}, DirectedUnitPair, }; -use penumbra_keys::keys::AddressIndex; -use penumbra_num::Amount; -use penumbra_proto::view::v1::GasPricesRequest; -use penumbra_view::{Planner, ViewClient}; +use penumbra_sdk_keys::keys::AddressIndex; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::view::v1::GasPricesRequest; +use penumbra_sdk_view::{Planner, ViewClient}; use crate::App; @@ -275,7 +275,7 @@ mod tests { use super::*; #[test] - fn sanity_check_penumbra_gm_example() { + fn sanity_check_penumbra_sdk_gm_example() { let params = Linear { pair: "penumbra:gm".parse().unwrap(), input: "1000gm".parse().unwrap(), @@ -301,7 +301,7 @@ mod tests { dbg!(position); } - let asset_cache = penumbra_asset::asset::Cache::with_known_assets(); + let asset_cache = penumbra_sdk_asset::asset::Cache::with_known_assets(); dbg!(¶ms); println!( diff --git a/crates/bin/pcli/src/command/tx/replicate/xyk.rs b/crates/bin/pcli/src/command/tx/replicate/xyk.rs index 23d0508925..0cc843b479 100644 --- a/crates/bin/pcli/src/command/tx/replicate/xyk.rs +++ b/crates/bin/pcli/src/command/tx/replicate/xyk.rs @@ -5,12 +5,12 @@ use anyhow::{anyhow, Context}; use dialoguer::Confirm; use rand_core::OsRng; -use penumbra_asset::Value; -use penumbra_dex::{lp::position::Position, DirectedUnitPair}; -use penumbra_keys::keys::AddressIndex; -use penumbra_num::{fixpoint::U128x128, Amount}; -use penumbra_proto::view::v1::GasPricesRequest; -use penumbra_view::{Planner, ViewClient}; +use penumbra_sdk_asset::Value; +use penumbra_sdk_dex::{lp::position::Position, DirectedUnitPair}; +use penumbra_sdk_keys::keys::AddressIndex; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_proto::view::v1::GasPricesRequest; +use penumbra_sdk_view::{Planner, ViewClient}; use crate::dex_utils; use crate::dex_utils::replicate::debug; diff --git a/crates/bin/pcli/src/command/utils.rs b/crates/bin/pcli/src/command/utils.rs index cd353c24a1..8ffa75c34c 100644 --- a/crates/bin/pcli/src/command/utils.rs +++ b/crates/bin/pcli/src/command/utils.rs @@ -1,6 +1,6 @@ use comfy_table::{presets, Table}; -use penumbra_asset::{asset, Value}; -use penumbra_dex::lp::position::Position; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_dex::lp::position::Position; pub(crate) fn render_positions(asset_cache: &asset::Cache, positions: &[Position]) -> String { let mut table = Table::new(); diff --git a/crates/bin/pcli/src/command/validator.rs b/crates/bin/pcli/src/command/validator.rs index fd43d203ce..3e0611d7ae 100644 --- a/crates/bin/pcli/src/command/validator.rs +++ b/crates/bin/pcli/src/command/validator.rs @@ -6,15 +6,15 @@ use std::{ use anyhow::{Context, Result}; use base64::{engine::general_purpose::URL_SAFE, Engine as _}; use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_view::Planner; +use penumbra_sdk_view::Planner; use rand_core::OsRng; use serde_json::Value; -use penumbra_governance::{ +use penumbra_sdk_governance::{ ValidatorVote, ValidatorVoteBody, ValidatorVoteReason, Vote, MAX_VALIDATOR_VOTE_REASON_LENGTH, }; -use penumbra_proto::{view::v1::GasPricesRequest, DomainType}; -use penumbra_stake::{ +use penumbra_sdk_proto::{view::v1::GasPricesRequest, DomainType}; +use penumbra_sdk_stake::{ validator, validator::{Validator, ValidatorToml}, FundingStream, FundingStreams, IdentityKey, @@ -22,7 +22,7 @@ use penumbra_stake::{ use crate::App; -use penumbra_fee::FeeTier; +use penumbra_sdk_fee::FeeTier; #[derive(Debug, clap::Subcommand)] pub enum ValidatorCmd { @@ -262,7 +262,7 @@ impl ValidatorCmd { std::io::stdin().read_to_string(&mut buf)?; signature = buf; } - as penumbra_proto::DomainType>::decode( + as penumbra_sdk_proto::DomainType>::decode( &URL_SAFE .decode(signature) .context("unable to decode signature as base64")?[..], @@ -385,7 +385,7 @@ impl ValidatorCmd { std::io::stdin().read_to_string(&mut buf)?; signature = buf; } - as penumbra_proto::DomainType>::decode( + as penumbra_sdk_proto::DomainType>::decode( &URL_SAFE .decode(signature) .context("unable to decode signature as base64")?[..], diff --git a/crates/bin/pcli/src/command/view/address.rs b/crates/bin/pcli/src/command/view/address.rs index 2c724ed870..da11b35ba2 100644 --- a/crates/bin/pcli/src/command/view/address.rs +++ b/crates/bin/pcli/src/command/view/address.rs @@ -3,7 +3,7 @@ use base64::Engine; use rand_core::OsRng; use std::str::FromStr; -use penumbra_keys::{keys::AddressIndex, Address, FullViewingKey}; +use penumbra_sdk_keys::{keys::AddressIndex, Address, FullViewingKey}; #[derive(Debug, clap::Parser)] pub struct AddressCmd { diff --git a/crates/bin/pcli/src/command/view/auction.rs b/crates/bin/pcli/src/command/view/auction.rs index 087a62de0b..a6f6007b4b 100644 --- a/crates/bin/pcli/src/command/view/auction.rs +++ b/crates/bin/pcli/src/command/view/auction.rs @@ -1,9 +1,9 @@ use anyhow::Result; use comfy_table::{presets, Cell, ContentArrangement, Table}; -use penumbra_auction::auction::dutch::DutchAuction; -use penumbra_keys::FullViewingKey; -use penumbra_proto::{core::component::auction::v1 as pb_auction, DomainType, Name}; -use penumbra_view::ViewClient; +use penumbra_sdk_auction::auction::dutch::DutchAuction; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proto::{core::component::auction::v1 as pb_auction, DomainType, Name}; +use penumbra_sdk_view::ViewClient; use crate::command::query::auction::render_dutch_auction; @@ -28,11 +28,11 @@ impl AuctionCmd { _fvk: &FullViewingKey, ) -> Result<()> { let auctions: Vec<( - penumbra_auction::auction::AuctionId, - penumbra_view::SpendableNoteRecord, + penumbra_sdk_auction::auction::AuctionId, + penumbra_sdk_view::SpendableNoteRecord, u64, Option, - Vec, + Vec, )> = view_client .auctions(None, self.include_inactive, self.query_latest_state) .await?; @@ -57,7 +57,7 @@ impl AuctionCmd { } else { let position_ids: Vec = positions .into_iter() - .map(|lp: penumbra_dex::lp::position::Position| format!("{}", lp.id())) + .map(|lp: penumbra_sdk_dex::lp::position::Position| format!("{}", lp.id())) .collect(); let mut auction_table = Table::new(); diff --git a/crates/bin/pcli/src/command/view/balance.rs b/crates/bin/pcli/src/command/view/balance.rs index b8946fe1ef..97d498a3da 100644 --- a/crates/bin/pcli/src/command/view/balance.rs +++ b/crates/bin/pcli/src/command/view/balance.rs @@ -1,9 +1,9 @@ use anyhow::Result; use comfy_table::{presets, Table}; -use penumbra_keys::AddressView; -use penumbra_sct::CommitmentSource; -use penumbra_view::ViewClient; +use penumbra_sdk_keys::AddressView; +use penumbra_sdk_sct::CommitmentSource; +use penumbra_sdk_view::ViewClient; #[derive(Debug, clap::Args)] pub struct BalanceCmd { @@ -119,7 +119,7 @@ fn format_source(source: &CommitmentSource) -> String { } } -fn format_return_address(return_address: &Option) -> String { +fn format_return_address(return_address: &Option) -> String { match return_address { None => "Unknown".to_owned(), Some(AddressView::Opaque { address }) => address.display_short_form(), diff --git a/crates/bin/pcli/src/command/view/lps.rs b/crates/bin/pcli/src/command/view/lps.rs index 0fae70c640..c41a98f34b 100644 --- a/crates/bin/pcli/src/command/view/lps.rs +++ b/crates/bin/pcli/src/command/view/lps.rs @@ -1,11 +1,11 @@ use anyhow::{anyhow, Result}; use futures::stream::TryStreamExt; -use penumbra_dex::lp::position::{Position, State}; -use penumbra_proto::core::component::dex::v1::{ +use penumbra_sdk_dex::lp::position::{Position, State}; +use penumbra_sdk_proto::core::component::dex::v1::{ query_service_client::QueryServiceClient as DexQueryServiceClient, LiquidityPositionsByIdRequest, }; -use penumbra_view::ViewClient; +use penumbra_sdk_view::ViewClient; use crate::{command::utils, App}; diff --git a/crates/bin/pcli/src/command/view/noble_address.rs b/crates/bin/pcli/src/command/view/noble_address.rs index 6f696147cc..b0f64488ad 100644 --- a/crates/bin/pcli/src/command/view/noble_address.rs +++ b/crates/bin/pcli/src/command/view/noble_address.rs @@ -1,7 +1,7 @@ use anyhow::Result; use rand_core::OsRng; -use penumbra_keys::{Address, FullViewingKey}; +use penumbra_sdk_keys::{Address, FullViewingKey}; #[derive(Debug, clap::Parser)] pub struct NobleAddressCmd { diff --git a/crates/bin/pcli/src/command/view/staked.rs b/crates/bin/pcli/src/command/view/staked.rs index f3c635094b..6a3b9853e7 100644 --- a/crates/bin/pcli/src/command/view/staked.rs +++ b/crates/bin/pcli/src/command/view/staked.rs @@ -5,13 +5,13 @@ use comfy_table::{presets, Table}; use futures::TryStreamExt; use tonic::transport::Channel; -use penumbra_asset::{Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_keys::FullViewingKey; -use penumbra_proto::core::component::stake::v1::{ +use penumbra_sdk_asset::{Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proto::core::component::stake::v1::{ query_service_client::QueryServiceClient as StakeQueryServiceClient, ValidatorInfoRequest, }; -use penumbra_stake::{validator, DelegationToken}; -use penumbra_view::ViewClient; +use penumbra_sdk_stake::{validator, DelegationToken}; +use penumbra_sdk_view::ViewClient; #[derive(Debug, clap::Parser)] pub struct StakedCmd {} diff --git a/crates/bin/pcli/src/command/view/transaction_hashes.rs b/crates/bin/pcli/src/command/view/transaction_hashes.rs index 3ed66b5507..be4bed2a91 100644 --- a/crates/bin/pcli/src/command/view/transaction_hashes.rs +++ b/crates/bin/pcli/src/command/view/transaction_hashes.rs @@ -1,8 +1,8 @@ use anyhow::Result; use comfy_table::{presets, Table}; -use penumbra_keys::FullViewingKey; -use penumbra_transaction::MemoView; -use penumbra_view::ViewClient; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_transaction::MemoView; +use penumbra_sdk_view::ViewClient; #[derive(Debug, clap::Args)] pub struct TransactionHashesCmd { diff --git a/crates/bin/pcli/src/command/view/tx.rs b/crates/bin/pcli/src/command/view/tx.rs index 8b0a52d601..b24e265d07 100644 --- a/crates/bin/pcli/src/command/view/tx.rs +++ b/crates/bin/pcli/src/command/view/tx.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; -use penumbra_proto::{util::tendermint_proxy::v1::GetTxRequest, DomainType}; -use penumbra_transaction::Transaction; -use penumbra_view::{TransactionInfo, ViewClient}; +use penumbra_sdk_proto::{util::tendermint_proxy::v1::GetTxRequest, DomainType}; +use penumbra_sdk_transaction::Transaction; +use penumbra_sdk_view::{TransactionInfo, ViewClient}; use crate::App; diff --git a/crates/bin/pcli/src/command/view/wallet_id.rs b/crates/bin/pcli/src/command/view/wallet_id.rs index fc54d9fd37..c8e1de2888 100644 --- a/crates/bin/pcli/src/command/view/wallet_id.rs +++ b/crates/bin/pcli/src/command/view/wallet_id.rs @@ -1,6 +1,6 @@ use anyhow::Result; -use penumbra_keys::FullViewingKey; +use penumbra_sdk_keys::FullViewingKey; #[derive(Debug, clap::Parser)] pub struct WalletIdCmd {} diff --git a/crates/bin/pcli/src/config.rs b/crates/bin/pcli/src/config.rs index 8208bc459d..08d323183c 100644 --- a/crates/bin/pcli/src/config.rs +++ b/crates/bin/pcli/src/config.rs @@ -1,16 +1,16 @@ use std::path::Path; use anyhow::{Context, Result}; -use penumbra_stake::GovernanceKey; +use penumbra_sdk_stake::GovernanceKey; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr}; use url::Url; -use penumbra_custody::{ +use penumbra_sdk_custody::{ encrypted::Config as EncryptedConfig, soft_kms::Config as SoftKmsConfig, threshold::Config as ThresholdConfig, }; -use penumbra_keys::FullViewingKey; +use penumbra_sdk_keys::FullViewingKey; /// Configuration data for `pcli`. #[serde_as] @@ -118,9 +118,9 @@ mod tests { grpc_url: Url::parse("https://grpc.testnet.penumbra.zone").unwrap(), disable_warning: false, view_url: None, - full_viewing_key: penumbra_keys::test_keys::FULL_VIEWING_KEY.clone(), + full_viewing_key: penumbra_sdk_keys::test_keys::FULL_VIEWING_KEY.clone(), custody: CustodyConfig::SoftKms(SoftKmsConfig::from( - penumbra_keys::test_keys::SPEND_KEY.clone(), + penumbra_sdk_keys::test_keys::SPEND_KEY.clone(), )), governance_custody: None, }; diff --git a/crates/bin/pcli/src/dex_utils/replicate/debug.rs b/crates/bin/pcli/src/dex_utils/replicate/debug.rs index ecb3d19f68..5536696c3b 100644 --- a/crates/bin/pcli/src/dex_utils/replicate/debug.rs +++ b/crates/bin/pcli/src/dex_utils/replicate/debug.rs @@ -1,6 +1,6 @@ -use penumbra_dex::lp::position::Position; -use penumbra_dex::DirectedUnitPair; -use penumbra_num::fixpoint::U128x128; +use penumbra_sdk_dex::lp::position::Position; +use penumbra_sdk_dex::DirectedUnitPair; +use penumbra_sdk_num::fixpoint::U128x128; use serde::Serialize; #[derive(Serialize)] diff --git a/crates/bin/pcli/src/dex_utils/replicate/xyk.rs b/crates/bin/pcli/src/dex_utils/replicate/xyk.rs index 3f54b4f418..97e57f0e0f 100644 --- a/crates/bin/pcli/src/dex_utils/replicate/xyk.rs +++ b/crates/bin/pcli/src/dex_utils/replicate/xyk.rs @@ -1,12 +1,12 @@ use crate::dex_utils::replicate::math_utils; use anyhow::Context; use ndarray::Array; -use penumbra_asset::Value; -use penumbra_dex::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_dex::{ lp::{position::Position, Reserves}, DirectedUnitPair, }; -use penumbra_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; use rand_core::OsRng; use tracing::field; diff --git a/crates/bin/pcli/src/lib.rs b/crates/bin/pcli/src/lib.rs index 1faf352016..e008ed3024 100644 --- a/crates/bin/pcli/src/lib.rs +++ b/crates/bin/pcli/src/lib.rs @@ -7,11 +7,11 @@ use { camino::Utf8PathBuf, directories::ProjectDirs, futures::StreamExt, - penumbra_proto::{ + penumbra_sdk_proto::{ box_grpc_svc::BoxGrpcService, custody::v1::custody_service_client::CustodyServiceClient, view::v1::view_service_client::ViewServiceClient, }, - penumbra_view::ViewClient, + penumbra_sdk_view::ViewClient, std::path::PathBuf, }; diff --git a/crates/bin/pcli/src/network.rs b/crates/bin/pcli/src/network.rs index 56c7331536..014b20ac94 100644 --- a/crates/bin/pcli/src/network.rs +++ b/crates/bin/pcli/src/network.rs @@ -1,16 +1,16 @@ use anyhow::Context; use decaf377_rdsa::{Signature, SpendAuth}; use futures::{FutureExt, TryStreamExt}; -use penumbra_governance::ValidatorVoteBody; -use penumbra_proto::{ +use penumbra_sdk_governance::ValidatorVoteBody; +use penumbra_sdk_proto::{ custody::v1::{AuthorizeValidatorDefinitionRequest, AuthorizeValidatorVoteRequest}, util::tendermint_proxy::v1::tendermint_proxy_service_client::TendermintProxyServiceClient, view::v1::broadcast_transaction_response::Status as BroadcastStatus, DomainType, }; -use penumbra_stake::validator::Validator; -use penumbra_transaction::{txhash::TransactionId, Transaction, TransactionPlan}; -use penumbra_view::ViewClient; +use penumbra_sdk_stake::validator::Validator; +use penumbra_sdk_transaction::{txhash::TransactionId, Transaction, TransactionPlan}; +use penumbra_sdk_view::ViewClient; use std::{fs, future::Future}; use tonic::transport::{Channel, ClientTlsConfig}; use tracing::instrument; @@ -42,7 +42,7 @@ impl App { plan.num_proofs(), ); let start = std::time::Instant::now(); - let tx = penumbra_wallet::build_transaction( + let tx = penumbra_sdk_wallet::build_transaction( &self.config.full_viewing_key, self.view.as_mut().expect("view service initialized"), &mut self.custody, diff --git a/crates/bin/pcli/src/opt.rs b/crates/bin/pcli/src/opt.rs index bfa9a6cc1c..58bb27af36 100644 --- a/crates/bin/pcli/src/opt.rs +++ b/crates/bin/pcli/src/opt.rs @@ -7,15 +7,15 @@ use crate::{ use anyhow::Result; use camino::Utf8PathBuf; use clap::Parser; -use penumbra_custody::{null_kms::NullKms, soft_kms::SoftKms}; -use penumbra_proto::box_grpc_svc; -use penumbra_proto::{ +use penumbra_sdk_custody::{null_kms::NullKms, soft_kms::SoftKms}; +use penumbra_sdk_proto::box_grpc_svc; +use penumbra_sdk_proto::{ custody::v1::{ custody_service_client::CustodyServiceClient, custody_service_server::CustodyServiceServer, }, view::v1::{view_service_client::ViewServiceClient, view_service_server::ViewServiceServer}, }; -use penumbra_view::ViewServer; +use penumbra_sdk_view::ViewServer; use std::io::IsTerminal as _; use tracing_subscriber::EnvFilter; use url::Url; @@ -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_PCLI_HOME")] + #[clap(long, default_value_t = default_home(), env = "penumbra_sdk_PCLI_HOME")] pub home: Utf8PathBuf, /// Override the GRPC URL that will be used to connect to a fullnode. /// @@ -82,7 +82,7 @@ impl Opt { } CustodyConfig::Threshold(config) => { tracing::info!("using manual threshold custody service"); - let threshold_kms = penumbra_custody::threshold::Threshold::new( + let threshold_kms = penumbra_sdk_custody::threshold::Threshold::new( config.clone(), ActualTerminal { fvk: Some(fvk.clone()), @@ -93,7 +93,7 @@ impl Opt { } CustodyConfig::Encrypted(config) => { tracing::info!("using encrypted custody service"); - let encrypted_kms = penumbra_custody::encrypted::Encrypted::new( + let encrypted_kms = penumbra_sdk_custody::encrypted::Encrypted::new( config.clone(), ActualTerminal { fvk: Some(fvk.clone()), @@ -119,7 +119,7 @@ impl Opt { tracing::info!( "using separate manual threshold custody service for validator voting" ); - let threshold_kms = penumbra_custody::threshold::Threshold::new( + let threshold_kms = penumbra_sdk_custody::threshold::Threshold::new( config.clone(), ActualTerminal { fvk: Some(fvk) }, ); @@ -128,7 +128,7 @@ impl Opt { } GovernanceCustodyConfig::Encrypted { config, .. } => { tracing::info!("using separate encrypted custody service for validator voting"); - let encrypted_kms = penumbra_custody::encrypted::Encrypted::new( + let encrypted_kms = penumbra_sdk_custody::encrypted::Encrypted::new( config.clone(), ActualTerminal { fvk: Some(fvk) }, ); diff --git a/crates/bin/pcli/src/terminal.rs b/crates/bin/pcli/src/terminal.rs index 95bf433242..461906da3a 100644 --- a/crates/bin/pcli/src/terminal.rs +++ b/crates/bin/pcli/src/terminal.rs @@ -3,17 +3,17 @@ use std::io::{IsTerminal, Read, Write}; use anyhow::Result; use decaf377::{Element, Fq}; use decaf377_rdsa::{Domain, Signature, VerificationKey}; -use penumbra_asset::{asset::Cache, balance::Commitment}; -use penumbra_custody::threshold::{SigningRequest, Terminal}; -use penumbra_keys::{ +use penumbra_sdk_asset::{asset::Cache, balance::Commitment}; +use penumbra_sdk_custody::threshold::{SigningRequest, Terminal}; +use penumbra_sdk_keys::{ symmetric::{OvkWrappedKey, WrappedMemoKey}, FullViewingKey, PayloadKey, }; -use penumbra_proof_params::GROTH16_PROOF_LENGTH_BYTES; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{EncryptedBackref, Note, NoteView}; -use penumbra_tct::structure::Hash; -use penumbra_transaction::{view, ActionPlan, ActionView, TransactionPlan, TransactionView}; +use penumbra_sdk_proof_params::GROTH16_PROOF_LENGTH_BYTES; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{EncryptedBackref, Note, NoteView}; +use penumbra_sdk_tct::structure::Hash; +use penumbra_sdk_transaction::{view, ActionPlan, ActionView, TransactionPlan, TransactionView}; use termion::{color, input::TermRead}; use tonic::async_trait; @@ -43,7 +43,7 @@ fn pretty_print_transaction_plan( fvk: Option, plan: &TransactionPlan, ) -> anyhow::Result<()> { - use penumbra_shielded_pool::{output, spend}; + use penumbra_sdk_shielded_pool::{output, spend}; fn dummy_sig() -> Signature { Signature::from([0u8; 64]) @@ -60,7 +60,7 @@ fn pretty_print_transaction_plan( fn dummy_proof_spend() -> spend::SpendProof { spend::SpendProof::try_from( - penumbra_proto::penumbra::core::component::shielded_pool::v1::ZkSpendProof { + penumbra_sdk_proto::penumbra::core::component::shielded_pool::v1::ZkSpendProof { inner: vec![0u8; GROTH16_PROOF_LENGTH_BYTES], }, ) @@ -69,7 +69,7 @@ fn pretty_print_transaction_plan( fn dummy_proof_output() -> output::OutputProof { output::OutputProof::try_from( - penumbra_proto::penumbra::core::component::shielded_pool::v1::ZkOutputProof { + penumbra_sdk_proto::penumbra::core::component::shielded_pool::v1::ZkOutputProof { inner: vec![0u8; GROTH16_PROOF_LENGTH_BYTES], }, ) @@ -93,13 +93,13 @@ fn pretty_print_transaction_plan( fn dummy_output() -> output::Output { output::Output { body: output::Body { - note_payload: penumbra_shielded_pool::NotePayload { - note_commitment: penumbra_shielded_pool::note::StateCommitment(Fq::default()), + note_payload: penumbra_sdk_shielded_pool::NotePayload { + note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment(Fq::default()), ephemeral_key: [0u8; 32] .as_slice() .try_into() .expect("can create dummy ephemeral key"), - encrypted_note: penumbra_shielded_pool::NoteCiphertext([0u8; 176]), + encrypted_note: penumbra_sdk_shielded_pool::NoteCiphertext([0u8; 176]), }, balance_commitment: dummy_commitment(), ovk_wrapped_key: OvkWrappedKey([0u8; 48]), @@ -126,7 +126,7 @@ fn pretty_print_transaction_plan( match action { ActionPlan::Output(x) => Some(ActionView::Output( - penumbra_shielded_pool::OutputView::Visible { + penumbra_sdk_shielded_pool::OutputView::Visible { output: dummy_output(), note: convert_note(cache, fvk, &x.output_note()), payload_key: PayloadKey::from([0u8; 32]), @@ -175,7 +175,7 @@ fn pretty_print_transaction_plan( let cache = Cache::with_known_assets(); let view = TransactionView { - anchor: penumbra_tct::Root(Hash::zero()), + anchor: penumbra_sdk_tct::Root(Hash::zero()), binding_sig: dummy_sig(), body_view: view::TransactionBodyView { action_views: plan diff --git a/crates/bin/pcli/src/transaction_view_ext.rs b/crates/bin/pcli/src/transaction_view_ext.rs index 91fb69fa20..ee059727e3 100644 --- a/crates/bin/pcli/src/transaction_view_ext.rs +++ b/crates/bin/pcli/src/transaction_view_ext.rs @@ -1,17 +1,17 @@ use comfy_table::presets; use comfy_table::Table; -use penumbra_asset::asset::Id; -use penumbra_asset::asset::Metadata; -use penumbra_asset::Value; -use penumbra_asset::ValueView; -use penumbra_dex::swap::SwapView; -use penumbra_dex::swap_claim::SwapClaimView; -use penumbra_fee::Fee; -use penumbra_keys::AddressView; -use penumbra_num::Amount; -use penumbra_shielded_pool::SpendView; -use penumbra_transaction::view::action_view::OutputView; -use penumbra_transaction::TransactionView; +use penumbra_sdk_asset::asset::Id; +use penumbra_sdk_asset::asset::Metadata; +use penumbra_sdk_asset::Value; +use penumbra_sdk_asset::ValueView; +use penumbra_sdk_dex::swap::SwapView; +use penumbra_sdk_dex::swap_claim::SwapClaimView; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_keys::AddressView; +use penumbra_sdk_num::Amount; +use penumbra_sdk_shielded_pool::SpendView; +use penumbra_sdk_transaction::view::action_view::OutputView; +use penumbra_sdk_transaction::TransactionView; // Issues identified: // TODO: FeeView @@ -196,14 +196,14 @@ impl TransactionViewExt for TransactionView { if let Some(memo_view) = &self.body_view.memo_view { match memo_view { - penumbra_transaction::MemoView::Visible { + penumbra_sdk_transaction::MemoView::Visible { plaintext, ciphertext: _, } => { println!("Memo Sender: {}", &plaintext.return_address.address()); println!("Memo Text: \n{}\n", &plaintext.text); } - penumbra_transaction::MemoView::Opaque { ciphertext } => { + penumbra_sdk_transaction::MemoView::Opaque { ciphertext } => { println!("Encrypted Memo: \n{}\n", format_opaque_bytes(&ciphertext.0)); } } @@ -218,7 +218,7 @@ impl TransactionViewExt for TransactionView { let action: String; let row = match action_view { - penumbra_transaction::ActionView::Spend(spend) => { + penumbra_sdk_transaction::ActionView::Spend(spend) => { match spend { SpendView::Visible { spend: _, note } => { action = format!( @@ -235,7 +235,7 @@ impl TransactionViewExt for TransactionView { } } } - penumbra_transaction::ActionView::Output(output) => { + penumbra_sdk_transaction::ActionView::Output(output) => { match output { OutputView::Visible { output: _, @@ -256,7 +256,7 @@ impl TransactionViewExt for TransactionView { } } } - penumbra_transaction::ActionView::Swap(swap) => { + penumbra_sdk_transaction::ActionView::Swap(swap) => { // Typical swaps are one asset for another, but we can't know that for sure. match swap { SwapView::Visible { swap_plaintext, .. } => { @@ -302,7 +302,7 @@ impl TransactionViewExt for TransactionView { } } } - penumbra_transaction::ActionView::SwapClaim(swap_claim) => { + penumbra_sdk_transaction::ActionView::SwapClaim(swap_claim) => { match swap_claim { SwapClaimView::Visible { swap_claim, @@ -340,7 +340,7 @@ impl TransactionViewExt for TransactionView { } } } - penumbra_transaction::ActionView::Ics20Withdrawal(withdrawal) => { + penumbra_sdk_transaction::ActionView::Ics20Withdrawal(withdrawal) => { let unit = withdrawal.denom.best_unit_for(withdrawal.amount); action = format!( "{}{} via {} to {}", @@ -351,7 +351,7 @@ impl TransactionViewExt for TransactionView { ); ["Ics20 Withdrawal", &action] } - penumbra_transaction::ActionView::PositionOpen(position_open) => { + penumbra_sdk_transaction::ActionView::PositionOpen(position_open) => { let position = &position_open.position; /* TODO: leaving this around since we may want it to render prices let _unit_pair = DirectedUnitPair { @@ -371,52 +371,52 @@ impl TransactionViewExt for TransactionView { ); ["Open Liquidity Position", &action] } - penumbra_transaction::ActionView::PositionClose(_) => { + penumbra_sdk_transaction::ActionView::PositionClose(_) => { ["Close Liquitity Position", ""] } - penumbra_transaction::ActionView::PositionWithdraw(_) => { + penumbra_sdk_transaction::ActionView::PositionWithdraw(_) => { ["Withdraw Liquitity Position", ""] } - penumbra_transaction::ActionView::ProposalDepositClaim(proposal_deposit_claim) => { + penumbra_sdk_transaction::ActionView::ProposalDepositClaim(proposal_deposit_claim) => { action = format!( "Claim Deposit for Governance Proposal #{}", proposal_deposit_claim.proposal ); [&action, ""] } - penumbra_transaction::ActionView::ProposalSubmit(proposal_submit) => { + penumbra_sdk_transaction::ActionView::ProposalSubmit(proposal_submit) => { action = format!( "Submit Governance Proposal #{}", proposal_submit.proposal.id ); [&action, ""] } - penumbra_transaction::ActionView::ProposalWithdraw(proposal_withdraw) => { + penumbra_sdk_transaction::ActionView::ProposalWithdraw(proposal_withdraw) => { action = format!( "Withdraw Governance Proposal #{}", proposal_withdraw.proposal ); [&action, ""] } - penumbra_transaction::ActionView::IbcRelay(_) => ["IBC Relay", ""], - penumbra_transaction::ActionView::DelegatorVote(_) => ["Delegator Vote", ""], - penumbra_transaction::ActionView::ValidatorDefinition(_) => { + penumbra_sdk_transaction::ActionView::IbcRelay(_) => ["IBC Relay", ""], + penumbra_sdk_transaction::ActionView::DelegatorVote(_) => ["Delegator Vote", ""], + penumbra_sdk_transaction::ActionView::ValidatorDefinition(_) => { ["Upload Validator Definition", ""] } - penumbra_transaction::ActionView::ValidatorVote(_) => ["Validator Vote", ""], - penumbra_transaction::ActionView::CommunityPoolDeposit(_) => { + penumbra_sdk_transaction::ActionView::ValidatorVote(_) => ["Validator Vote", ""], + penumbra_sdk_transaction::ActionView::CommunityPoolDeposit(_) => { ["Community Pool Deposit", ""] } - penumbra_transaction::ActionView::CommunityPoolSpend(_) => { + penumbra_sdk_transaction::ActionView::CommunityPoolSpend(_) => { ["Community Pool Spend", ""] } - penumbra_transaction::ActionView::CommunityPoolOutput(_) => { + penumbra_sdk_transaction::ActionView::CommunityPoolOutput(_) => { ["Community Pool Output", ""] } - penumbra_transaction::ActionView::Delegate(_) => ["Delegation", ""], - penumbra_transaction::ActionView::Undelegate(_) => ["Undelegation", ""], - penumbra_transaction::ActionView::UndelegateClaim(_) => ["Undelegation Claim", ""], - penumbra_transaction::ActionView::ActionDutchAuctionSchedule(x) => { + penumbra_sdk_transaction::ActionView::Delegate(_) => ["Delegation", ""], + penumbra_sdk_transaction::ActionView::Undelegate(_) => ["Undelegation", ""], + penumbra_sdk_transaction::ActionView::UndelegateClaim(_) => ["Undelegation Claim", ""], + penumbra_sdk_transaction::ActionView::ActionDutchAuctionSchedule(x) => { let description = &x.action.description; let input: String = format_value_view(&create_value_view( @@ -439,11 +439,11 @@ impl TransactionViewExt for TransactionView { ); ["Dutch Auction Schedule", &action] } - penumbra_transaction::ActionView::ActionDutchAuctionEnd(x) => { + penumbra_sdk_transaction::ActionView::ActionDutchAuctionEnd(x) => { action = format!("{}", x.auction_id); ["Dutch Auction End", &action] } - penumbra_transaction::ActionView::ActionDutchAuctionWithdraw(x) => { + penumbra_sdk_transaction::ActionView::ActionDutchAuctionWithdraw(x) => { let inside = x .reserves .iter() diff --git a/crates/bin/pcli/tests/debug.rs b/crates/bin/pcli/tests/debug.rs index 05dbe26c27..00ee5b2426 100644 --- a/crates/bin/pcli/tests/debug.rs +++ b/crates/bin/pcli/tests/debug.rs @@ -1,5 +1,5 @@ use core::fmt::Debug; -use penumbra_proof_params::{SPEND_PROOF_PROVING_KEY, SPEND_PROOF_VERIFICATION_KEY}; +use penumbra_sdk_proof_params::{SPEND_PROOF_PROVING_KEY, SPEND_PROOF_VERIFICATION_KEY}; use std::{ fs::{self, OpenOptions}, io::Write, diff --git a/crates/bin/pcli/tests/network_integration.rs b/crates/bin/pcli/tests/network_integration.rs index b48f0e2ac2..128a06c128 100644 --- a/crates/bin/pcli/tests/network_integration.rs +++ b/crates/bin/pcli/tests/network_integration.rs @@ -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_NODE_PD_URL` environment variable. +//! Tests against the network in the `penumbra_sdk_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 @@ -18,15 +18,15 @@ use std::{path::PathBuf, time::Duration}; use assert_cmd::Command; use directories::UserDirs; use once_cell::sync::Lazy; -use penumbra_stake::validator::ValidatorToml; +use penumbra_sdk_stake::validator::ValidatorToml; use predicates::prelude::*; use regex::Regex; use serde_json::Value; use tempfile::{tempdir, NamedTempFile, TempDir}; -use penumbra_keys::test_keys::{ADDRESS_0_STR, ADDRESS_1_STR, SEED_PHRASE}; -use penumbra_proto::core::transaction::v1::TransactionView as ProtoTransactionView; -use penumbra_transaction::view::TransactionView; +use penumbra_sdk_keys::test_keys::{ADDRESS_0_STR, ADDRESS_1_STR, SEED_PHRASE}; +use penumbra_sdk_proto::core::transaction::v1::TransactionView as ProtoTransactionView; +use penumbra_sdk_transaction::view::TransactionView; // The number "1020" is chosen so that this is bigger than u64::MAX // when accounting for the 10e18 scaling factor from the base denom. @@ -175,7 +175,7 @@ fn transaction_send_from_addr_0_to_addr_1() { assert!(matches!( &tv.body_view.action_views[0], - penumbra_transaction::ActionView::Spend(_) + penumbra_sdk_transaction::ActionView::Spend(_) )); // Inspect the TransactionView and ensure that we can read the memo text. @@ -184,12 +184,12 @@ fn transaction_send_from_addr_0_to_addr_1() { .memo_view .expect("can find MemoView in TransactionView"); match mv { - penumbra_transaction::MemoView::Visible { plaintext, .. } => { + penumbra_sdk_transaction::MemoView::Visible { plaintext, .. } => { tracing::info!(?plaintext, "plaintext memo"); tracing::info!(?memo_text, "expected memo text"); assert!(plaintext.text == memo_text); } - penumbra_transaction::MemoView::Opaque { .. } => { + penumbra_sdk_transaction::MemoView::Opaque { .. } => { panic!("MemoView for transaction was Opaque! We should be able to read this memo."); } } diff --git a/crates/bin/pcli/tests/proof.rs b/crates/bin/pcli/tests/proof.rs index 0632968e48..936a66c9a1 100644 --- a/crates/bin/pcli/tests/proof.rs +++ b/crates/bin/pcli/tests/proof.rs @@ -3,20 +3,20 @@ use decaf377::{Fq, Fr}; use decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}; -use penumbra_asset::{asset, Balance, Value}; -use penumbra_dex::swap::proof::{SwapProofPrivate, SwapProofPublic}; -use penumbra_dex::swap_claim::{SwapClaimProofPrivate, SwapClaimProofPublic}; -use penumbra_dex::{ +use penumbra_sdk_asset::{asset, Balance, Value}; +use penumbra_sdk_dex::swap::proof::{SwapProofPrivate, SwapProofPublic}; +use penumbra_sdk_dex::swap_claim::{SwapClaimProofPrivate, SwapClaimProofPublic}; +use penumbra_sdk_dex::{ swap::proof::SwapProof, swap::SwapPlaintext, swap_claim::proof::SwapClaimProof, BatchSwapOutputData, TradingPair, }; -use penumbra_fee::Fee; -use penumbra_governance::{ +use penumbra_sdk_fee::Fee; +use penumbra_sdk_governance::{ DelegatorVoteProof, DelegatorVoteProofPrivate, DelegatorVoteProofPublic, }; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_num::Amount; -use penumbra_proof_params::{ +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_params::{ CONVERT_PROOF_PROVING_KEY, CONVERT_PROOF_VERIFICATION_KEY, DELEGATOR_VOTE_PROOF_PROVING_KEY, DELEGATOR_VOTE_PROOF_VERIFICATION_KEY, NULLIFIER_DERIVATION_PROOF_PROVING_KEY, NULLIFIER_DERIVATION_PROOF_VERIFICATION_KEY, OUTPUT_PROOF_PROVING_KEY, @@ -24,16 +24,16 @@ use penumbra_proof_params::{ SWAPCLAIM_PROOF_PROVING_KEY, SWAPCLAIM_PROOF_VERIFICATION_KEY, SWAP_PROOF_PROVING_KEY, SWAP_PROOF_VERIFICATION_KEY, }; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::output::{OutputProofPrivate, OutputProofPublic}; -use penumbra_shielded_pool::Note; -use penumbra_shielded_pool::{ +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::output::{OutputProofPrivate, OutputProofPublic}; +use penumbra_sdk_shielded_pool::Note; +use penumbra_sdk_shielded_pool::{ NullifierDerivationProof, NullifierDerivationProofPrivate, NullifierDerivationProofPublic, OutputProof, SpendProof, SpendProofPrivate, SpendProofPublic, }; -use penumbra_stake::undelegate_claim::{UndelegateClaimProofPrivate, UndelegateClaimProofPublic}; -use penumbra_stake::{IdentityKey, Penalty, UnbondingToken, UndelegateClaimProof}; -use penumbra_tct as tct; +use penumbra_sdk_stake::undelegate_claim::{UndelegateClaimProofPrivate, UndelegateClaimProofPublic}; +use penumbra_sdk_stake::{IdentityKey, Penalty, UnbondingToken, UndelegateClaimProof}; +use penumbra_sdk_tct as tct; use rand_core::OsRng; #[test] diff --git a/crates/bin/pclientd/src/lib.rs b/crates/bin/pclientd/src/lib.rs index cf0bc5b979..c63212dae5 100644 --- a/crates/bin/pclientd/src/lib.rs +++ b/crates/bin/pclientd/src/lib.rs @@ -8,18 +8,18 @@ use anyhow::{Context, Result}; use camino::Utf8PathBuf; use clap::Parser; use directories::ProjectDirs; -use penumbra_custody::policy::{AuthPolicy, PreAuthorizationPolicy}; -use penumbra_custody::soft_kms::{self, SoftKms}; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_keys::FullViewingKey; -use penumbra_proto::{ +use penumbra_sdk_custody::policy::{AuthPolicy, PreAuthorizationPolicy}; +use penumbra_sdk_custody::soft_kms::{self, SoftKms}; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proto::{ core::app::v1::{ query_service_client::QueryServiceClient as AppQueryServiceClient, AppParametersRequest, }, custody::v1::custody_service_server::CustodyServiceServer, view::v1::view_service_server::ViewServiceServer, }; -use penumbra_view::{Storage, ViewServer}; +use penumbra_sdk_view::{Storage, ViewServer}; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr}; @@ -81,7 +81,7 @@ pub struct Opt { #[clap(subcommand)] pub cmd: Command, /// The path used to store pclientd state and config files. - #[clap(long, default_value_t = default_home(), env = "PENUMBRA_PCLIENTD_HOME")] + #[clap(long, default_value_t = default_home(), env = "penumbra_sdk_PCLIENTD_HOME")] pub home: Utf8PathBuf, } @@ -342,7 +342,7 @@ impl Opt { .add_service(tonic_web::enable( tonic_reflection::server::Builder::configure() .register_encoded_file_descriptor_set( - penumbra_proto::FILE_DESCRIPTOR_SET, + penumbra_sdk_proto::FILE_DESCRIPTOR_SET, ) .build_v1() .with_context(|| "could not configure grpc reflection service")?, diff --git a/crates/bin/pclientd/tests/network_integration.rs b/crates/bin/pclientd/tests/network_integration.rs index 6c9c282171..0ca9116f74 100644 --- a/crates/bin/pclientd/tests/network_integration.rs +++ b/crates/bin/pclientd/tests/network_integration.rs @@ -1,6 +1,6 @@ //! Basic integration testing of `pclientd` versus a target testnet. //! -//! Tests against the network in the `PENUMBRA_NODE_PD_URL` environment variable. +//! Tests against the network in the `penumbra_sdk_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 @@ -16,10 +16,10 @@ use tempfile::tempdir; use tokio::process::Command as TokioCommand; use pclientd::PclientdConfig; -use penumbra_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_custody::soft_kms; -use penumbra_keys::test_keys; -use penumbra_proto::{ +use penumbra_sdk_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_custody::soft_kms; +use penumbra_sdk_keys::test_keys; +use penumbra_sdk_proto::{ core::{component::fee::v1::Fee, component::ibc::v1::IbcRelay}, custody::v1::{custody_service_client::CustodyServiceClient, AuthorizeRequest}, penumbra::view::v1::view_service_client::ViewServiceClient, @@ -29,12 +29,12 @@ use penumbra_proto::{ TransactionPlannerRequest, WitnessAndBuildRequest, }, }; -use penumbra_view::ViewClient; +use penumbra_sdk_view::ViewClient; fn generate_config() -> anyhow::Result { Ok(PclientdConfig { full_viewing_key: test_keys::FULL_VIEWING_KEY.clone(), - grpc_url: std::env::var("PENUMBRA_NODE_PD_URL") + grpc_url: std::env::var("penumbra_sdk_NODE_PD_URL") .unwrap_or_else(|_| "http://127.0.0.1:8080".to_owned()) .parse()?, bind_addr: "127.0.0.1:8081".parse()?, @@ -97,7 +97,7 @@ async fn transaction_send_flow() -> anyhow::Result<()> { // Here we don't want to use the Penumbra Rust libraries much, because // we're executing as if we were a Go program that had to construct all these // protos manually, with no access to Penumbra crypto. - use penumbra_proto::view::v1::transaction_planner_request as tpr; + use penumbra_sdk_proto::view::v1::transaction_planner_request as tpr; // Specifically, pretend we're relaying IBC messages, so pull one in: @@ -279,8 +279,8 @@ async fn swap_claim_flow() -> anyhow::Result<()> { // Here we don't want to use the Penumbra Rust libraries much, because // we're executing as if we were a Go program that had to construct all these // protos manually, with no access to Penumbra crypto. - use penumbra_proto::core::num::v1 as num; - use penumbra_proto::view::v1::transaction_planner_request as tpr; + use penumbra_sdk_proto::core::num::v1 as num; + use penumbra_sdk_proto::view::v1::transaction_planner_request as tpr; // 5.1. Generate a transaction plan performing a swap. Since there are no liquidity positions // on this test network, we'll expect to get all our inputs back. @@ -314,7 +314,7 @@ async fn swap_claim_flow() -> anyhow::Result<()> { .ok_or_else(|| anyhow::anyhow!("TransactionPlannerResponse missing plan"))?; // Hold on to the swap plaintext to be able to claim. - let swap_plaintext = TryInto::::try_into(plan.clone())? + let swap_plaintext = TryInto::::try_into(plan.clone())? .swap_plans() .next() .expect("swap plan must be present") diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index 5c2b71ddb8..f406e82b83 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -20,7 +20,7 @@ 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_PD_HOME", display_order = 100)] + #[clap(long, env = "penumbra_sdk_PD_HOME", display_order = 100)] home: Option, /// Bind the ABCI server to this socket. /// @@ -28,7 +28,7 @@ pub enum RootCommand { #[clap( short, long, - env = "PENUMBRA_PD_ABCI_BIND", + env = "penumbra_sdk_PD_ABCI_BIND", default_value = "127.0.0.1:26658", display_order = 400 )] @@ -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_PD_GRPC_BIND", display_order = 201)] + #[clap(short, long, env = "penumbra_sdk_PD_GRPC_BIND", display_order = 201)] grpc_bind: Option, /// If set, serve gRPC using auto-managed HTTPS with this domain name. /// @@ -64,7 +64,7 @@ pub enum RootCommand { #[clap( short, long, - env = "PENUMBRA_PD_METRICS_BIND", + env = "penumbra_sdk_PD_METRICS_BIND", default_value = "127.0.0.1:9000", display_order = 300 )] @@ -79,7 +79,7 @@ pub enum RootCommand { #[clap( short, long, - env = "PENUMBRA_PD_COMETBFT_PROXY_URL", + env = "penumbra_sdk_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. @@ -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_PD_HOME", display_order = 100)] + #[clap(long, env = "penumbra_sdk_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")] @@ -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_PD_HOME", display_order = 100)] + #[clap(long, env = "penumbra_sdk_PD_HOME", display_order = 100)] home: Option, /// If set, also migrate the CometBFT state located in this home directory. /// If both `--home` and `--comet-home` are unset, will attempt to migrate @@ -174,7 +174,7 @@ pub enum NetworkCommand { /// generate a wallet, view its address, then generate a devnet /// with that address included in the base allocations. #[clap(long)] - allocation_address: Option, + allocation_address: Option, #[clap(long, parse(from_os_str))] /// Path to JSON file containing initial validator configs [default: latest testnet]. validators_input_file: Option, @@ -218,31 +218,31 @@ 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_PD_JOIN_URL")] + #[clap(env = "penumbra_sdk_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_PD_ARCHIVE_URL")] + #[clap(long, env = "penumbra_sdk_PD_ARCHIVE_URL")] archive_url: Option, /// Human-readable name to identify node on network // Default: 'node-#' - #[clap(long, env = "PENUMBRA_PD_TM_MONIKER")] + #[clap(long, env = "penumbra_sdk_PD_TM_MONIKER")] moniker: Option, /// Public URL to advertise for this node's Tendermint P2P service. /// Setting this option will instruct other nodes on the network to connect /// to yours. Must be in the form of a socket, e.g. "1.2.3.4:26656". - #[clap(long, env = "PENUMBRA_PD_TM_EXTERNAL_ADDR")] + #[clap(long, env = "penumbra_sdk_PD_TM_EXTERNAL_ADDR")] external_address: Option, /// When generating Tendermint config, use this socket to bind the Tendermint RPC service. - #[clap(long, env = "PENUMBRA_PD_TM_RPC_BIND", default_value = "0.0.0.0:26657")] + #[clap(long, env = "penumbra_sdk_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_PD_TM_P2P_BIND", default_value = "0.0.0.0:26656")] + #[clap(long, env = "penumbra_sdk_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_PD_LEAVE_ARCHIVE", action)] + #[clap(long, env = "penumbra_sdk_PD_LEAVE_ARCHIVE", action)] leave_archive: bool, }, diff --git a/crates/bin/pd/src/lib.rs b/crates/bin/pd/src/lib.rs index 01c6a2f02a..c15012033b 100644 --- a/crates/bin/pd/src/lib.rs +++ b/crates/bin/pd/src/lib.rs @@ -13,7 +13,7 @@ pub mod network; pub mod zipserve; pub use crate::metrics::register_metrics; -pub use penumbra_app::app::App; +pub use penumbra_sdk_app::app::App; pub const MINIFRONT_ARCHIVE_BYTES: &[u8] = include_bytes!("../../../../assets/minifront.zip"); diff --git a/crates/bin/pd/src/main.rs b/crates/bin/pd/src/main.rs index be7540df1e..c812ca435a 100644 --- a/crates/bin/pd/src/main.rs +++ b/crates/bin/pd/src/main.rs @@ -19,9 +19,9 @@ use pd::{ join::network_join, }, }; -use penumbra_app::app_version::check_and_update_app_version; -use penumbra_app::{APP_VERSION, SUBSTORE_PREFIXES}; -use penumbra_tower_trace::remote_addr; +use penumbra_sdk_app::app_version::check_and_update_app_version; +use penumbra_sdk_app::{APP_VERSION, SUBSTORE_PREFIXES}; +use penumbra_sdk_tower_trace::remote_addr; use rand::Rng; use rand_core::OsRng; use tendermint_config::net::Address as TendermintAddress; @@ -120,7 +120,7 @@ async fn main() -> anyhow::Result<()> { "starting pd" ); - if penumbra_app::app::App::is_ready(storage.latest_snapshot()).await { + if penumbra_sdk_app::app::App::is_ready(storage.latest_snapshot()).await { tracing::info!("application ready to start"); } else { tracing::warn!("application is halted, refusing to start"); @@ -128,12 +128,12 @@ async fn main() -> anyhow::Result<()> { } let abci_server = tokio::task::spawn( - penumbra_app::server::new(storage.clone()).listen_tcp(abci_bind), + penumbra_sdk_app::server::new(storage.clone()).listen_tcp(abci_bind), ); - let tm_proxy = penumbra_tendermint_proxy::TendermintProxy::new(cometbft_addr); + let tm_proxy = penumbra_sdk_tendermint_proxy::TendermintProxy::new(cometbft_addr); - let grpc_routes = penumbra_app::rpc::routes(&storage, tm_proxy, enable_expensive_rpc)? + let grpc_routes = penumbra_sdk_app::rpc::routes(&storage, tm_proxy, enable_expensive_rpc)? .into_axum_router() .layer( ServiceBuilder::new().layer(TraceLayer::new_for_grpc().make_span_with( @@ -175,7 +175,7 @@ async fn main() -> anyhow::Result<()> { let (grpc_server, acme_worker) = match grpc_auto_https { Some(domain) => { let (acceptor, acme_worker) = - penumbra_auto_https::axum_acceptor(pd_home, domain, !acme_staging); + penumbra_sdk_auto_https::axum_acceptor(pd_home, domain, !acme_staging); let acme_worker = tokio::spawn(acme_worker); let grpc_server = tokio::task::spawn(grpc_server.acceptor(acceptor).serve(make_svc)); @@ -189,7 +189,7 @@ async fn main() -> anyhow::Result<()> { }; // Configure a Prometheus recorder and exporter. - use penumbra_dex::component::metrics::PrometheusBuilderExt; + use penumbra_sdk_dex::component::metrics::PrometheusBuilderExt; let (recorder, exporter) = PrometheusBuilder::new() .with_http_listener(metrics_bind) // Set explicit buckets so that Prometheus endpoint emits true histograms, rather diff --git a/crates/bin/pd/src/metrics.rs b/crates/bin/pd/src/metrics.rs index cfd7016a42..2c23fd4901 100644 --- a/crates/bin/pd/src/metrics.rs +++ b/crates/bin/pd/src/metrics.rs @@ -23,7 +23,7 @@ pub mod sleep_worker; /// functions in our dependencies. pub fn register_metrics() { // This will register metrics for all components. - penumbra_app::register_metrics(); + penumbra_sdk_app::register_metrics(); self::sleep_worker::register_metrics(); self::cpu_worker::register_metrics(); } diff --git a/crates/bin/pd/src/migrate.rs b/crates/bin/pd/src/migrate.rs index bb61b860a5..a438db45df 100644 --- a/crates/bin/pd/src/migrate.rs +++ b/crates/bin/pd/src/migrate.rs @@ -15,13 +15,13 @@ mod testnet77; mod testnet78; use anyhow::{ensure, Context}; -use penumbra_governance::StateReadExt; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_governance::StateReadExt; +use penumbra_sdk_sct::component::clock::EpochRead; use std::path::{Path, PathBuf}; use tracing::instrument; use cnidarium::Storage; -use penumbra_app::SUBSTORE_PREFIXES; +use penumbra_sdk_app::SUBSTORE_PREFIXES; use flate2::write::GzEncoder; use flate2::Compression; diff --git a/crates/bin/pd/src/migrate/mainnet1.rs b/crates/bin/pd/src/migrate/mainnet1.rs index 2123535793..62dd22323c 100644 --- a/crates/bin/pd/src/migrate/mainnet1.rs +++ b/crates/bin/pd/src/migrate/mainnet1.rs @@ -6,13 +6,13 @@ use cnidarium::{StateDelta, Storage}; use ibc_types::core::channel::{Packet, PortId}; use ibc_types::transfer::acknowledgement::TokenTransferAcknowledgement; use jmt::RootHash; -use penumbra_app::app::StateReadExt as _; -use penumbra_app::app_version::migrate_app_version; -use penumbra_governance::StateWriteExt; -use penumbra_ibc::{component::ChannelStateWriteExt as _, IbcRelay}; -use penumbra_sct::component::clock::EpochManager; -use penumbra_sct::component::clock::EpochRead; -use penumbra_transaction::{Action, Transaction}; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_app::app_version::migrate_app_version; +use penumbra_sdk_governance::StateWriteExt; +use penumbra_sdk_ibc::{component::ChannelStateWriteExt as _, IbcRelay}; +use penumbra_sdk_sct::component::clock::EpochManager; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_transaction::{Action, Transaction}; use std::path::PathBuf; use tracing::instrument; @@ -143,7 +143,7 @@ pub async fn migrate( // The migration is complete, now we need to generate a genesis file. To do this, we need // to lookup a validator view from the chain, and specify the post-upgrade app hash and // initial height. - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/mainnet2.rs b/crates/bin/pd/src/migrate/mainnet2.rs index 32a4c4d364..361f194417 100644 --- a/crates/bin/pd/src/migrate/mainnet2.rs +++ b/crates/bin/pd/src/migrate/mainnet2.rs @@ -3,11 +3,11 @@ //! error messages from counterparty chains are processed. use cnidarium::{StateDelta, Storage}; use jmt::RootHash; -use penumbra_app::app::StateReadExt as _; -use penumbra_app::app_version::migrate_app_version; -use penumbra_governance::StateWriteExt; -use penumbra_sct::component::clock::EpochManager; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_app::app_version::migrate_app_version; +use penumbra_sdk_governance::StateWriteExt; +use penumbra_sdk_sct::component::clock::EpochManager; +use penumbra_sdk_sct::component::clock::EpochRead; use std::path::PathBuf; use tracing::instrument; @@ -62,7 +62,7 @@ pub async fn migrate( // The migration is complete, now we need to generate a genesis file. To do this, we need // to lookup a validator view from the chain, and specify the post-upgrade app hash and // initial height. - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/reset_halt_bit.rs b/crates/bin/pd/src/migrate/reset_halt_bit.rs index a2480cd019..843021c5de 100644 --- a/crates/bin/pd/src/migrate/reset_halt_bit.rs +++ b/crates/bin/pd/src/migrate/reset_halt_bit.rs @@ -2,7 +2,7 @@ use anyhow; use cnidarium::{StateDelta, Storage}; -use penumbra_governance::StateWriteExt as _; +use penumbra_sdk_governance::StateWriteExt as _; use std::path::PathBuf; pub async fn migrate( diff --git a/crates/bin/pd/src/migrate/simple.rs b/crates/bin/pd/src/migrate/simple.rs index 60be34387e..8a8cb5749f 100644 --- a/crates/bin/pd/src/migrate/simple.rs +++ b/crates/bin/pd/src/migrate/simple.rs @@ -3,8 +3,8 @@ use anyhow; use cnidarium::{StateDelta, StateWrite, Storage}; use jmt::RootHash; -use penumbra_app::app::StateReadExt as _; -use penumbra_sct::component::clock::{EpochManager, EpochRead}; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_sct::component::clock::{EpochManager, EpochRead}; use std::path::PathBuf; use crate::network::generate::NetworkConfig; @@ -43,7 +43,7 @@ pub async fn migrate( /* ---------- generate genesis ------------ */ let chain_id = migrated_state.get_chain_id().await?; - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/testnet72.rs b/crates/bin/pd/src/migrate/testnet72.rs index f291513074..e7a1409f39 100644 --- a/crates/bin/pd/src/migrate/testnet72.rs +++ b/crates/bin/pd/src/migrate/testnet72.rs @@ -4,14 +4,14 @@ use anyhow; use cnidarium::{Snapshot, StateDelta, StateRead, StateWrite, Storage}; use futures::StreamExt as _; use jmt::RootHash; -use penumbra_app::app::StateReadExt as _; -use penumbra_app::SUBSTORE_PREFIXES; -use penumbra_proto::core::component::sct::v1::query_service_server::QueryService; -use penumbra_proto::penumbra::core::component as pb; -use penumbra_proto::StateWriteProto; -use penumbra_sct::component::clock::{EpochManager, EpochRead}; -use penumbra_sct::component::rpc::Server as SctServer; -use penumbra_tct::Position; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_app::SUBSTORE_PREFIXES; +use penumbra_sdk_proto::core::component::sct::v1::query_service_server::QueryService; +use penumbra_sdk_proto::penumbra::core::component as pb; +use penumbra_sdk_proto::StateWriteProto; +use penumbra_sdk_sct::component::clock::{EpochManager, EpochRead}; +use penumbra_sdk_sct::component::rpc::Server as SctServer; +use penumbra_sdk_tct::Position; use prost::Message; use std::path::PathBuf; use std::sync::Arc; @@ -169,7 +169,7 @@ pub async fn migrate( // to lookup a validator view from the chain, and specify the post-upgrade app hash and // initial height. let chain_id = migrated_state.get_chain_id().await?; - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/testnet74.rs b/crates/bin/pd/src/migrate/testnet74.rs index 3b7769b3e9..9ef62b4962 100644 --- a/crates/bin/pd/src/migrate/testnet74.rs +++ b/crates/bin/pd/src/migrate/testnet74.rs @@ -5,12 +5,12 @@ use anyhow; use cnidarium::{EscapedByteSlice, Snapshot, StateDelta, StateRead, StateWrite, Storage}; use futures::StreamExt as _; use jmt::RootHash; -use penumbra_app::{app::StateReadExt as _, SUBSTORE_PREFIXES}; -use penumbra_auction::{params::AuctionParameters, StateWriteExt}; -use penumbra_dex::SwapExecution; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component as pb, StateReadProto, StateWriteProto}; -use penumbra_sct::component::clock::{EpochManager, EpochRead}; +use penumbra_sdk_app::{app::StateReadExt as _, SUBSTORE_PREFIXES}; +use penumbra_sdk_auction::{params::AuctionParameters, StateWriteExt}; +use penumbra_sdk_dex::SwapExecution; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component as pb, StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::component::clock::{EpochManager, EpochRead}; use std::path::PathBuf; use crate::network::generate::NetworkConfig; @@ -173,7 +173,7 @@ pub async fn migrate( // to lookup a validator view from the chain, and specify the post-upgrade app hash and // initial height. let chain_id = migrated_state.get_chain_id().await?; - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/testnet76.rs b/crates/bin/pd/src/migrate/testnet76.rs index a3bb4eb682..426f40fffe 100644 --- a/crates/bin/pd/src/migrate/testnet76.rs +++ b/crates/bin/pd/src/migrate/testnet76.rs @@ -6,14 +6,14 @@ use cnidarium::{Snapshot, StateDelta, Storage}; use futures::TryStreamExt; use jmt::RootHash; use pbjson_types::Any; -use penumbra_app::app::StateReadExt as _; -use penumbra_asset::Balance; -use penumbra_auction::auction::dutch::DutchAuction; -use penumbra_governance::StateWriteExt; -use penumbra_proto::{DomainType, StateReadProto, StateWriteProto}; -use penumbra_sct::component::clock::{EpochManager, EpochRead}; -use penumbra_shielded_pool::params::ShieldedPoolParameters; -use penumbra_shielded_pool::{component::StateWriteExt as _, fmd::Parameters as FmdParameters}; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_asset::Balance; +use penumbra_sdk_auction::auction::dutch::DutchAuction; +use penumbra_sdk_governance::StateWriteExt; +use penumbra_sdk_proto::{DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::component::clock::{EpochManager, EpochRead}; +use penumbra_sdk_shielded_pool::params::ShieldedPoolParameters; +use penumbra_sdk_shielded_pool::{component::StateWriteExt as _, fmd::Parameters as FmdParameters}; use std::path::PathBuf; use tracing::instrument; @@ -28,7 +28,7 @@ use crate::network::generate::NetworkConfig; /// // *outside* of the auction component, and recorded in the DEX VCB instead. /// 3. Writing the aggregate VCB balance for each asset to the chain state. async fn heal_auction_vcb(delta: &mut StateDelta) -> anyhow::Result<()> { - let key_prefix_auctions = penumbra_auction::state_key::auction_store::prefix(); + let key_prefix_auctions = penumbra_sdk_auction::state_key::auction_store::prefix(); let all_auctions = delta .prefix_proto::(&key_prefix_auctions) .map_ok(|(_, v)| DutchAuction::decode(v.value).expect("only dutch auctions")) @@ -39,12 +39,12 @@ async fn heal_auction_vcb(delta: &mut StateDelta) -> anyhow::Result<() .into_iter() .filter(|auction| auction.state.sequence <= 1) .fold(Balance::zero(), |acc, auction| { - let input_reserves = penumbra_asset::Value { + let input_reserves = penumbra_sdk_asset::Value { asset_id: auction.description.input.asset_id, amount: auction.state.input_reserves, }; - let output_reserves = penumbra_asset::Value { + let output_reserves = penumbra_sdk_asset::Value { asset_id: auction.description.output_id, amount: auction.state.output_reserves, }; @@ -57,7 +57,7 @@ async fn heal_auction_vcb(delta: &mut StateDelta) -> anyhow::Result<() for value in total_vcb.provided() { tracing::debug!(?value, "writing aggregate VCB balance for asset"); let key_vcb_balance = - penumbra_auction::state_key::value_balance::for_asset(&value.asset_id); + penumbra_sdk_auction::state_key::value_balance::for_asset(&value.asset_id); delta.put(key_vcb_balance, value.amount); } @@ -127,7 +127,7 @@ pub async fn migrate( // The migration is complete, now we need to generate a genesis file. To do this, we need // to lookup a validator view from the chain, and specify the post-upgrade app hash and // initial height. - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/testnet77.rs b/crates/bin/pd/src/migrate/testnet77.rs index d92c6373a3..9df111c4ee 100644 --- a/crates/bin/pd/src/migrate/testnet77.rs +++ b/crates/bin/pd/src/migrate/testnet77.rs @@ -5,10 +5,10 @@ use anyhow::Context; use cnidarium::{StateDelta, Storage}; use jmt::RootHash; -use penumbra_app::app::StateReadExt as _; -use penumbra_governance::StateWriteExt; -use penumbra_sct::component::clock::EpochManager; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_governance::StateWriteExt; +use penumbra_sdk_sct::component::clock::EpochManager; +use penumbra_sdk_sct::component::clock::EpochRead; use std::path::PathBuf; use tracing::instrument; @@ -51,7 +51,7 @@ pub async fn migrate( // The migration is complete, now we need to generate a genesis file. To do this, we need // to lookup a validator view from the chain, and specify the post-upgrade app hash and // initial height. - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; diff --git a/crates/bin/pd/src/migrate/testnet78.rs b/crates/bin/pd/src/migrate/testnet78.rs index 3d6bc886ce..b4811eb486 100644 --- a/crates/bin/pd/src/migrate/testnet78.rs +++ b/crates/bin/pd/src/migrate/testnet78.rs @@ -6,19 +6,19 @@ use cnidarium::{Snapshot, StateDelta, StateWrite, Storage}; use futures::TryStreamExt as _; use futures::{pin_mut, StreamExt}; use jmt::RootHash; -use penumbra_app::app::StateReadExt as _; -use penumbra_dex::component::{PositionManager, StateReadExt, StateWriteExt}; -use penumbra_dex::lp::position; -use penumbra_dex::lp::position::Position; -use penumbra_governance::proposal_state::State as ProposalState; -use penumbra_governance::Proposal; -use penumbra_governance::StateReadExt as _; -use penumbra_governance::StateWriteExt as _; -use penumbra_proto::core::component::governance::v1 as pb_governance; -use penumbra_proto::{StateReadProto, StateWriteProto}; -use penumbra_sct::component::clock::EpochManager; -use penumbra_sct::component::clock::EpochRead; -use penumbra_stake::validator::Validator; +use penumbra_sdk_app::app::StateReadExt as _; +use penumbra_sdk_dex::component::{PositionManager, StateReadExt, StateWriteExt}; +use penumbra_sdk_dex::lp::position; +use penumbra_sdk_dex::lp::position::Position; +use penumbra_sdk_governance::proposal_state::State as ProposalState; +use penumbra_sdk_governance::Proposal; +use penumbra_sdk_governance::StateReadExt as _; +use penumbra_sdk_governance::StateWriteExt as _; +use penumbra_sdk_proto::core::component::governance::v1 as pb_governance; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::component::clock::EpochManager; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_stake::validator::Validator; use std::fs::OpenOptions; use std::io::Write; use std::path::PathBuf; @@ -116,7 +116,7 @@ pub async fn migrate( tracing::info!("migration completed, generating genesis and signing state..."); /* `Migration::complete`: the state transition has been performed, we prepare the checkpointed genesis and signing state */ - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id, ..Default::default() }; @@ -194,7 +194,7 @@ async fn update_dex_params(delta: &mut StateDelta) -> anyhow::Result<( /// Reindex opened liquidity positions to augment the price indexes. async fn reindex_dex_positions(delta: &mut StateDelta) -> anyhow::Result<()> { tracing::info!("running dex re-indexing migration"); - let prefix_key_lp = penumbra_dex::state_key::all_positions(); + let prefix_key_lp = penumbra_sdk_dex::state_key::all_positions(); let stream_all_lp = delta.prefix::(&prefix_key_lp); let stream_open_lp = stream_all_lp.filter_map(|entry| async { match entry { @@ -210,7 +210,7 @@ async fn reindex_dex_positions(delta: &mut StateDelta) -> anyhow::Resu // Close the position, adjusting all its index entries. delta.close_position_by_id(&id).await?; // Erase the position from the state, so that we circumvent the `update_position` guard. - delta.delete(penumbra_dex::state_key::position_by_id(&id)); + delta.delete(penumbra_sdk_dex::state_key::position_by_id(&id)); // Open a position with the adjusted indexing logic. delta.open_position(lp).await?; } @@ -224,14 +224,14 @@ async fn reindex_dex_positions(delta: &mut StateDelta) -> anyhow::Resu /// - `description` (280 bytes) async fn truncate_validator_fields(delta: &mut StateDelta) -> anyhow::Result<()> { tracing::info!("truncating validator fields"); - let key_prefix_validators = penumbra_stake::state_key::validators::definitions::prefix(); + let key_prefix_validators = penumbra_sdk_stake::state_key::validators::definitions::prefix(); let all_validators = delta - .prefix_proto::( + .prefix_proto::( &key_prefix_validators, ) .try_collect::>() .await?; @@ -271,7 +271,7 @@ async fn truncate_proposal_fields(delta: &mut StateDelta) -> anyhow::R tracing::info!("truncating proposal: {}", proposal_id); let proposal = delta .get_proto::( - &penumbra_governance::state_key::proposal_definition(proposal_id), + &penumbra_sdk_governance::state_key::proposal_definition(proposal_id), ) .await?; @@ -348,12 +348,12 @@ async fn truncate_proposal_fields(delta: &mut StateDelta) -> anyhow::R // Store the truncated proposal data tracing::info!( "put key {:?}", - penumbra_governance::state_key::proposal_definition(proposal_id) + penumbra_sdk_governance::state_key::proposal_definition(proposal_id) ); // Ensure the proposal can be serialized back to the domain type: let proposal: Proposal = proposal.try_into()?; delta.put( - penumbra_governance::state_key::proposal_definition(proposal_id), + penumbra_sdk_governance::state_key::proposal_definition(proposal_id), proposal, ); } @@ -372,7 +372,7 @@ async fn truncate_proposal_outcome_fields(delta: &mut StateDelta) -> a tracing::info!("truncating proposal outcomes: {}", proposal_id); let proposal_state = delta .get_proto::( - &penumbra_governance::state_key::proposal_state(proposal_id), + &penumbra_sdk_governance::state_key::proposal_state(proposal_id), ) .await?; @@ -518,11 +518,11 @@ async fn truncate_proposal_outcome_fields(delta: &mut StateDelta) -> a // Store the truncated proposal state data tracing::info!( "put key {:?}", - penumbra_governance::state_key::proposal_state(proposal_id) + penumbra_sdk_governance::state_key::proposal_state(proposal_id) ); let proposal_state: ProposalState = proposal_state.try_into()?; delta.put( - penumbra_governance::state_key::proposal_state(proposal_id), + penumbra_sdk_governance::state_key::proposal_state(proposal_id), proposal_state, ); } diff --git a/crates/bin/pd/src/network/config.rs b/crates/bin/pd/src/network/config.rs index 1cc87b6c1f..dabf18463c 100644 --- a/crates/bin/pd/src/network/config.rs +++ b/crates/bin/pd/src/network/config.rs @@ -1,9 +1,9 @@ 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_keys::keys::{SpendKey, SpendKeyBytes}; +use penumbra_sdk_app::genesis::AppState; +use penumbra_sdk_custody::soft_kms::Config as SoftKmsConfig; +use penumbra_sdk_keys::keys::{SpendKey, SpendKeyBytes}; use rand::Rng; use rand_core::OsRng; use regex::{Captures, Regex}; diff --git a/crates/bin/pd/src/network/generate.rs b/crates/bin/pd/src/network/generate.rs index cefb71750c..a21e73937e 100644 --- a/crates/bin/pd/src/network/generate.rs +++ b/crates/bin/pd/src/network/generate.rs @@ -3,21 +3,21 @@ //! for Penumbra. use crate::network::config::{get_network_dir, NetworkTendermintConfig, ValidatorKeys}; use anyhow::{Context, Result}; -use penumbra_app::{ +use penumbra_sdk_app::{ app::{MAX_BLOCK_TXS_PAYLOAD_BYTES, MAX_EVIDENCE_SIZE_BYTES}, params::AppParameters, }; -use penumbra_asset::{asset, STAKING_TOKEN_ASSET_ID}; -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; -use penumbra_sct::params::SctParameters; -use penumbra_shielded_pool::{ +use penumbra_sdk_asset::{asset, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_fee::genesis::Content as FeeContent; +use penumbra_sdk_governance::genesis::Content as GovernanceContent; +use penumbra_sdk_keys::{keys::SpendKey, Address}; +use penumbra_sdk_sct::genesis::Content as SctContent; +use penumbra_sdk_sct::params::SctParameters; +use penumbra_sdk_shielded_pool::{ genesis::{self as shielded_pool_genesis, Allocation, Content as ShieldedPoolContent}, params::ShieldedPoolParameters, }; -use penumbra_stake::{ +use penumbra_sdk_stake::{ genesis::Content as StakeContent, params::StakeParameters, validator::Validator, DelegationToken, FundingStream, FundingStreams, GovernanceKey, IdentityKey, }; @@ -40,7 +40,7 @@ pub struct NetworkConfig { /// 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 network_dir: PathBuf, /// Set of validators at genesis. Uses the convenient wrapper type @@ -200,10 +200,10 @@ impl NetworkConfig { unbonding_delay: Option, proposal_voting_blocks: Option, gas_price_simple: Option, - ) -> anyhow::Result { - let default_gov_params = penumbra_governance::params::GovernanceParameters::default(); + ) -> anyhow::Result { + let default_gov_params = penumbra_sdk_governance::params::GovernanceParameters::default(); - let gov_params = penumbra_governance::params::GovernanceParameters { + let gov_params = penumbra_sdk_governance::params::GovernanceParameters { proposal_voting_blocks: proposal_voting_blocks .unwrap_or(default_gov_params.proposal_voting_blocks), ..default_gov_params @@ -214,7 +214,7 @@ impl NetworkConfig { let gas_price_simple = gas_price_simple.unwrap_or_default(); - let app_state = penumbra_app::genesis::Content { + let app_state = penumbra_sdk_app::genesis::Content { chain_id: chain_id.to_string(), stake_content: StakeContent { validators: validators.into_iter().map(Into::into).collect(), @@ -227,8 +227,8 @@ impl NetworkConfig { }, }, fee_content: FeeContent { - fee_params: penumbra_fee::params::FeeParameters { - fixed_gas_prices: penumbra_fee::GasPrices { + fee_params: penumbra_sdk_fee::params::FeeParameters { + fixed_gas_prices: penumbra_sdk_fee::GasPrices { block_space_price: gas_price_simple, compact_block_space_price: gas_price_simple, verification_price: gas_price_simple, @@ -236,14 +236,14 @@ impl NetworkConfig { asset_id: *STAKING_TOKEN_ASSET_ID, }, fixed_alt_gas_prices: vec![ - penumbra_fee::GasPrices { + penumbra_sdk_fee::GasPrices { block_space_price: 10 * gas_price_simple, compact_block_space_price: 10 * gas_price_simple, verification_price: 10 * gas_price_simple, execution_price: 10 * gas_price_simple, asset_id: asset::REGISTRY.parse_unit("gm").id(), }, - penumbra_fee::GasPrices { + penumbra_sdk_fee::GasPrices { block_space_price: 10 * gas_price_simple, compact_block_space_price: 10 * gas_price_simple, verification_price: 10 * gas_price_simple, @@ -273,8 +273,8 @@ impl NetworkConfig { /// Build Tendermint genesis data, based on Penumbra initial application state. pub(crate) fn make_genesis( - app_state: penumbra_app::genesis::Content, - ) -> anyhow::Result> { + app_state: penumbra_sdk_app::genesis::Content, + ) -> anyhow::Result> { // Use now as genesis time let genesis_time = Time::from_unix_timestamp( SystemTime::now() @@ -320,7 +320,7 @@ impl NetworkConfig { }, // always empty in genesis json app_hash: tendermint::AppHash::default(), - app_state: penumbra_app::genesis::AppState::Content(app_state), + app_state: penumbra_sdk_app::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 @@ -330,12 +330,12 @@ impl NetworkConfig { } pub(crate) fn make_checkpoint( - genesis: Genesis, + genesis: Genesis, checkpoint: Option>, - ) -> Genesis { + ) -> Genesis { match checkpoint { Some(checkpoint) => Genesis { - app_state: penumbra_app::genesis::AppState::Checkpoint(checkpoint), + app_state: penumbra_sdk_app::genesis::AppState::Checkpoint(checkpoint), ..genesis }, None => genesis, @@ -773,7 +773,7 @@ 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 penumbra_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + let penumbra_sdk_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state else { unimplemented!("TODO: support checkpointed app state") }; @@ -803,7 +803,7 @@ mod tests { )?; assert_eq!(testnet_config.name, "test-chain-4567"); assert_eq!(testnet_config.genesis.validators.len(), 0); - let penumbra_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + let penumbra_sdk_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state else { unimplemented!("TODO: support checkpointed app state") }; diff --git a/crates/bin/pd/tests/network_integration.rs b/crates/bin/pd/tests/network_integration.rs index ca3116de6f..c791ad6fe0 100644 --- a/crates/bin/pd/tests/network_integration.rs +++ b/crates/bin/pd/tests/network_integration.rs @@ -6,7 +6,7 @@ use assert_cmd::Command; use http::StatusCode; -use penumbra_proto::FILE_DESCRIPTOR_SET; +use penumbra_sdk_proto::FILE_DESCRIPTOR_SET; use predicates::prelude::*; use prost_reflect::{DescriptorPool, ServiceDescriptor}; use url::Url; @@ -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_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string()); + std::env::var("penumbra_sdk_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!( @@ -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_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string()); + std::env::var("penumbra_sdk_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(()) @@ -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_NODE_PD_URL") + let pd_url: Url = std::env::var("penumbra_sdk_NODE_PD_URL") .unwrap_or("http://localhost:8080".to_string()) .parse() .unwrap(); @@ -102,7 +102,7 @@ async fn check_grpc_server_reflection() -> anyhow::Result<()> { /// - penumbra.view.v1.ViewService /// - penumbra.core.component.dex.v1.SimulationService /// -/// The gRPC service names are read from the [penumbra_proto] crate's [FILE_DESCRIPTOR_SET], +/// The gRPC service names are read from the [penumbra_sdk_proto] crate's [FILE_DESCRIPTOR_SET], /// which is exported at build time. fn get_all_grpc_services() -> anyhow::Result> { // Intentionally verbose to be explicit. diff --git a/crates/bin/pindexer/src/block.rs b/crates/bin/pindexer/src/block.rs index 9308bd0595..9d0eee7638 100644 --- a/crates/bin/pindexer/src/block.rs +++ b/crates/bin/pindexer/src/block.rs @@ -1,5 +1,5 @@ use cometindex::{async_trait, index::EventBatch, sqlx, AppView, PgTransaction}; -use penumbra_proto::{core::component::sct::v1 as pb, event::ProtoEvent}; +use penumbra_sdk_proto::{core::component::sct::v1 as pb, event::ProtoEvent}; use sqlx::types::chrono::DateTime; #[derive(Debug)] diff --git a/crates/bin/pindexer/src/dex_ex/mod.rs b/crates/bin/pindexer/src/dex_ex/mod.rs index 4868fc3e36..15097efea3 100644 --- a/crates/bin/pindexer/src/dex_ex/mod.rs +++ b/crates/bin/pindexer/src/dex_ex/mod.rs @@ -4,9 +4,9 @@ use cometindex::{ index::{BlockEvents, EventBatch}, AppView, PgTransaction, }; -use penumbra_asset::asset; -use penumbra_dex::lp::position::{Id as PositionId, Position}; -use penumbra_dex::{ +use penumbra_sdk_asset::asset; +use penumbra_sdk_dex::lp::position::{Id as PositionId, Position}; +use penumbra_sdk_dex::{ event::{ EventCandlestickData, EventPositionClose, EventPositionExecution, EventPositionOpen, EventPositionWithdraw, EventQueuePositionClose, @@ -14,10 +14,10 @@ use penumbra_dex::{ lp::Reserves, DirectedTradingPair, TradingPair, }; -use penumbra_num::Amount; -use penumbra_proto::event::EventDomainType; -use penumbra_proto::DomainType; -use penumbra_sct::event::EventBlockRoot; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::event::EventDomainType; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_sct::event::EventBlockRoot; use sqlx::types::BigDecimal; use sqlx::Row; use std::collections::{BTreeMap, HashMap, HashSet}; @@ -27,7 +27,7 @@ type DateTime = sqlx::types::chrono::DateTime; mod candle { use super::DateTime; use chrono::{Datelike as _, Days, TimeDelta, TimeZone as _, Timelike as _, Utc}; - use penumbra_dex::CandlestickData; + use penumbra_sdk_dex::CandlestickData; use std::fmt::Display; fn geo_mean(a: f64, b: f64) -> f64 { @@ -365,7 +365,7 @@ use price_chart::Context as PriceChartContext; mod summary { use cometindex::PgTransaction; - use penumbra_asset::asset; + use penumbra_sdk_asset::asset; use super::{Candle, DateTime, PairMetrics, Window}; diff --git a/crates/bin/pindexer/src/governance.rs b/crates/bin/pindexer/src/governance.rs index 4d16090e58..ed8d1e2777 100644 --- a/crates/bin/pindexer/src/governance.rs +++ b/crates/bin/pindexer/src/governance.rs @@ -2,16 +2,16 @@ use anyhow::{anyhow, Context, Result}; use cometindex::{ async_trait, index::EventBatch, sqlx, AppView, ContextualizedEvent, PgTransaction, }; -use penumbra_governance::{ +use penumbra_sdk_governance::{ proposal::ProposalPayloadToml, proposal_state, DelegatorVote, Proposal, ProposalDepositClaim, ProposalWithdraw, ValidatorVote, }; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ core::component::governance::v1::{self as pb}, event::ProtoEvent, }; -use penumbra_stake::IdentityKey; +use penumbra_sdk_stake::IdentityKey; #[derive(Debug)] pub struct GovernanceProposals {} diff --git a/crates/bin/pindexer/src/ibc/mod.rs b/crates/bin/pindexer/src/ibc/mod.rs index 417fd5ca19..b74c93b49f 100644 --- a/crates/bin/pindexer/src/ibc/mod.rs +++ b/crates/bin/pindexer/src/ibc/mod.rs @@ -1,8 +1,8 @@ use anyhow::anyhow; use cometindex::{async_trait, index::EventBatch, AppView, ContextualizedEvent, PgTransaction}; -use penumbra_asset::Value; -use penumbra_keys::Address; -use penumbra_proto::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::{ core::component::shielded_pool::v1::{ self as pb, event_outbound_fungible_token_refund::Reason as RefundReason, }, @@ -109,7 +109,7 @@ impl TryFrom<&ContextualizedEvent> for Event { /// The database's view of a transfer. #[derive(Debug)] struct DatabaseTransfer { - penumbra_addr: Address, + penumbra_sdk_addr: Address, foreign_addr: String, negate: bool, value: Value, @@ -124,7 +124,7 @@ impl Event { sender, value, } => DatabaseTransfer { - penumbra_addr: receiver, + penumbra_sdk_addr: receiver, foreign_addr: sender, negate: false, value, @@ -135,7 +135,7 @@ impl Event { receiver, value, } => DatabaseTransfer { - penumbra_addr: sender, + penumbra_sdk_addr: sender, foreign_addr: receiver, negate: true, value, @@ -147,7 +147,7 @@ impl Event { value, reason, } => DatabaseTransfer { - penumbra_addr: sender, + penumbra_sdk_addr: sender, foreign_addr: receiver, negate: false, value, @@ -176,7 +176,7 @@ async fn create_transfer( sqlx::query("INSERT INTO ibc_transfer VALUES (DEFAULT, $7, $1, $6::NUMERIC(39, 0) * $2::NUMERIC(39, 0), $3, $4, $5)") .bind(transfer.value.asset_id.to_bytes()) .bind(transfer.value.amount.to_string()) - .bind(transfer.penumbra_addr.to_vec()) + .bind(transfer.penumbra_sdk_addr.to_vec()) .bind(transfer.foreign_addr) .bind(transfer.kind) .bind(if transfer.negate { -1i32 } else { 1i32 }) diff --git a/crates/bin/pindexer/src/indexer_ext.rs b/crates/bin/pindexer/src/indexer_ext.rs index 4f836aa925..08c6ab175a 100644 --- a/crates/bin/pindexer/src/indexer_ext.rs +++ b/crates/bin/pindexer/src/indexer_ext.rs @@ -1,11 +1,11 @@ use std::str::FromStr; pub trait IndexerExt: Sized { - fn with_default_penumbra_app_views(self) -> Self; + fn with_default_penumbra_sdk_app_views(self) -> Self; } impl IndexerExt for cometindex::Indexer { - fn with_default_penumbra_app_views(self) -> Self { + fn with_default_penumbra_sdk_app_views(self) -> Self { self.with_index(Box::new(crate::block::Block {})) .with_index(Box::new(crate::stake::ValidatorSet {})) .with_index(Box::new(crate::stake::Slashings {})) @@ -13,7 +13,7 @@ impl IndexerExt for cometindex::Indexer { .with_index(Box::new(crate::stake::UndelegationTxs {})) .with_index(Box::new(crate::governance::GovernanceProposals {})) .with_index(Box::new(crate::dex_ex::Component::new( - penumbra_asset::asset::Id::from_str( + penumbra_sdk_asset::asset::Id::from_str( // USDC "passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6", ) @@ -23,7 +23,7 @@ impl IndexerExt for cometindex::Indexer { .with_index(Box::new(crate::supply::Component::new())) .with_index(Box::new(crate::ibc::Component::new())) .with_index(Box::new(crate::insights::Component::new( - penumbra_asset::asset::Id::from_str( + penumbra_sdk_asset::asset::Id::from_str( // USDC "passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6", ) diff --git a/crates/bin/pindexer/src/insights/mod.rs b/crates/bin/pindexer/src/insights/mod.rs index ba4f451743..5114bd0029 100644 --- a/crates/bin/pindexer/src/insights/mod.rs +++ b/crates/bin/pindexer/src/insights/mod.rs @@ -1,21 +1,21 @@ use std::{collections::BTreeMap, iter}; use cometindex::{async_trait, index::EventBatch, AppView, ContextualizedEvent, PgTransaction}; -use penumbra_app::genesis::Content; -use penumbra_asset::{asset, STAKING_TOKEN_ASSET_ID}; -use penumbra_dex::{ +use penumbra_sdk_app::genesis::Content; +use penumbra_sdk_asset::{asset, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_dex::{ event::{EventArbExecution, EventCandlestickData}, DirectedTradingPair, }; -use penumbra_fee::event::EventBlockFees; -use penumbra_funding::event::EventFundingStreamReward; -use penumbra_num::Amount; -use penumbra_proto::event::EventDomainType; -use penumbra_shielded_pool::event::{ +use penumbra_sdk_fee::event::EventBlockFees; +use penumbra_sdk_funding::event::EventFundingStreamReward; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::event::EventDomainType; +use penumbra_sdk_shielded_pool::event::{ EventInboundFungibleTokenTransfer, EventOutboundFungibleTokenRefund, EventOutboundFungibleTokenTransfer, }; -use penumbra_stake::{ +use penumbra_sdk_stake::{ event::{EventDelegate, EventRateDataChange, EventUndelegate}, validator::Validator, IdentityKey, diff --git a/crates/bin/pindexer/src/main.rs b/crates/bin/pindexer/src/main.rs index fee7ab0f90..df39fe052b 100644 --- a/crates/bin/pindexer/src/main.rs +++ b/crates/bin/pindexer/src/main.rs @@ -6,7 +6,7 @@ use pindexer::{Indexer, IndexerExt as _, Options}; async fn main() -> Result<()> { Indexer::new(Options::parse()) .with_default_tracing() - .with_default_penumbra_app_views() + .with_default_penumbra_sdk_app_views() .run() .await?; diff --git a/crates/bin/pindexer/src/parsing.rs b/crates/bin/pindexer/src/parsing.rs index 51bd104059..206dd40578 100644 --- a/crates/bin/pindexer/src/parsing.rs +++ b/crates/bin/pindexer/src/parsing.rs @@ -1,5 +1,5 @@ use anyhow::{anyhow, Context as _}; -use penumbra_app::genesis::{AppState, Content}; +use penumbra_sdk_app::genesis::{AppState, Content}; use serde_json::Value; const GENESIS_NO_CONTENT_ERROR: &'static str = r#" diff --git a/crates/bin/pindexer/src/stake/delegation_txs.rs b/crates/bin/pindexer/src/stake/delegation_txs.rs index bacbd5276e..2744ad305f 100644 --- a/crates/bin/pindexer/src/stake/delegation_txs.rs +++ b/crates/bin/pindexer/src/stake/delegation_txs.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Result}; use cometindex::{async_trait, index::EventBatch, sqlx, AppView, PgTransaction}; -use penumbra_num::Amount; -use penumbra_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; -use penumbra_stake::IdentityKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; +use penumbra_sdk_stake::IdentityKey; #[derive(Debug)] pub struct DelegationTxs {} diff --git a/crates/bin/pindexer/src/stake/missed_blocks.rs b/crates/bin/pindexer/src/stake/missed_blocks.rs index a289ca0b4a..adac389c1f 100644 --- a/crates/bin/pindexer/src/stake/missed_blocks.rs +++ b/crates/bin/pindexer/src/stake/missed_blocks.rs @@ -1,8 +1,8 @@ use anyhow::Result; use cometindex::{async_trait, index::EventBatch, sqlx, AppView, PgTransaction}; -use penumbra_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; -use penumbra_stake::IdentityKey; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; +use penumbra_sdk_stake::IdentityKey; #[derive(Debug)] pub struct MissedBlocks {} diff --git a/crates/bin/pindexer/src/stake/slashings.rs b/crates/bin/pindexer/src/stake/slashings.rs index 68134c6690..47f529f3c1 100644 --- a/crates/bin/pindexer/src/stake/slashings.rs +++ b/crates/bin/pindexer/src/stake/slashings.rs @@ -3,8 +3,8 @@ use cometindex::{ async_trait, index::EventBatch, sqlx, AppView, ContextualizedEvent, PgTransaction, }; -use penumbra_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; -use penumbra_stake::IdentityKey; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; +use penumbra_sdk_stake::IdentityKey; #[derive(Debug)] pub struct Slashings {} diff --git a/crates/bin/pindexer/src/stake/undelegation_txs.rs b/crates/bin/pindexer/src/stake/undelegation_txs.rs index e9a0a31d48..b045b79c57 100644 --- a/crates/bin/pindexer/src/stake/undelegation_txs.rs +++ b/crates/bin/pindexer/src/stake/undelegation_txs.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Result}; use cometindex::{async_trait, index::EventBatch, sqlx, AppView, PgTransaction}; -use penumbra_num::Amount; -use penumbra_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; -use penumbra_stake::IdentityKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; +use penumbra_sdk_stake::IdentityKey; #[derive(Debug)] pub struct UndelegationTxs {} diff --git a/crates/bin/pindexer/src/stake/validator_set.rs b/crates/bin/pindexer/src/stake/validator_set.rs index 039b35c03c..2d637b3ea4 100644 --- a/crates/bin/pindexer/src/stake/validator_set.rs +++ b/crates/bin/pindexer/src/stake/validator_set.rs @@ -5,11 +5,11 @@ use cometindex::{ async_trait, index::EventBatch, sqlx, AppView, ContextualizedEvent, PgTransaction, }; -use penumbra_app::genesis::Content; -use penumbra_asset::asset; -use penumbra_num::Amount; -use penumbra_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; -use penumbra_stake::{ +use penumbra_sdk_app::genesis::Content; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, event::ProtoEvent}; +use penumbra_sdk_stake::{ validator::{self, Validator}, IdentityKey, }; diff --git a/crates/bin/pindexer/src/supply.rs b/crates/bin/pindexer/src/supply.rs index cc5b9f9bae..0226ab55aa 100644 --- a/crates/bin/pindexer/src/supply.rs +++ b/crates/bin/pindexer/src/supply.rs @@ -4,17 +4,17 @@ use anyhow::{anyhow, Result}; use cometindex::{ async_trait, index::EventBatch, sqlx, AppView, ContextualizedEvent, PgTransaction, }; -use penumbra_app::genesis::Content; -use penumbra_asset::{asset, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_app::genesis::Content; +use penumbra_sdk_asset::{asset, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ event::ProtoEvent, penumbra::core::component::{ auction::v1 as pb_auction, dex::v1 as pb_dex, fee::v1 as pb_fee, funding::v1 as pb_funding, stake::v1 as pb_stake, }, }; -use penumbra_stake::{rate::RateData, validator::Validator, IdentityKey}; +use penumbra_sdk_stake::{rate::RateData, validator::Validator, IdentityKey}; use sqlx::{Postgres, Transaction}; use std::iter; @@ -127,8 +127,8 @@ mod delegated_supply { //! This module handles updates around the delegated supply to a validator. use anyhow::{anyhow, Result}; use cometindex::PgTransaction; - use penumbra_num::fixpoint::U128x128; - use penumbra_stake::{rate::RateData, IdentityKey}; + use penumbra_sdk_num::fixpoint::U128x128; + use penumbra_sdk_stake::{rate::RateData, IdentityKey}; const BPS_SQUARED: u64 = 1_0000_0000u64; @@ -413,11 +413,11 @@ enum Event { }, DexArb { height: u64, - swap_execution: penumbra_dex::SwapExecution, + swap_execution: penumbra_sdk_dex::SwapExecution, }, BlockFees { height: u64, - total: penumbra_fee::Fee, + total: penumbra_sdk_fee::Fee, }, } diff --git a/crates/bin/pmonitor/src/config.rs b/crates/bin/pmonitor/src/config.rs index 8b521ff8a1..b9500dacdc 100644 --- a/crates/bin/pmonitor/src/config.rs +++ b/crates/bin/pmonitor/src/config.rs @@ -5,8 +5,8 @@ use serde::{Deserialize, Serialize}; use url::Url; use uuid::Uuid; -use penumbra_keys::FullViewingKey; -use penumbra_num::Amount; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_num::Amount; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct FvkEntry { diff --git a/crates/bin/pmonitor/src/genesis.rs b/crates/bin/pmonitor/src/genesis.rs index a526e2899d..3cb238e376 100644 --- a/crates/bin/pmonitor/src/genesis.rs +++ b/crates/bin/pmonitor/src/genesis.rs @@ -3,16 +3,16 @@ //! stored in the `pmonitor` config file, so that audit actions can reference it. use std::{collections::BTreeMap, str::FromStr}; -use penumbra_asset::STAKING_TOKEN_ASSET_ID; -use penumbra_compact_block::{CompactBlock, StatePayload}; -use penumbra_keys::FullViewingKey; -use penumbra_num::Amount; -use penumbra_shielded_pool::{Note, NotePayload}; -use penumbra_stake::{ +use penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID; +use penumbra_sdk_compact_block::{CompactBlock, StatePayload}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_shielded_pool::{Note, NotePayload}; +use penumbra_sdk_stake::{ rate::{BaseRateData, RateData}, DelegationToken, }; -use penumbra_tct::StateCommitment; +use penumbra_sdk_tct::StateCommitment; #[derive(Debug, Clone)] pub struct FilteredGenesisBlock { diff --git a/crates/bin/pmonitor/src/main.rs b/crates/bin/pmonitor/src/main.rs index 372f425adb..88384961c4 100644 --- a/crates/bin/pmonitor/src/main.rs +++ b/crates/bin/pmonitor/src/main.rs @@ -19,7 +19,7 @@ use camino::Utf8PathBuf; use clap::{self, Parser}; use directories::ProjectDirs; use futures::StreamExt; -use penumbra_asset::STAKING_TOKEN_ASSET_ID; +use penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID; use std::fs; use std::io::IsTerminal as _; use std::str::FromStr; @@ -31,21 +31,21 @@ use uuid::Uuid; use colored::Colorize; use pcli::config::PcliConfig; -use penumbra_compact_block::CompactBlock; -use penumbra_keys::FullViewingKey; -use penumbra_num::Amount; -use penumbra_proto::box_grpc_svc; -use penumbra_proto::view::v1::{ +use penumbra_sdk_compact_block::CompactBlock; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::box_grpc_svc; +use penumbra_sdk_proto::view::v1::{ view_service_client::ViewServiceClient, view_service_server::ViewServiceServer, }; -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::compact_block::v1::CompactBlockRequest, core::component::stake::v1::query_service_client::QueryServiceClient as StakeQueryServiceClient, penumbra::core::component::compact_block::v1::query_service_client::QueryServiceClient as CompactBlockQueryServiceClient, }; -use penumbra_stake::rate::RateData; -use penumbra_stake::DelegationToken; -use penumbra_view::{Storage, ViewClient, ViewServer}; +use penumbra_sdk_stake::rate::RateData; +use penumbra_sdk_stake::DelegationToken; +use penumbra_sdk_view::{Storage, ViewClient, ViewServer}; mod config; mod genesis; @@ -72,7 +72,7 @@ fn init_tracing() -> anyhow::Result<()> { .with_target(true); // The `EnvFilter` layer is used to filter events based on `RUST_LOG`. let filter_layer = EnvFilter::try_from_default_env() - .or_else(|_| EnvFilter::try_new("info,penumbra_view=off"))?; + .or_else(|_| EnvFilter::try_new("info,penumbra_sdk_view=off"))?; // Register the tracing subscribers. let registry = tracing_subscriber::registry() @@ -112,7 +112,7 @@ pub struct Opt { #[clap(subcommand)] pub cmd: Command, /// The path used to store pmonitor state. - #[clap(long, default_value_t = default_home(), env = "PENUMBRA_PMONITOR_HOME")] + #[clap(long, default_value_t = default_home(), env = "penumbra_sdk_PMONITOR_HOME")] pub home: Utf8PathBuf, } diff --git a/crates/bin/pmonitor/tests/common/mod.rs b/crates/bin/pmonitor/tests/common/mod.rs index a1465ee712..9a3be25665 100644 --- a/crates/bin/pmonitor/tests/common/mod.rs +++ b/crates/bin/pmonitor/tests/common/mod.rs @@ -7,7 +7,7 @@ use anyhow::{Context, Result}; use assert_cmd::Command as AssertCommand; use once_cell::sync::Lazy; use pcli::config::PcliConfig; -use penumbra_keys::address::Address; +use penumbra_sdk_keys::address::Address; use std::fs::{create_dir_all, remove_dir_all, File}; use std::io::{BufWriter, Write}; use std::path::PathBuf; @@ -124,8 +124,8 @@ impl PmonitorTestRunner { let mut results = Vec::
::new(); for i in 0..self.num_wallets - 1 { let pcli_home = self.wallets_dir()?.join(format!("wallet-{}", i)); - let penumbra_address = pcli_view_address(&pcli_home)?; - results.push(penumbra_address); + let penumbra_sdk_address = pcli_view_address(&pcli_home)?; + results.push(penumbra_sdk_address); } Ok(results) } diff --git a/crates/bin/pmonitor/tests/common/pcli_helpers.rs b/crates/bin/pmonitor/tests/common/pcli_helpers.rs index c62cc4c057..6de1c65c25 100644 --- a/crates/bin/pmonitor/tests/common/pcli_helpers.rs +++ b/crates/bin/pmonitor/tests/common/pcli_helpers.rs @@ -3,7 +3,7 @@ use anyhow::{Context, Result}; use assert_cmd::Command as AssertCommand; -use penumbra_keys::{address::Address, FullViewingKey}; +use penumbra_sdk_keys::{address::Address, FullViewingKey}; use std::path::PathBuf; use std::str::FromStr; diff --git a/crates/cnidarium-component/src/action_handler.rs b/crates/cnidarium-component/src/action_handler.rs index abb64eae57..f0a0548d75 100644 --- a/crates/cnidarium-component/src/action_handler.rs +++ b/crates/cnidarium-component/src/action_handler.rs @@ -13,7 +13,7 @@ use cnidarium::{StateRead, StateWrite}; /// /// The `ActionHandler` trait has a top-level implementation on [`Transaction`], /// which performs any transaction-wide checks and then calls the -/// `ActionHandler` implementation for each [`Action`](penumbra_transaction::Action). +/// `ActionHandler` implementation for each [`Action`](penumbra_sdk_transaction::Action). /// /// The validation logic in the `ActionHandler` trait is split into three phases: /// diff --git a/crates/cnidarium-component/src/lib.rs b/crates/cnidarium-component/src/lib.rs index 8339bee9aa..bd3af355bc 100644 --- a/crates/cnidarium-component/src/lib.rs +++ b/crates/cnidarium-component/src/lib.rs @@ -23,14 +23,14 @@ //! The structure of the feature-gated `component` submodule allows reusing data //! structures between client and server (fullnode) code. //! -//! For instance, the `penumbra_transaction` crate depends on all of the +//! For instance, the `penumbra_sdk_transaction` crate depends on all of the //! component crates without the `component` feature, so it can assemble all of //! the actions for each component into a top-level transaction type. This //! means all async code should be confined to the `component` module, so that //! the transaction definitions don't depend on `tokio`, `mio`, etc and can be //! used without problems in wasm or other non-async contexts. //! -//! On the other hand, the `penumbra_app` crate depends on all of the component +//! On the other hand, the `penumbra_sdk_app` crate depends on all of the component //! crates with the `component` feature enabled, so it can assemble all of the //! `ActionHandler` implementations into a top-level `ActionHandler` //! implementation and call each component's `Component` implementation at the diff --git a/crates/core/app/src/action_handler/actions.rs b/crates/core/app/src/action_handler/actions.rs index 52b3465772..402932b12f 100644 --- a/crates/core/app/src/action_handler/actions.rs +++ b/crates/core/app/src/action_handler/actions.rs @@ -3,9 +3,9 @@ use std::sync::Arc; use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_shielded_pool::component::Ics20Transfer; -use penumbra_transaction::Action; -use penumbra_txhash::TransactionContext; +use penumbra_sdk_shielded_pool::component::Ics20Transfer; +use penumbra_sdk_transaction::Action; +use penumbra_sdk_txhash::TransactionContext; mod submit; diff --git a/crates/core/app/src/action_handler/actions/submit.rs b/crates/core/app/src/action_handler/actions/submit.rs index 3d39681999..1fce55ead0 100644 --- a/crates/core/app/src/action_handler/actions/submit.rs +++ b/crates/core/app/src/action_handler/actions/submit.rs @@ -8,22 +8,22 @@ use ibc_types::core::client::ClientId; use once_cell::sync::Lazy; use cnidarium::StateWrite; -use penumbra_asset::STAKING_TOKEN_DENOM; -use penumbra_community_pool::component::StateReadExt as _; -use penumbra_governance::{ +use penumbra_sdk_asset::STAKING_TOKEN_DENOM; +use penumbra_sdk_community_pool::component::StateReadExt as _; +use penumbra_sdk_governance::{ component::{StateReadExt as _, StateWriteExt as _}, event, proposal::{Proposal, ProposalPayload}, proposal_state::State as ProposalState, ProposalNft, ProposalSubmit, VotingReceiptToken, }; -use penumbra_ibc::component::ClientStateReadExt; -use penumbra_keys::keys::{FullViewingKey, NullifierKey}; -use penumbra_proto::{DomainType, StateWriteProto as _}; -use penumbra_sct::component::clock::EpochRead; -use penumbra_sct::component::tree::SctRead; -use penumbra_shielded_pool::component::AssetRegistry; -use penumbra_transaction::{AuthorizationData, Transaction, TransactionPlan, WitnessData}; +use penumbra_sdk_ibc::component::ClientStateReadExt; +use penumbra_sdk_keys::keys::{FullViewingKey, NullifierKey}; +use penumbra_sdk_proto::{DomainType, StateWriteProto as _}; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_sct::component::tree::SctRead; +use penumbra_sdk_shielded_pool::component::AssetRegistry; +use penumbra_sdk_transaction::{AuthorizationData, Transaction, TransactionPlan, WitnessData}; use crate::app::StateReadExt; use crate::community_pool_ext::CommunityPoolStateWriteExt; @@ -67,7 +67,7 @@ impl AppActionHandler for ProposalSubmit { ); } - use penumbra_governance::ProposalPayload::*; + use penumbra_sdk_governance::ProposalPayload::*; match payload { Signaling { commit: _ } => { /* all signaling proposals are valid */ } Emergency { halt_chain: _ } => { /* all emergency proposals are valid */ } @@ -75,7 +75,7 @@ impl AppActionHandler for ProposalSubmit { CommunityPoolSpend { transaction_plan } => { // Check to make sure that the transaction plan contains only valid actions for the // Community Pool (none of them should require proving to build): - use penumbra_transaction::plan::ActionPlan::*; + use penumbra_sdk_transaction::plan::ActionPlan::*; let parsed_transaction_plan = TransactionPlan::decode(&transaction_plan[..]) .context("transaction plan was malformed")?; @@ -310,8 +310,8 @@ impl AppActionHandler for ProposalSubmit { /// hashes of two arbitrary strings. static COMMUNITY_POOL_FULL_VIEWING_KEY: Lazy = Lazy::new(|| { // We start with two different personalization strings for the hash function: - let ak_personalization = b"Penumbra_CP_ak"; - let nk_personalization = b"Penumbra_CP_nk"; + let ak_personalization = b"penumbra_sdk_CP_ak"; + let nk_personalization = b"penumbra_sdk_CP_nk"; // We pick two different arbitrary strings to hash: let ak_hash_input = @@ -349,7 +349,7 @@ async fn build_community_pool_transaction( transaction_plan.build( &COMMUNITY_POOL_FULL_VIEWING_KEY, &WitnessData { - anchor: penumbra_tct::Tree::new().root(), + anchor: penumbra_sdk_tct::Tree::new().root(), state_commitment_proofs: Default::default(), }, &AuthorizationData { diff --git a/crates/core/app/src/action_handler/transaction.rs b/crates/core/app/src/action_handler/transaction.rs index 3806c86b12..0a4b6a6cb1 100644 --- a/crates/core/app/src/action_handler/transaction.rs +++ b/crates/core/app/src/action_handler/transaction.rs @@ -3,10 +3,10 @@ use std::sync::Arc; use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_fee::component::FeePay as _; -use penumbra_sct::{component::source::SourceContext, CommitmentSource}; -use penumbra_shielded_pool::component::ClueManager; -use penumbra_transaction::{gas::GasCost as _, Transaction}; +use penumbra_sdk_fee::component::FeePay as _; +use penumbra_sdk_sct::{component::source::SourceContext, CommitmentSource}; +use penumbra_sdk_shielded_pool::component::ClueManager; +use penumbra_sdk_transaction::{gas::GasCost as _, Transaction}; use tokio::task::JoinSet; use tracing::{instrument, Instrument}; @@ -150,12 +150,12 @@ mod tests { use std::ops::Deref; use anyhow::Result; - use penumbra_asset::{Value, STAKING_TOKEN_ASSET_ID}; - use penumbra_fee::Fee; - use penumbra_keys::test_keys; - use penumbra_shielded_pool::{Note, OutputPlan, SpendPlan}; - use penumbra_tct as tct; - use penumbra_transaction::{ + use penumbra_sdk_asset::{Value, STAKING_TOKEN_ASSET_ID}; + use penumbra_sdk_fee::Fee; + use penumbra_sdk_keys::test_keys; + use penumbra_sdk_shielded_pool::{Note, OutputPlan, SpendPlan}; + use penumbra_sdk_tct as tct; + use penumbra_sdk_transaction::{ plan::{CluePlan, DetectionDataPlan, TransactionPlan}, TransactionParameters, WitnessData, }; diff --git a/crates/core/app/src/action_handler/transaction/stateful.rs b/crates/core/app/src/action_handler/transaction/stateful.rs index 6aac2c9d50..27036bc619 100644 --- a/crates/core/app/src/action_handler/transaction/stateful.rs +++ b/crates/core/app/src/action_handler/transaction/stateful.rs @@ -1,10 +1,10 @@ use anyhow::{ensure, Result}; use cnidarium::StateRead; -use penumbra_sct::component::clock::EpochRead; -use penumbra_sct::component::tree::VerificationExt; -use penumbra_shielded_pool::component::StateReadExt as _; -use penumbra_shielded_pool::fmd; -use penumbra_transaction::{Transaction, TransactionParameters}; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_sct::component::tree::VerificationExt; +use penumbra_sdk_shielded_pool::component::StateReadExt as _; +use penumbra_sdk_shielded_pool::fmd; +use penumbra_sdk_transaction::{Transaction, TransactionParameters}; use crate::app::StateReadExt; diff --git a/crates/core/app/src/action_handler/transaction/stateless.rs b/crates/core/app/src/action_handler/transaction/stateless.rs index 6ba541753d..5ce6e3402c 100644 --- a/crates/core/app/src/action_handler/transaction/stateless.rs +++ b/crates/core/app/src/action_handler/transaction/stateless.rs @@ -1,6 +1,6 @@ use anyhow::{Context, Result}; -use penumbra_transaction::Transaction; -use penumbra_txhash::AuthorizingData; +use penumbra_sdk_transaction::Transaction; +use penumbra_sdk_txhash::AuthorizingData; #[tracing::instrument(skip(tx))] pub(super) fn valid_binding_signature(tx: &Transaction) -> Result<()> { diff --git a/crates/core/app/src/app/mod.rs b/crates/core/app/src/app/mod.rs index cec052d4ea..db113e46e2 100644 --- a/crates/core/app/src/app/mod.rs +++ b/crates/core/app/src/app/mod.rs @@ -8,30 +8,30 @@ use cnidarium::{ArcStateDeltaExt, Snapshot, StateDelta, StateRead, StateWrite, S use cnidarium_component::Component; use ibc_types::core::connection::ChainId; use jmt::RootHash; -use penumbra_auction::component::{Auction, StateReadExt as _, StateWriteExt as _}; -use penumbra_community_pool::component::{CommunityPool, StateWriteExt as _}; -use penumbra_community_pool::StateReadExt as _; -use penumbra_compact_block::component::CompactBlockManager; -use penumbra_dex::component::StateReadExt as _; -use penumbra_dex::component::{Dex, StateWriteExt as _}; -use penumbra_distributions::component::{Distributions, StateReadExt as _, StateWriteExt as _}; -use penumbra_fee::component::{FeeComponent, StateReadExt as _, StateWriteExt as _}; -use penumbra_funding::component::Funding; -use penumbra_funding::component::{StateReadExt as _, StateWriteExt as _}; -use penumbra_governance::component::{Governance, StateReadExt as _, StateWriteExt as _}; -use penumbra_ibc::component::{Ibc, StateWriteExt as _}; -use penumbra_ibc::StateReadExt as _; -use penumbra_proto::core::app::v1::TransactionsByHeightResponse; -use penumbra_proto::DomainType; -use penumbra_sct::component::clock::EpochRead; -use penumbra_sct::component::sct::Sct; -use penumbra_sct::component::{StateReadExt as _, StateWriteExt as _}; -use penumbra_sct::epoch::Epoch; -use penumbra_shielded_pool::component::{ShieldedPool, StateReadExt as _, StateWriteExt as _}; -use penumbra_stake::component::{ +use penumbra_sdk_auction::component::{Auction, StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_community_pool::component::{CommunityPool, StateWriteExt as _}; +use penumbra_sdk_community_pool::StateReadExt as _; +use penumbra_sdk_compact_block::component::CompactBlockManager; +use penumbra_sdk_dex::component::StateReadExt as _; +use penumbra_sdk_dex::component::{Dex, StateWriteExt as _}; +use penumbra_sdk_distributions::component::{Distributions, StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_fee::component::{FeeComponent, StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_funding::component::Funding; +use penumbra_sdk_funding::component::{StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_governance::component::{Governance, StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_ibc::component::{Ibc, StateWriteExt as _}; +use penumbra_sdk_ibc::StateReadExt as _; +use penumbra_sdk_proto::core::app::v1::TransactionsByHeightResponse; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_sct::component::sct::Sct; +use penumbra_sdk_sct::component::{StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_sct::epoch::Epoch; +use penumbra_sdk_shielded_pool::component::{ShieldedPool, StateReadExt as _, StateWriteExt as _}; +use penumbra_sdk_stake::component::{ stake::ConsensusUpdateRead, Staking, StateReadExt as _, StateWriteExt as _, }; -use penumbra_transaction::Transaction; +use penumbra_sdk_transaction::Transaction; use prost::Message as _; use tendermint::abci::{self, Event}; @@ -555,7 +555,7 @@ impl App { .expect("must be able to finish compact block"); // set the epoch for the next block - penumbra_sct::component::clock::EpochManager::put_epoch_by_height( + penumbra_sdk_sct::component::clock::EpochManager::put_epoch_by_height( &mut state_tx, current_height + 1, Epoch { @@ -567,7 +567,7 @@ impl App { self.apply(state_tx) } else { // set the epoch for the next block - penumbra_sct::component::clock::EpochManager::put_epoch_by_height( + penumbra_sdk_sct::component::clock::EpochManager::put_epoch_by_height( &mut state_tx, current_height + 1, current_epoch, @@ -685,7 +685,7 @@ pub trait StateReadExt: StateRead { /// Returns the set of app parameters async fn get_app_params(&self) -> Result { let chain_id = self.get_chain_id().await?; - let community_pool_params: penumbra_community_pool::params::CommunityPoolParameters = + let community_pool_params: penumbra_sdk_community_pool::params::CommunityPoolParameters = self.get_community_pool_params().await?; let distributions_params = self.get_distributions_params().await?; let ibc_params = self.get_ibc_params().await?; @@ -738,13 +738,13 @@ pub trait StateReadExt: StateRead { impl< T: StateRead - + penumbra_stake::StateReadExt - + penumbra_governance::component::StateReadExt - + penumbra_fee::component::StateReadExt - + penumbra_community_pool::component::StateReadExt - + penumbra_sct::component::clock::EpochRead - + penumbra_ibc::component::StateReadExt - + penumbra_distributions::component::StateReadExt + + penumbra_sdk_stake::StateReadExt + + penumbra_sdk_governance::component::StateReadExt + + penumbra_sdk_fee::component::StateReadExt + + penumbra_sdk_community_pool::component::StateReadExt + + penumbra_sdk_sct::component::clock::EpochRead + + penumbra_sdk_ibc::component::StateReadExt + + penumbra_sdk_distributions::component::StateReadExt + ?Sized, > StateReadExt for T { @@ -764,7 +764,7 @@ pub trait StateWriteExt: StateWrite { async fn put_block_transaction( &mut self, height: u64, - transaction: penumbra_proto::core::transaction::v1::Transaction, + transaction: penumbra_sdk_proto::core::transaction::v1::Transaction, ) -> Result<()> { // Extend the existing transactions with the new one. let mut transactions_response = self.transactions_by_height(height).await?; diff --git a/crates/core/app/src/app_version/component.rs b/crates/core/app/src/app_version/component.rs index 891ee61882..84328fff1a 100644 --- a/crates/core/app/src/app_version/component.rs +++ b/crates/core/app/src/app_version/component.rs @@ -2,7 +2,7 @@ use std::fmt::Write as _; use anyhow::{anyhow, Context}; use cnidarium::{StateDelta, Storage}; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use super::APP_VERSION; diff --git a/crates/core/app/src/community_pool_ext.rs b/crates/core/app/src/community_pool_ext.rs index 080f3b27f3..4894b6edcd 100644 --- a/crates/core/app/src/community_pool_ext.rs +++ b/crates/core/app/src/community_pool_ext.rs @@ -3,17 +3,17 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::{StreamExt, TryStreamExt}; -use penumbra_governance::state_key; -use penumbra_proto::{StateReadProto, StateWriteProto}; -use penumbra_sct::component::clock::EpochRead; -use penumbra_transaction::Transaction; +use penumbra_sdk_governance::state_key; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_transaction::Transaction; // Note: These should live in `penumbra-governance` in the `StateReadExt` and `StateWriteExt` // traits, however that would result in a circular dependency since the below methods // require use of `penumbra-transaction::Transaction`, which has `penumbra-governance` as a // dependency. #[async_trait] -pub trait CommunityPoolStateReadExt: StateRead + penumbra_stake::StateReadExt { +pub trait CommunityPoolStateReadExt: StateRead + penumbra_sdk_stake::StateReadExt { /// Get all the transactions set to be delivered in this block (scheduled in last block). async fn pending_community_pool_transactions(&self) -> Result> { // Get the proposal IDs of the Community Pool transactions we are about to deliver. @@ -41,7 +41,7 @@ pub trait CommunityPoolStateReadExt: StateRead + penumbra_stake::StateReadExt { } } -impl CommunityPoolStateReadExt for T {} +impl CommunityPoolStateReadExt for T {} #[async_trait] pub trait CommunityPoolStateWriteExt: StateWrite { diff --git a/crates/core/app/src/genesis.rs b/crates/core/app/src/genesis.rs index becf38cb84..2a7bcf3403 100644 --- a/crates/core/app/src/genesis.rs +++ b/crates/core/app/src/genesis.rs @@ -1,15 +1,15 @@ -use penumbra_auction::genesis::Content as AuctionContent; -use penumbra_community_pool::genesis::Content as CommunityPoolContent; -use penumbra_dex::genesis::Content as DexContent; -use penumbra_distributions::genesis::Content as DistributionsContent; -use penumbra_fee::genesis::Content as FeeContent; -use penumbra_funding::genesis::Content as FundingContent; -use penumbra_governance::genesis::Content as GovernanceContent; -use penumbra_ibc::genesis::Content as IBCContent; -use penumbra_proto::{penumbra::core::app::v1 as pb, DomainType}; -use penumbra_sct::genesis::Content as SctContent; -use penumbra_shielded_pool::genesis::Content as ShieldedPoolContent; -use penumbra_stake::genesis::Content as StakeContent; +use penumbra_sdk_auction::genesis::Content as AuctionContent; +use penumbra_sdk_community_pool::genesis::Content as CommunityPoolContent; +use penumbra_sdk_dex::genesis::Content as DexContent; +use penumbra_sdk_distributions::genesis::Content as DistributionsContent; +use penumbra_sdk_fee::genesis::Content as FeeContent; +use penumbra_sdk_funding::genesis::Content as FundingContent; +use penumbra_sdk_governance::genesis::Content as GovernanceContent; +use penumbra_sdk_ibc::genesis::Content as IBCContent; +use penumbra_sdk_proto::{penumbra::core::app::v1 as pb, DomainType}; +use penumbra_sdk_sct::genesis::Content as SctContent; +use penumbra_sdk_shielded_pool::genesis::Content as ShieldedPoolContent; +use penumbra_sdk_stake::genesis::Content as StakeContent; use serde::{Deserialize, Serialize}; /// The application state at genesis. @@ -188,8 +188,8 @@ impl Content { pub fn with_epoch_duration(self, epoch_duration: u64) -> Self { Self { - sct_content: penumbra_sct::genesis::Content { - sct_params: penumbra_sct::params::SctParameters { epoch_duration }, + sct_content: penumbra_sdk_sct::genesis::Content { + sct_params: penumbra_sdk_sct::params::SctParameters { epoch_duration }, }, ..self } @@ -197,8 +197,8 @@ impl Content { pub fn with_unbonding_delay(self, unbonding_delay: u64) -> Self { Self { - stake_content: penumbra_stake::genesis::Content { - stake_params: penumbra_stake::params::StakeParameters { + stake_content: penumbra_sdk_stake::genesis::Content { + stake_params: penumbra_sdk_stake::params::StakeParameters { unbonding_delay, ..self.stake_content.stake_params }, diff --git a/crates/core/app/src/lib.rs b/crates/core/app/src/lib.rs index 46fc1f1d84..d2bbc61839 100644 --- a/crates/core/app/src/lib.rs +++ b/crates/core/app/src/lib.rs @@ -5,7 +5,7 @@ use once_cell::sync::Lazy; pub static SUBSTORE_PREFIXES: Lazy> = Lazy::new(|| { vec![ - penumbra_ibc::IBC_SUBSTORE_PREFIX.to_string(), + penumbra_sdk_ibc::IBC_SUBSTORE_PREFIX.to_string(), COMETBFT_SUBSTORE_PREFIX.to_string(), ] }); diff --git a/crates/core/app/src/metrics.rs b/crates/core/app/src/metrics.rs index cd7b74d563..a3d10728b6 100644 --- a/crates/core/app/src/metrics.rs +++ b/crates/core/app/src/metrics.rs @@ -16,13 +16,13 @@ pub use metrics::*; /// Registers all metrics used by this crate. pub fn register_metrics() { cnidarium::register_metrics(); - penumbra_stake::component::register_metrics(); - penumbra_funding::component::register_metrics(); - penumbra_dex::component::register_metrics(); + penumbra_sdk_stake::component::register_metrics(); + penumbra_sdk_funding::component::register_metrics(); + penumbra_sdk_dex::component::register_metrics(); // TODO: this should be under component:: - penumbra_governance::register_metrics(); - penumbra_ibc::component::register_metrics(); - penumbra_shielded_pool::component::register_metrics(); + penumbra_sdk_governance::register_metrics(); + penumbra_sdk_ibc::component::register_metrics(); + penumbra_sdk_shielded_pool::component::register_metrics(); describe_counter!( MEMPOOL_CHECKTX_TOTAL, @@ -31,4 +31,4 @@ pub fn register_metrics() { ); } -pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; +pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; diff --git a/crates/core/app/src/params.rs b/crates/core/app/src/params.rs index 691999fb42..dd0d105f42 100644 --- a/crates/core/app/src/params.rs +++ b/crates/core/app/src/params.rs @@ -1,17 +1,17 @@ -use penumbra_auction::params::AuctionParameters; -use penumbra_community_pool::params::CommunityPoolParameters; -use penumbra_dex::DexParameters; -use penumbra_distributions::DistributionsParameters; -use penumbra_fee::FeeParameters; -use penumbra_funding::FundingParameters; -use penumbra_governance::params::GovernanceParameters; -use penumbra_ibc::params::IBCParameters; -use penumbra_proto::core::app::v1 as pb; -use penumbra_proto::view::v1 as pb_view; -use penumbra_proto::DomainType; -use penumbra_sct::params::SctParameters; -use penumbra_shielded_pool::params::ShieldedPoolParameters; -use penumbra_stake::params::StakeParameters; +use penumbra_sdk_auction::params::AuctionParameters; +use penumbra_sdk_community_pool::params::CommunityPoolParameters; +use penumbra_sdk_dex::DexParameters; +use penumbra_sdk_distributions::DistributionsParameters; +use penumbra_sdk_fee::FeeParameters; +use penumbra_sdk_funding::FundingParameters; +use penumbra_sdk_governance::params::GovernanceParameters; +use penumbra_sdk_ibc::params::IBCParameters; +use penumbra_sdk_proto::core::app::v1 as pb; +use penumbra_sdk_proto::view::v1 as pb_view; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_sct::params::SctParameters; +use penumbra_sdk_shielded_pool::params::ShieldedPoolParameters; +use penumbra_sdk_stake::params::StakeParameters; use serde::{Deserialize, Serialize}; pub mod change; diff --git a/crates/core/app/src/params/change.rs b/crates/core/app/src/params/change.rs index a537efd735..6a88269091 100644 --- a/crates/core/app/src/params/change.rs +++ b/crates/core/app/src/params/change.rs @@ -2,18 +2,18 @@ use std::fmt::Display; use anyhow::Context; use anyhow::Result; -use penumbra_auction::params::AuctionParameters; -use penumbra_community_pool::params::CommunityPoolParameters; -use penumbra_dex::DexParameters; -use penumbra_distributions::params::DistributionsParameters; -use penumbra_fee::FeeParameters; -use penumbra_funding::params::FundingParameters; -use penumbra_governance::change::ParameterChange; -use penumbra_governance::{params::GovernanceParameters, tally::Ratio}; -use penumbra_ibc::params::IBCParameters; -use penumbra_sct::params::SctParameters; -use penumbra_shielded_pool::params::ShieldedPoolParameters; -use penumbra_stake::params::StakeParameters; +use penumbra_sdk_auction::params::AuctionParameters; +use penumbra_sdk_community_pool::params::CommunityPoolParameters; +use penumbra_sdk_dex::DexParameters; +use penumbra_sdk_distributions::params::DistributionsParameters; +use penumbra_sdk_fee::FeeParameters; +use penumbra_sdk_funding::params::FundingParameters; +use penumbra_sdk_governance::change::ParameterChange; +use penumbra_sdk_governance::{params::GovernanceParameters, tally::Ratio}; +use penumbra_sdk_ibc::params::IBCParameters; +use penumbra_sdk_sct::params::SctParameters; +use penumbra_sdk_shielded_pool::params::ShieldedPoolParameters; +use penumbra_sdk_stake::params::StakeParameters; use super::AppParameters; diff --git a/crates/core/app/src/penumbra_host_chain.rs b/crates/core/app/src/penumbra_host_chain.rs index 0336762576..ae20c5a783 100644 --- a/crates/core/app/src/penumbra_host_chain.rs +++ b/crates/core/app/src/penumbra_host_chain.rs @@ -1,10 +1,10 @@ use async_trait::async_trait; -use penumbra_ibc::component::HostInterface; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_ibc::component::HostInterface; +use penumbra_sdk_sct::component::clock::EpochRead; use crate::app::StateReadExt; -/// The implementation of [`penumbra_ibc::component::HostInterface`] for Penumbra. +/// The implementation of [`penumbra_sdk_ibc::component::HostInterface`] for Penumbra. /// It encapsulates all of the chain-specific data that the ibc implementation needs. #[derive(Clone)] pub struct PenumbraHost {} diff --git a/crates/core/app/src/rpc.rs b/crates/core/app/src/rpc.rs index ee90110f4c..fd69cb5933 100644 --- a/crates/core/app/src/rpc.rs +++ b/crates/core/app/src/rpc.rs @@ -25,12 +25,12 @@ use { }, }, }, - penumbra_auction::component::rpc::Server as AuctionServer, - penumbra_compact_block::component::rpc::Server as CompactBlockServer, - penumbra_dex::component::rpc::Server as DexServer, - penumbra_fee::component::rpc::Server as FeeServer, - penumbra_governance::component::rpc::Server as GovernanceServer, - penumbra_proto::{ + penumbra_sdk_auction::component::rpc::Server as AuctionServer, + penumbra_sdk_compact_block::component::rpc::Server as CompactBlockServer, + penumbra_sdk_dex::component::rpc::Server as DexServer, + penumbra_sdk_fee::component::rpc::Server as FeeServer, + penumbra_sdk_governance::component::rpc::Server as GovernanceServer, + penumbra_sdk_proto::{ core::{ app::v1::query_service_server::QueryServiceServer as AppQueryServiceServer, component::{ @@ -51,9 +51,9 @@ use { TendermintProxyService, TendermintProxyServiceServer, }, }, - penumbra_sct::component::rpc::Server as SctServer, - penumbra_shielded_pool::component::rpc::Server as ShieldedPoolServer, - penumbra_stake::component::rpc::Server as StakeServer, + penumbra_sdk_sct::component::rpc::Server as SctServer, + penumbra_sdk_shielded_pool::component::rpc::Server as ShieldedPoolServer, + penumbra_sdk_stake::component::rpc::Server as StakeServer, tonic::service::Routes, tonic_web::enable as we, }; @@ -63,7 +63,7 @@ pub fn routes( tm_proxy: impl TendermintProxyService, _enable_expensive_rpc: bool, ) -> anyhow::Result { - let ibc = penumbra_ibc::component::rpc::IbcQuery::::new(storage.clone()); + let ibc = penumbra_sdk_ibc::component::rpc::IbcQuery::::new(storage.clone()); let mut builder = Routes::builder(); builder @@ -119,7 +119,7 @@ pub fn routes( storage.clone(), )))) .add_service(we(tonic_reflection::server::Builder::configure() - .register_encoded_file_descriptor_set(penumbra_proto::FILE_DESCRIPTOR_SET) + .register_encoded_file_descriptor_set(penumbra_sdk_proto::FILE_DESCRIPTOR_SET) .build_v1() .with_context(|| "could not configure grpc reflection service")?)); Ok(builder.routes().prepare()) diff --git a/crates/core/app/src/rpc/query.rs b/crates/core/app/src/rpc/query.rs index ef5ff4ffeb..8b2a789d55 100644 --- a/crates/core/app/src/rpc/query.rs +++ b/crates/core/app/src/rpc/query.rs @@ -1,7 +1,7 @@ use { crate::app::StateReadExt as _, cnidarium::Storage, - penumbra_proto::core::app::v1::{ + penumbra_sdk_proto::core::app::v1::{ query_service_server::QueryService, AppParametersRequest, AppParametersResponse, TransactionsByHeightRequest, TransactionsByHeightResponse, }, diff --git a/crates/core/app/src/server.rs b/crates/core/app/src/server.rs index 6753e670c0..f8cccf391c 100644 --- a/crates/core/app/src/server.rs +++ b/crates/core/app/src/server.rs @@ -6,7 +6,7 @@ use { snapshot::Snapshot, }, cnidarium::Storage, - penumbra_tower_trace::trace::request_span, + penumbra_sdk_tower_trace::trace::request_span, tendermint::v0_37::abci::{ ConsensusRequest, ConsensusResponse, MempoolRequest, MempoolResponse, }, @@ -46,14 +46,14 @@ pub fn new( > { let consensus = tower::ServiceBuilder::new() .layer(request_span::layer(|req: &ConsensusRequest| { - use penumbra_tower_trace::v037::RequestExt; + use penumbra_sdk_tower_trace::v037::RequestExt; req.create_span() })) .layer(EventIndexLayer::index_all()) .service(Consensus::new(storage.clone())); let mempool = tower::ServiceBuilder::new() .layer(request_span::layer(|req: &MempoolRequest| { - use penumbra_tower_trace::v037::RequestExt; + use penumbra_sdk_tower_trace::v037::RequestExt; req.create_span() })) .service(tower_actor::Actor::new(10, |queue: _| { diff --git a/crates/core/app/src/server/info.rs b/crates/core/app/src/server/info.rs index 63c3c7ae88..75b3047fd4 100644 --- a/crates/core/app/src/server/info.rs +++ b/crates/core/app/src/server/info.rs @@ -28,10 +28,10 @@ use ibc_types::core::channel::{ChannelId, PortId}; use ibc_types::core::client::ClientId; use ibc_types::core::connection::ConnectionId; use ibc_types::core::connection::IdentifiedConnectionEnd; -use penumbra_ibc::component::ChannelStateReadExt as _; -use penumbra_ibc::component::ClientStateReadExt as _; -use penumbra_ibc::component::ConnectionStateReadExt as _; -use penumbra_ibc::component::HostInterface; +use penumbra_sdk_ibc::component::ChannelStateReadExt as _; +use penumbra_sdk_ibc::component::ClientStateReadExt as _; +use penumbra_sdk_ibc::component::ConnectionStateReadExt as _; +use penumbra_sdk_ibc::component::HostInterface; use prost::Message; use std::str::FromStr; use tendermint::v0_37::abci::{ @@ -42,7 +42,7 @@ use tendermint::v0_37::abci::{ use tower_abci::BoxError; use tracing::Instrument; -use penumbra_tower_trace::v037::RequestExt; +use penumbra_sdk_tower_trace::v037::RequestExt; const ABCI_INFO_VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/crates/core/app/tests/app_blocktimes_increment.rs b/crates/core/app/tests/app_blocktimes_increment.rs index 6125e70064..268926d95e 100644 --- a/crates/core/app/tests/app_blocktimes_increment.rs +++ b/crates/core/app/tests/app_blocktimes_increment.rs @@ -1,11 +1,11 @@ use { self::common::BuilderExt, cnidarium::TempStorage, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_mock_consensus::TestNode, + penumbra_sdk_mock_consensus::TestNode, std::time::Duration, tap::{Tap, TapFallible}, }; @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .with_initial_timestamp(start_time) .init_chain(consensus) .await @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_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()) diff --git a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs index 0027ee1408..efad2e947c 100644 --- a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs +++ b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs @@ -4,15 +4,15 @@ use { cnidarium::TempStorage, common::TempStorageExt as _, decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::DomainType, - penumbra_stake::{ + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::DomainType, + penumbra_sdk_stake::{ component::validator_handler::ValidatorDataRead as _, validator::Validator, FundingStreams, GovernanceKey, IdentityKey, }, @@ -24,7 +24,7 @@ use { mod common; -/// The length of the [`penumbra_sct`] epoch. +/// The length of the [`penumbra_sdk_sct`] epoch. /// /// This test relies on many epochs turning over, so we will work with a shorter epoch duration. const EPOCH_DURATION: u64 = 8; @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Configure an AppState with slightly shorter epochs than usual. let app_state = AppState::Content( @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; @@ -73,7 +73,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Check that we are now in a new epoch. { - use penumbra_sct::{component::clock::EpochRead, epoch::Epoch}; + use penumbra_sdk_sct::{component::clock::EpochRead, epoch::Epoch}; let Epoch { index: start, .. } = snapshot_start.get_current_epoch().await?; let Epoch { index: end, .. } = snapshot_end.get_current_epoch().await?; assert_eq!(start, 0, "we should start in the first epoch"); @@ -82,7 +82,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the existing validator is and was active. { - use penumbra_stake::{component::validator_handler::ValidatorDataRead, validator::State}; + use penumbra_sdk_stake::{component::validator_handler::ValidatorDataRead, validator::State}; let start = snapshot_start .get_validator_state(&existing_validator_id) .await?; @@ -95,7 +95,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the validator was, and still is, in the consensus set. { - use penumbra_stake::component::ConsensusIndexRead; + use penumbra_sdk_stake::component::ConsensusIndexRead; let start = snapshot_start.get_consensus_set().await?; let end = snapshot_end.get_consensus_set().await?; let expected = [existing_validator_id]; @@ -138,8 +138,8 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Make a transaction that defines a new validator. let plan = { use { - penumbra_stake::validator, - penumbra_transaction::{ActionPlan, TransactionParameters, TransactionPlan}, + penumbra_sdk_stake::validator, + penumbra_sdk_transaction::{ActionPlan, TransactionParameters, TransactionPlan}, rand_core::OsRng, }; let bytes = new_validator.encode_to_vec(); @@ -174,7 +174,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the set of validators looks correct. { - use penumbra_stake::{component::ConsensusIndexRead, validator::State}; + use penumbra_sdk_stake::{component::ConsensusIndexRead, validator::State}; let snapshot = post_tx_snapshot.clone(); info!("checking consensus set in block after validator definition"); // The original validator should still be active. @@ -201,7 +201,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the validators have different rates. The second validator was created later, and // should thus have a different rate than a validator that has existed since genesis. { - use penumbra_stake::component::validator_handler::validator_store::ValidatorDataRead; + use penumbra_sdk_stake::component::validator_handler::validator_store::ValidatorDataRead; let snapshot = post_tx_snapshot; let existing = snapshot .get_validator_rate(&existing_validator_id) @@ -220,10 +220,10 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Now, create a transaction that delegates to the new validator. let plan = { use { - penumbra_asset::STAKING_TOKEN_ASSET_ID, - penumbra_sct::component::clock::EpochRead, - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_transaction::{ + penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID, + penumbra_sdk_sct::component::clock::EpochRead, + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, }; @@ -285,7 +285,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the set of validators still looks correct. We should not see any changes yet. { - use penumbra_stake::{component::ConsensusIndexRead, validator::State}; + use penumbra_sdk_stake::{component::ConsensusIndexRead, validator::State}; let snapshot = post_delegate_snapshot.clone(); info!("checking consensus set in block after delegation"); // The original validator should still be active. @@ -311,7 +311,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Confirm that the new validator's voting power has not changed immeditaly. let new_validator_original_power = { - use penumbra_sct::component::clock::EpochRead; + use penumbra_sdk_sct::component::clock::EpochRead; let pre_delegate_power = pre_delegate_snapshot .get_validator_power(&new_validator_id) .await? @@ -339,7 +339,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that now, after an epoch and with a delegation, the validator is marked active. { - use penumbra_stake::{component::ConsensusIndexRead, validator::State}; + use penumbra_sdk_stake::{component::ConsensusIndexRead, validator::State}; info!("checking consensus set in epoch after delegation"); let snapshot = post_delegate_next_epoch_snapshot.clone(); // The original validator should still be active. @@ -378,10 +378,10 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Build a transaction that will now undelegate from the validator. let plan = { use { - penumbra_sct::component::clock::EpochRead, - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_stake::DelegationToken, - penumbra_transaction::{ + penumbra_sdk_sct::component::clock::EpochRead, + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_stake::DelegationToken, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, }; @@ -444,7 +444,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the consensus set has not changed yet. { - use penumbra_stake::{component::ConsensusIndexRead, validator::State}; + use penumbra_sdk_stake::{component::ConsensusIndexRead, validator::State}; let snapshot = post_undelegate_snapshot.clone(); info!("checking consensus set in block after undelegation"); // The original validator should still be active. @@ -485,7 +485,7 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that after undelegating, the validator is no longer marked active. { - use penumbra_stake::{component::ConsensusIndexRead, validator::State}; + use penumbra_sdk_stake::{component::ConsensusIndexRead, validator::State}; info!("checking consensus set in epoch after undelegation"); let snapshot = post_undelegate_next_epoch_snapshot.clone(); // The original validator should still be active. diff --git a/crates/core/app/tests/app_can_deposit_into_community_pool.rs b/crates/core/app/tests/app_can_deposit_into_community_pool.rs index 895e61014e..a3df8ec73a 100644 --- a/crates/core/app/tests/app_can_deposit_into_community_pool.rs +++ b/crates/core/app/tests/app_can_deposit_into_community_pool.rs @@ -3,19 +3,19 @@ use { anyhow::anyhow, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_asset::asset, - penumbra_community_pool::{CommunityPoolDeposit, StateReadExt}, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_num::Amount, - penumbra_proto::DomainType, - penumbra_shielded_pool::SpendPlan, - penumbra_transaction::{TransactionParameters, TransactionPlan}, + penumbra_sdk_asset::asset, + penumbra_sdk_community_pool::{CommunityPoolDeposit, StateReadExt}, + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_num::Amount, + penumbra_sdk_proto::DomainType, + penumbra_sdk_shielded_pool::SpendPlan, + penumbra_sdk_transaction::{TransactionParameters, TransactionPlan}, rand_core::OsRng, std::collections::BTreeMap, tap::{Tap, TapFallible}, @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Define our application state, and start the test node. let mut test_node = { @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await .tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))? diff --git a/crates/core/app/tests/app_can_disable_community_pool_spends.rs b/crates/core/app/tests/app_can_disable_community_pool_spends.rs index 0854e3633f..75b8a4ccbc 100644 --- a/crates/core/app/tests/app_can_disable_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_disable_community_pool_spends.rs @@ -4,34 +4,34 @@ use { cnidarium::TempStorage, common::TempStorageExt as _, decaf377_rdsa::VerificationKey, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{AppState, Content}, server::consensus::Consensus, CommunityPoolStateReadExt as _, }, - penumbra_asset::STAKING_TOKEN_ASSET_ID, - penumbra_community_pool::{ + penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID, + penumbra_sdk_community_pool::{ CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend, StateReadExt as _, }, - penumbra_governance::{ + penumbra_sdk_governance::{ Proposal, ProposalSubmit, StateReadExt as _, ValidatorVote, ValidatorVoteBody, ValidatorVoteReason, }, - penumbra_keys::{ + penumbra_sdk_keys::{ keys::{SpendKey, SpendKeyBytes}, test_keys, }, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_num::Amount, - penumbra_proto::{ + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_num::Amount, + penumbra_sdk_proto::{ core::keys::v1::{GovernanceKey, IdentityKey}, penumbra::core::component::stake::v1::Validator as PenumbraValidator, DomainType, }, - penumbra_shielded_pool::{genesis::Allocation, OutputPlan, SpendPlan}, - penumbra_stake::DelegationToken, - penumbra_transaction::{ + penumbra_sdk_shielded_pool::{genesis::Allocation, OutputPlan, SpendPlan}, + penumbra_sdk_stake::DelegationToken, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, ActionPlan, TransactionParameters, TransactionPlan, }, rand::Rng, @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Define a helper to get the current community pool balance. let pool_balance = || async { storage.latest_snapshot().community_pool_balance().await }; @@ -99,7 +99,7 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { .incoming() .payment_address(0u32.into()); - let ik = penumbra_stake::IdentityKey(identity_vk.into()); + let ik = penumbra_sdk_stake::IdentityKey(identity_vk.into()); let delegation_denom = DelegationToken::from(ik).denom(); let allocation = Allocation { @@ -115,15 +115,15 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { let mut test_node = { let mut content = Content { chain_id: TestNode::<()>::CHAIN_ID.to_string(), - governance_content: penumbra_governance::genesis::Content { - governance_params: penumbra_governance::params::GovernanceParameters { + governance_content: penumbra_sdk_governance::genesis::Content { + governance_params: penumbra_sdk_governance::params::GovernanceParameters { proposal_deposit_amount: 0_u32.into(), proposal_voting_blocks: PROPOSAL_VOTING_BLOCKS, ..Default::default() }, }, - community_pool_content: penumbra_community_pool::genesis::Content { - community_pool_params: penumbra_community_pool::params::CommunityPoolParameters { + community_pool_content: penumbra_sdk_community_pool::genesis::Content { + community_pool_params: penumbra_sdk_community_pool::params::CommunityPoolParameters { // Disable community spend proposals. community_pool_spend_proposals_enabled: false, }, @@ -225,7 +225,7 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { id: 0_u64, title: "return test deposit".to_owned(), description: "a proposal to return the community pool deposit".to_owned(), - payload: penumbra_governance::ProposalPayload::CommunityPoolSpend { + payload: penumbra_sdk_governance::ProposalPayload::CommunityPoolSpend { transaction_plan: proposed_tx_plan.encode_to_vec(), // transaction_plan: TransactionPlan::default().encode_to_vec(), }, @@ -275,9 +275,9 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { let plan = { let body = ValidatorVoteBody { proposal: 0_u64, - vote: penumbra_governance::Vote::Yes, - identity_key: penumbra_stake::IdentityKey(identity_vk.to_bytes().into()), - governance_key: penumbra_stake::GovernanceKey(governance_vk), + vote: penumbra_sdk_governance::Vote::Yes, + identity_key: penumbra_sdk_stake::IdentityKey(identity_vk.to_bytes().into()), + governance_key: penumbra_sdk_stake::GovernanceKey(governance_vk), reason: ValidatorVoteReason("test reason".to_owned()), }; let auth_sig = governance_sk.sign(OsRng, body.encode_to_vec().as_slice()); diff --git a/crates/core/app/tests/app_can_propose_community_pool_spends.rs b/crates/core/app/tests/app_can_propose_community_pool_spends.rs index d8af8d1b07..2bbaa0d41c 100644 --- a/crates/core/app/tests/app_can_propose_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_propose_community_pool_spends.rs @@ -4,34 +4,34 @@ use { cnidarium::TempStorage, common::TempStorageExt as _, decaf377_rdsa::VerificationKey, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{AppState, Content}, server::consensus::Consensus, CommunityPoolStateReadExt as _, }, - penumbra_asset::STAKING_TOKEN_ASSET_ID, - penumbra_community_pool::{ + penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID, + penumbra_sdk_community_pool::{ CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend, StateReadExt as _, }, - penumbra_governance::{ + penumbra_sdk_governance::{ Proposal, ProposalSubmit, StateReadExt as _, ValidatorVote, ValidatorVoteBody, ValidatorVoteReason, }, - penumbra_keys::{ + penumbra_sdk_keys::{ keys::{SpendKey, SpendKeyBytes}, test_keys, }, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_num::Amount, - penumbra_proto::{ + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_num::Amount, + penumbra_sdk_proto::{ core::keys::v1::{GovernanceKey, IdentityKey}, penumbra::core::component::stake::v1::Validator as PenumbraValidator, DomainType, }, - penumbra_shielded_pool::{genesis::Allocation, OutputPlan, SpendPlan}, - penumbra_stake::DelegationToken, - penumbra_transaction::{ + penumbra_sdk_shielded_pool::{genesis::Allocation, OutputPlan, SpendPlan}, + penumbra_sdk_stake::DelegationToken, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, ActionPlan, TransactionParameters, TransactionPlan, }, rand::Rng, @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Define a helper to get the current community pool balance. let pool_balance = || async { storage.latest_snapshot().community_pool_balance().await }; @@ -99,7 +99,7 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { .incoming() .payment_address(0u32.into()); - let ik = penumbra_stake::IdentityKey(identity_vk.into()); + let ik = penumbra_sdk_stake::IdentityKey(identity_vk.into()); let delegation_denom = DelegationToken::from(ik).denom(); let allocation = Allocation { @@ -115,8 +115,8 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { let mut test_node = { let mut content = Content { chain_id: TestNode::<()>::CHAIN_ID.to_string(), - governance_content: penumbra_governance::genesis::Content { - governance_params: penumbra_governance::params::GovernanceParameters { + governance_content: penumbra_sdk_governance::genesis::Content { + governance_params: penumbra_sdk_governance::params::GovernanceParameters { proposal_deposit_amount: 0_u32.into(), proposal_voting_blocks: PROPOSAL_VOTING_BLOCKS, ..Default::default() @@ -218,7 +218,7 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { id: 0_u64, title: "return test deposit".to_owned(), description: "a proposal to return the community pool deposit".to_owned(), - payload: penumbra_governance::ProposalPayload::CommunityPoolSpend { + payload: penumbra_sdk_governance::ProposalPayload::CommunityPoolSpend { transaction_plan: proposed_tx_plan.encode_to_vec(), // transaction_plan: TransactionPlan::default().encode_to_vec(), }, @@ -268,9 +268,9 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { let mut plan = { let body = ValidatorVoteBody { proposal: 0_u64, - vote: penumbra_governance::Vote::Yes, - identity_key: penumbra_stake::IdentityKey(identity_vk.to_bytes().into()), - governance_key: penumbra_stake::GovernanceKey(governance_vk), + vote: penumbra_sdk_governance::Vote::Yes, + identity_key: penumbra_sdk_stake::IdentityKey(identity_vk.to_bytes().into()), + governance_key: penumbra_sdk_stake::GovernanceKey(governance_vk), reason: ValidatorVoteReason("test reason".to_owned()), }; let auth_sig = governance_sk.sign(OsRng, body.encode_to_vec().as_slice()); @@ -338,7 +338,7 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { ); assert_eq!( post_proposal_state, - Some(penumbra_governance::proposal_state::State::Voting), + Some(penumbra_sdk_governance::proposal_state::State::Voting), "a new proposal should be in the voting phase" ); assert_eq!( @@ -354,7 +354,7 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { ); assert_eq!( post_vote_state, - Some(penumbra_governance::proposal_state::State::Voting), + Some(penumbra_sdk_governance::proposal_state::State::Voting), "a proposal should remain in the voting phase" ); assert_eq!( @@ -373,8 +373,8 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> { ); assert_eq!( post_voting_period_state, - Some(penumbra_governance::proposal_state::State::Finished { - outcome: penumbra_governance::proposal_state::Outcome::Passed, + Some(penumbra_sdk_governance::proposal_state::State::Finished { + outcome: penumbra_sdk_governance::proposal_state::Outcome::Passed, }), "a proposal should be finished after the voting period completes" ); diff --git a/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs b/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs index 49d7b93018..c7490c2e9c 100644 --- a/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs +++ b/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs @@ -3,17 +3,17 @@ use { anyhow::anyhow, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::DomainType, - penumbra_sct::component::tree::SctRead as _, - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_transaction::{ + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::DomainType, + penumbra_sdk_sct::component::tree::SctRead as _, + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, rand_core::OsRng, @@ -28,7 +28,7 @@ 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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; let mut test_node = { let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), @@ -36,7 +36,7 @@ async fn app_can_spend_notes_and_detect_outputs() -> anyhow::Result<()> { let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await .tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))? diff --git a/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs b/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs index 1a2ae423cb..272ce6bd63 100644 --- a/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs +++ b/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs @@ -2,24 +2,24 @@ use { anyhow::Context, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{AppState, Content}, server::consensus::Consensus, }, - penumbra_asset::{STAKING_TOKEN_ASSET_ID, STAKING_TOKEN_DENOM}, - penumbra_keys::{keys::AddressIndex, test_keys}, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::{ + penumbra_sdk_asset::{STAKING_TOKEN_ASSET_ID, STAKING_TOKEN_DENOM}, + penumbra_sdk_keys::{keys::AddressIndex, test_keys}, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::{ view::v1::{ view_service_client::ViewServiceClient, view_service_server::ViewServiceServer, StatusRequest, StatusResponse, }, DomainType, }, - penumbra_shielded_pool::genesis::Allocation, - penumbra_view::ViewClient, - penumbra_wallet::plan::SWEEP_COUNT, + penumbra_sdk_shielded_pool::genesis::Allocation, + penumbra_sdk_view::ViewClient, + penumbra_sdk_wallet::plan::SWEEP_COUNT, rand_core::OsRng, std::ops::Deref, tap::{Tap, TapFallible}, @@ -38,10 +38,10 @@ 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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Instantiate a mock tendermint proxy, which we will connect to the test node. - let proxy = penumbra_mock_tendermint_proxy::TestNodeProxy::new::(); + let proxy = penumbra_sdk_mock_tendermint_proxy::TestNodeProxy::new::(); // Define allocations to the test address, as many small notes. let allocations = { @@ -57,7 +57,7 @@ async fn app_can_sweep_a_collection_of_small_notes() -> anyhow::Result<()> { let mut test_node = { let content = Content { chain_id: TestNode::<()>::CHAIN_ID.to_string(), - shielded_pool_content: penumbra_shielded_pool::genesis::Content { + shielded_pool_content: penumbra_sdk_shielded_pool::genesis::Content { allocations, ..Default::default() }, @@ -95,7 +95,7 @@ async fn app_can_sweep_a_collection_of_small_notes() -> anyhow::Result<()> { // Spawn the server-side view server. { - let make_svc = penumbra_app::rpc::routes( + let make_svc = penumbra_sdk_app::rpc::routes( storage.as_ref(), proxy, false, /*enable_expensive_rpc*/ @@ -115,7 +115,7 @@ async fn app_can_sweep_a_collection_of_small_notes() -> anyhow::Result<()> { // Spawn the client-side view server... let view_server = { - penumbra_view::ViewServer::load_or_initialize( + penumbra_sdk_view::ViewServer::load_or_initialize( None::<&camino::Utf8Path>, None::<&camino::Utf8Path>, &*test_keys::FULL_VIEWING_KEY, @@ -159,7 +159,7 @@ async fn app_can_sweep_a_collection_of_small_notes() -> anyhow::Result<()> { ); loop { - let plans = penumbra_wallet::plan::sweep(&mut view_client, OsRng) + let plans = penumbra_sdk_wallet::plan::sweep(&mut view_client, OsRng) .await .context("constructing sweep plans")?; if plans.is_empty() { diff --git a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs index 82ec8b14b6..716ad717d8 100644 --- a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs +++ b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs @@ -4,18 +4,18 @@ use { cnidarium::TempStorage, common::TempStorageExt as _, decaf377_fmd::Precision, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_num::fixpoint::U128x128, - penumbra_proto::DomainType, - penumbra_sct::component::clock::EpochRead as _, - penumbra_stake::{component::validator_handler::ValidatorDataRead as _, UndelegateClaimPlan}, - penumbra_transaction::{ + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_num::fixpoint::U128x128, + penumbra_sdk_proto::DomainType, + penumbra_sdk_sct::component::clock::EpochRead as _, + penumbra_sdk_stake::{component::validator_handler::ValidatorDataRead as _, UndelegateClaimPlan}, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, rand_core::OsRng, @@ -26,19 +26,19 @@ use { mod common; -/// The length of the [`penumbra_sct`] epoch. +/// The length of the [`penumbra_sdk_sct`] epoch. /// /// This test relies on many epochs turning over, so we will work with a shorter epoch duration. const EPOCH_DURATION: u64 = 3; -/// The length of the [`penumbra_stake`] unbonding_delay. +/// The length of the [`penumbra_sdk_stake`] unbonding_delay. const UNBONDING_DELAY: u64 = 4; #[tokio::test] 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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Helper function to get the latest block height. let get_latest_height = || async { @@ -71,7 +71,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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; @@ -83,7 +83,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { .await? .try_into() .map_err(|keys| anyhow::anyhow!("expected one key, got: {keys:?}"))?; - let delegate_token_id = penumbra_stake::DelegationToken::new(identity_key).id(); + let delegate_token_id = penumbra_sdk_stake::DelegationToken::new(identity_key).id(); // Sync the mock client, using the test wallet's spend key, to the latest snapshot. let mut client = MockClient::new(test_keys::SPEND_KEY.clone()) @@ -110,13 +110,13 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { .tap(|rate| tracing::info!(?rate, "got validator rate")); let (plan, staking_note, staking_note_nullifier) = { use { - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_transaction::{ + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, }; let note = client - .notes_by_asset(*penumbra_asset::STAKING_TOKEN_ASSET_ID) + .notes_by_asset(*penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID) .cloned() .next() .expect("should get staking note"); @@ -174,7 +174,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { .await?; // Show that the client now has a single note for some delegation tokens. - let delegate_note: penumbra_shielded_pool::Note = { + let delegate_note: penumbra_sdk_shielded_pool::Note = { let mut notes: Vec<_> = client.notes_by_asset(delegate_token_id).cloned().collect(); assert_eq!(notes.len(), 1, "client should now have delegation tokens"); notes.pop().unwrap() @@ -182,7 +182,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { // Show that the staking note has a nullifier that has now been spent. { - use penumbra_sct::component::tree::VerificationExt; + use penumbra_sdk_sct::component::tree::VerificationExt; let snapshot = storage.latest_snapshot(); let Err(_) = snapshot .check_nullifier_unspent(staking_note_nullifier) @@ -204,9 +204,9 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { .tap(|rate| tracing::info!(?rate, "got new validator rate")); let (plan, undelegate_token_id) = { use { - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_stake::DelegationToken, - penumbra_transaction::{ + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_stake::DelegationToken, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, }; @@ -274,7 +274,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { .expect("snapshot should have a block height"); // Show that we immediately receive unbonding tokens after undelegating. - let undelegate_note: penumbra_shielded_pool::Note = { + let undelegate_note: penumbra_sdk_shielded_pool::Note = { client.sync_to_latest(post_undelegate_snapshot).await?; let mut undelegate_notes: Vec<_> = client .notes_by_asset(undelegate_token_id) @@ -304,7 +304,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { // Build a transaction that will now reclaim staking tokens from the validator. let plan = { client.sync_to_latest(storage.latest_snapshot()).await?; - let penalty = penumbra_stake::Penalty::from_percent(0); + let penalty = penumbra_sdk_stake::Penalty::from_percent(0); let note = client .notes .values() @@ -350,7 +350,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { { client.sync_to_latest(post_claim_snapshot.clone()).await?; let notes: Vec<_> = client - .notes_by_asset(*penumbra_asset::STAKING_TOKEN_ASSET_ID) + .notes_by_asset(*penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID) .cloned() .collect(); assert_eq!(notes.len(), 1, "client should still have staking notes"); @@ -368,7 +368,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { // Lets make some assertions that the note amounts respect the validator rates. { - use penumbra_stake::BPS_SQUARED_SCALING_FACTOR; + use penumbra_sdk_stake::BPS_SQUARED_SCALING_FACTOR; use std::ops::Deref; let staking_note_amount: U128x128 = staking_note.amount().into(); @@ -382,7 +382,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { (undelegate_exchange_rate / BPS_SQUARED_SCALING_FACTOR.deref())?; // Compute the expected amount of delegation tokens we should have received. - let expected: penumbra_num::Amount = staking_note_amount + let expected: penumbra_sdk_num::Amount = staking_note_amount .checked_div(&scaled_delegate_rate)? .round_down() .try_into()?; @@ -394,7 +394,7 @@ async fn app_can_undelegate_from_a_validator() -> anyhow::Result<()> { ); // Compute the expected amount of undelegation tokens we should have received. - let expected: penumbra_num::Amount = delegate_note_amount + let expected: penumbra_sdk_num::Amount = delegate_note_amount .checked_mul(&scaled_undelegate_rate)? .round_down() .try_into()?; diff --git a/crates/core/app/tests/app_check_dex_vcb.rs b/crates/core/app/tests/app_check_dex_vcb.rs index 85d6a87f5a..32fe84b610 100644 --- a/crates/core/app/tests/app_check_dex_vcb.rs +++ b/crates/core/app/tests/app_check_dex_vcb.rs @@ -3,16 +3,16 @@ mod common; use self::common::TempStorageExt; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::ActionHandler; -use penumbra_asset::asset; -use penumbra_dex::{ +use penumbra_sdk_asset::asset; +use penumbra_sdk_dex::{ component::ValueCircuitBreakerRead, swap::{SwapPlaintext, SwapPlan}, TradingPair, }; -use penumbra_fee::Fee; -use penumbra_keys::{test_keys, Address}; -use penumbra_num::Amount; -use penumbra_sct::component::source::SourceContext; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_keys::{test_keys, Address}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_sct::component::source::SourceContext; use rand_core::SeedableRng; use std::{ops::Deref, sync::Arc}; @@ -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_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await? .apply_default_genesis() .await?; diff --git a/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs b/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs index 5bc71e50ed..5a21812af9 100644 --- a/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs +++ b/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs @@ -3,15 +3,15 @@ use { cnidarium::TempStorage, common::TempStorageExt as _, decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::DomainType, - penumbra_stake::{validator::Validator, FundingStreams, GovernanceKey, IdentityKey}, + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::DomainType, + penumbra_sdk_stake::{validator::Validator, FundingStreams, GovernanceKey, IdentityKey}, rand_core::OsRng, tap::Tap, tracing::{error_span, info, Instrument}, @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Start the test node. let mut node = { @@ -34,7 +34,7 @@ async fn app_rejects_validator_definitions_with_invalid_auth_sigs() -> anyhow::R ); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; @@ -92,8 +92,8 @@ async fn app_rejects_validator_definitions_with_invalid_auth_sigs() -> anyhow::R // Make a transaction that defines a new validator, providing an invalid signature. let plan = { use { - penumbra_stake::validator, - penumbra_transaction::{ActionPlan, TransactionParameters, TransactionPlan}, + penumbra_sdk_stake::validator, + penumbra_sdk_transaction::{ActionPlan, TransactionParameters, TransactionPlan}, rand_core::OsRng, }; let bytes = new_validator.encode_to_vec(); diff --git a/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs b/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs index fcf7a4e21e..0f20fb5b5a 100644 --- a/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs +++ b/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs @@ -3,12 +3,12 @@ use { anyhow::anyhow, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_asset::{Value, STAKING_TOKEN_ASSET_ID}, - penumbra_auction::{ + penumbra_sdk_asset::{Value, STAKING_TOKEN_ASSET_ID}, + penumbra_sdk_auction::{ auction::{ dutch::{ActionDutchAuctionEnd, ActionDutchAuctionSchedule, DutchAuctionDescription}, AuctionNft, @@ -16,12 +16,12 @@ use { component::AuctionStoreRead, StateReadExt as _, }, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::DomainType, - penumbra_shielded_pool::{Note, OutputPlan, SpendPlan}, - penumbra_transaction::{ + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::DomainType, + penumbra_sdk_shielded_pool::{Note, OutputPlan, SpendPlan}, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, ActionPlan, TransactionParameters, TransactionPlan, }, rand_core::OsRng, @@ -54,19 +54,19 @@ async fn app_can_reproduce_tesnet_75_vcb_close() -> anyhow::Result<()> { let guard = { let filter = EnvFilter::default() .add_directive( - "penumbra_auction=trace" + "penumbra_sdk_auction=trace" .parse() .expect("we only write valid code :)"), ) .add_directive( - "penumbra_dex=debug" + "penumbra_sdk_dex=debug" .parse() .expect("we only write valid code :)"), ); common::set_tracing_subscriber_with_env_filter(filter) }; - let storage = TempStorage::new_with_penumbra_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), ); @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; diff --git a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs index 4678141941..6a299409dc 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs @@ -3,12 +3,12 @@ use { anyhow::Context, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_mock_consensus::TestNode, - penumbra_stake::component::validator_handler::validator_store::ValidatorDataRead, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_stake::component::validator_handler::validator_store::ValidatorDataRead, tap::Tap, tracing::{error_span, trace, Instrument}, }; @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Start the test node. let mut node = { @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; diff --git a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs index 309afa4256..de5f637c33 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs @@ -3,12 +3,12 @@ use { anyhow::Context, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_mock_consensus::TestNode, - penumbra_stake::component::validator_handler::validator_store::ValidatorDataRead, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_stake::component::validator_handler::validator_store::ValidatorDataRead, tap::Tap, tracing::{error_span, Instrument}, }; @@ -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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Start the test node. let mut node = { @@ -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_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; diff --git a/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs b/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs index de687b1356..6ed4cc4d34 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs @@ -3,16 +3,16 @@ use { cnidarium::TempStorage, common::TempStorageExt as _, decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::DomainType, - penumbra_sct::component::clock::EpochRead, - penumbra_stake::{ + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::DomainType, + penumbra_sdk_sct::component::clock::EpochRead, + penumbra_sdk_stake::{ component::validator_handler::validator_store::ValidatorDataRead, validator::Validator, FundingStreams, GovernanceKey, IdentityKey, Uptime, }, @@ -26,14 +26,14 @@ mod common; #[tokio::test] async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<()> { - /// The length of the [`penumbra_sct`] epoch. + /// The length of the [`penumbra_sdk_sct`] epoch. /// /// This test relies on many epochs turning over, so we will work with a shorter epoch duration. const EPOCH_DURATION: u64 = 8; // 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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Configure an AppState with slightly shorter epochs than usual. let app_state = AppState::Content( @@ -47,7 +47,7 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<( let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await }?; @@ -66,7 +66,7 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<( // Helper function, count the validators in the current consensus set. let get_latest_consensus_set = || async { - use penumbra_stake::component::ConsensusIndexRead; + use penumbra_sdk_stake::component::ConsensusIndexRead; storage .latest_snapshot() .get_consensus_set() @@ -114,8 +114,8 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<( // Make a transaction that defines the new validator. let plan = { use { - penumbra_stake::validator, - penumbra_transaction::{ActionPlan, TransactionParameters, TransactionPlan}, + penumbra_sdk_stake::validator, + penumbra_sdk_transaction::{ActionPlan, TransactionParameters, TransactionPlan}, rand_core::OsRng, }; let bytes = new_validator.encode_to_vec(); @@ -160,10 +160,10 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<( // Now, create a transaction that delegates to the new validator. let plan = { use { - penumbra_asset::STAKING_TOKEN_ASSET_ID, - penumbra_sct::component::clock::EpochRead, - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_transaction::{ + penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID, + penumbra_sdk_sct::component::clock::EpochRead, + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, }; @@ -280,10 +280,10 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> anyhow::Result<( // Build a transaction that will now undelegate from the validator. let plan = { use { - penumbra_sct::component::clock::EpochRead, - penumbra_shielded_pool::{OutputPlan, SpendPlan}, - penumbra_stake::DelegationToken, - penumbra_transaction::{ + penumbra_sdk_sct::component::clock::EpochRead, + penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}, + penumbra_sdk_stake::DelegationToken, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, }; diff --git a/crates/core/app/tests/common/ibc_tests/mod.rs b/crates/core/app/tests/common/ibc_tests/mod.rs index 4c03e8a44c..1cbbe9b781 100644 --- a/crates/core/app/tests/common/ibc_tests/mod.rs +++ b/crates/core/app/tests/common/ibc_tests/mod.rs @@ -3,15 +3,15 @@ use {anyhow::Result, std::time::Duration}; mod relayer; use anyhow::Context as _; use decaf377_rdsa::{SigningKey, SpendAuth, VerificationKey}; -use penumbra_app::{ +use penumbra_sdk_app::{ app::{MAX_BLOCK_TXS_PAYLOAD_BYTES, MAX_EVIDENCE_SIZE_BYTES}, genesis, }; -use penumbra_keys::keys::{SpendKey, SpendKeyBytes}; -use penumbra_mock_consensus::TestNode; -use penumbra_proto::core::component::stake::v1::Validator; -use penumbra_shielded_pool::genesis::Allocation; -use penumbra_stake::{DelegationToken, GovernanceKey, IdentityKey}; +use penumbra_sdk_keys::keys::{SpendKey, SpendKeyBytes}; +use penumbra_sdk_mock_consensus::TestNode; +use penumbra_sdk_proto::core::component::stake::v1::Validator; +use penumbra_sdk_shielded_pool::genesis::Allocation; +use penumbra_sdk_stake::{DelegationToken, GovernanceKey, IdentityKey}; #[allow(unused_imports)] pub use relayer::MockRelayer; @@ -179,7 +179,7 @@ pub fn get_verified_genesis() -> Result { // always empty in genesis json app_hash: tendermint::AppHash::default(), // app_state: genesis_contents.into(), - app_state: serde_json::value::to_value(penumbra_app::genesis::AppState::Content( + app_state: serde_json::value::to_value(penumbra_sdk_app::genesis::AppState::Content( genesis_contents, )) .unwrap(), diff --git a/crates/core/app/tests/common/ibc_tests/node.rs b/crates/core/app/tests/common/ibc_tests/node.rs index 971b798bed..f39d2f4dfa 100644 --- a/crates/core/app/tests/common/ibc_tests/node.rs +++ b/crates/core/app/tests/common/ibc_tests/node.rs @@ -20,15 +20,15 @@ use { consensus_state::ConsensusState, header::Header as TendermintHeader, }, }, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_ibc::{component::ClientStateReadExt as _, IBC_COMMITMENT_PREFIX}, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::util::tendermint_proxy::v1::{ + penumbra_sdk_ibc::{component::ClientStateReadExt as _, IBC_COMMITMENT_PREFIX}, + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::util::tendermint_proxy::v1::{ tendermint_proxy_service_client::TendermintProxyServiceClient, GetStatusRequest, }, std::error::Error, @@ -78,9 +78,9 @@ impl TestNodeWithIBC { ) -> Result { let chain_id = format!("{}-{}", TestNode::<()>::CHAIN_ID, suffix); // Use the correct substores - let storage = TempStorage::new_with_penumbra_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Instantiate a mock tendermint proxy, which we will connect to the test node. - let proxy = penumbra_mock_tendermint_proxy::TestNodeProxy::new::(); + let proxy = penumbra_sdk_mock_tendermint_proxy::TestNodeProxy::new::(); let node = { let app_state = @@ -90,7 +90,7 @@ impl TestNodeWithIBC { .with_keys(vec![keys]) .single_validator() .with_initial_timestamp(start_time) - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .on_block(proxy.on_block_callback()) .init_chain(consensus) .await @@ -112,7 +112,7 @@ impl TestNodeWithIBC { tracing::info!("spawning gRPC..."); // Spawn the node's RPC server. let _rpc_server = { - let make_svc = penumbra_app::rpc::routes( + let make_svc = penumbra_sdk_app::rpc::routes( storage.as_ref(), proxy, false, /*enable_expensive_rpc*/ @@ -193,7 +193,7 @@ impl TestNodeWithIBC { } pub async fn get_latest_height(&mut self) -> Result { - let status: penumbra_proto::util::tendermint_proxy::v1::GetStatusResponse = self + let status: penumbra_sdk_proto::util::tendermint_proxy::v1::GetStatusResponse = self .tendermint_proxy_service_client .get_status(GetStatusRequest {}) .await? @@ -212,7 +212,7 @@ impl TestNodeWithIBC { pub fn create_tendermint_header( &self, trusted_height: Option, - penumbra_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse{block_id: _, block}: penumbra_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse, + penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse{block_id: _, block}: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse, ) -> Result { let pk = self .node diff --git a/crates/core/app/tests/common/ibc_tests/relayer.rs b/crates/core/app/tests/common/ibc_tests/relayer.rs index 49e8307362..1d5f72b1fc 100644 --- a/crates/core/app/tests/common/ibc_tests/relayer.rs +++ b/crates/core/app/tests/common/ibc_tests/relayer.rs @@ -41,17 +41,17 @@ use { timestamp::Timestamp, DomainType as _, }, - penumbra_asset::{asset::Cache, Value}, - penumbra_ibc::{ + penumbra_sdk_asset::{asset::Cache, Value}, + penumbra_sdk_ibc::{ component::{ChannelStateReadExt as _, ConnectionStateReadExt as _}, IbcRelay, IbcToken, IBC_COMMITMENT_PREFIX, IBC_PROOF_SPECS, }, - penumbra_keys::keys::AddressIndex, - penumbra_num::Amount, - penumbra_proto::{util::tendermint_proxy::v1::GetBlockByHeightRequest, DomainType}, - penumbra_shielded_pool::{Ics20Withdrawal, OutputPlan, SpendPlan}, - penumbra_stake::state_key::chain, - penumbra_transaction::{ + penumbra_sdk_keys::keys::AddressIndex, + penumbra_sdk_num::Amount, + penumbra_sdk_proto::{util::tendermint_proxy::v1::GetBlockByHeightRequest, DomainType}, + penumbra_sdk_shielded_pool::{Ics20Withdrawal, OutputPlan, SpendPlan}, + penumbra_sdk_stake::state_key::chain, + penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, prost::Message as _, @@ -332,7 +332,7 @@ impl MockRelayer { // The latest_height is for chain B latest_height: chain_b_ibc.get_latest_height().await?, // The ICS02 validation is hardcoded to expect 2 proof specs - // (root and substore, see [`penumbra_ibc::component::ics02_validation`]). + // (root and substore, see [`penumbra_sdk_ibc::component::ics02_validation`]). proof_specs: IBC_PROOF_SPECS.to_vec(), upgrade_path: vec!["upgrade".to_string(), "upgradedIBCState".to_string()], allow_update: AllowUpdate { @@ -1625,7 +1625,7 @@ impl MockRelayer { }; let plan = { - let ics20_msg = penumbra_transaction::ActionPlan::IbcAction( + let ics20_msg = penumbra_sdk_transaction::ActionPlan::IbcAction( IbcRelay::RecvPacket(msg_recv_packet), ) .into(); @@ -1745,7 +1745,7 @@ impl MockRelayer { }; let plan = { - let ics20_msg = penumbra_transaction::ActionPlan::IbcAction( + let ics20_msg = penumbra_sdk_transaction::ActionPlan::IbcAction( IbcRelay::Acknowledgement(msg_ack), ) .into(); @@ -1791,7 +1791,7 @@ async fn _build_and_send_update_client( chain_b_ibc: &mut TestNodeWithIBC, ) -> Result { let chain_b_height = chain_b_ibc.get_latest_height().await?; - let chain_b_latest_block: penumbra_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse = + let chain_b_latest_block: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse = chain_b_ibc .tendermint_proxy_service_client .get_block_by_height(GetBlockByHeightRequest { diff --git a/crates/core/app/tests/common/mod.rs b/crates/core/app/tests/common/mod.rs index 36179b5cd7..c2dfcc6a05 100644 --- a/crates/core/app/tests/common/mod.rs +++ b/crates/core/app/tests/common/mod.rs @@ -7,7 +7,7 @@ pub use { temp_storage_ext::TempStorageExt, test_node_builder_ext::BuilderExt, test_node_ext::TestNodeExt, validator_read_ext::ValidatorDataReadExt, }, - penumbra_test_subscriber::{set_tracing_subscriber, set_tracing_subscriber_with_env_filter}, + penumbra_sdk_test_subscriber::{set_tracing_subscriber, set_tracing_subscriber_with_env_filter}, }; /// Penumbra-specific extensions to the mock consensus builder. @@ -25,7 +25,7 @@ mod test_node_ext; /// Helpful additions for reading validator information. /// -/// See [`ValidatorDataRead`][penumbra_stake::component::validator_handler::ValidatorDataRead], +/// See [`ValidatorDataRead`][penumbra_sdk_stake::component::validator_handler::ValidatorDataRead], /// and [`ValidatorDataReadExt`]. mod validator_read_ext; diff --git a/crates/core/app/tests/common/temp_storage_ext.rs b/crates/core/app/tests/common/temp_storage_ext.rs index f1a2496ded..be1483313a 100644 --- a/crates/core/app/tests/common/temp_storage_ext.rs +++ b/crates/core/app/tests/common/temp_storage_ext.rs @@ -1,7 +1,7 @@ use { async_trait::async_trait, cnidarium::TempStorage, - penumbra_app::{app::App, genesis::AppState, SUBSTORE_PREFIXES}, + penumbra_sdk_app::{app::App, genesis::AppState, SUBSTORE_PREFIXES}, std::ops::Deref, }; @@ -10,12 +10,12 @@ pub trait TempStorageExt: Sized { async fn apply_genesis(self, genesis: AppState) -> anyhow::Result; #[allow(dead_code)] async fn apply_default_genesis(self) -> anyhow::Result; - async fn new_with_penumbra_prefixes() -> anyhow::Result; + async fn new_with_penumbra_sdk_prefixes() -> anyhow::Result; } #[async_trait] impl TempStorageExt for TempStorage { - async fn new_with_penumbra_prefixes() -> anyhow::Result { + async fn new_with_penumbra_sdk_prefixes() -> anyhow::Result { TempStorage::new_with_prefixes(SUBSTORE_PREFIXES.to_vec()).await } diff --git a/crates/core/app/tests/common/test_node_builder_ext.rs b/crates/core/app/tests/common/test_node_builder_ext.rs index 93bf7f7fee..81865651f0 100644 --- a/crates/core/app/tests/common/test_node_builder_ext.rs +++ b/crates/core/app/tests/common/test_node_builder_ext.rs @@ -1,14 +1,14 @@ use { decaf377_rdsa::VerificationKey, - penumbra_app::genesis::AppState, - penumbra_keys::keys::{SpendKey, SpendKeyBytes}, - penumbra_mock_consensus::builder::Builder, - penumbra_proto::{ + penumbra_sdk_app::genesis::AppState, + penumbra_sdk_keys::keys::{SpendKey, SpendKeyBytes}, + penumbra_sdk_mock_consensus::builder::Builder, + penumbra_sdk_proto::{ core::keys::v1::{GovernanceKey, IdentityKey}, penumbra::core::component::stake::v1::Validator as PenumbraValidator, }, - penumbra_shielded_pool::genesis::Allocation, - penumbra_stake::DelegationToken, + penumbra_sdk_shielded_pool::genesis::Allocation, + penumbra_sdk_stake::DelegationToken, rand::Rng, rand_core::OsRng, tracing::trace, @@ -16,17 +16,17 @@ use { /// Penumbra-specific extensions to the mock consensus builder. pub trait BuilderExt: Sized { - /// The error thrown by [`with_penumbra_auto_app_state`] + /// The error thrown by [`with_penumbra_sdk_auto_app_state`] type Error; /// Add the provided Penumbra [`AppState`] to the builder. /// /// This will inject any configured validators into the state before serializing it into bytes. - fn with_penumbra_auto_app_state(self, app_state: AppState) -> Result; + fn with_penumbra_sdk_auto_app_state(self, app_state: AppState) -> Result; } impl BuilderExt for Builder { type Error = anyhow::Error; - fn with_penumbra_auto_app_state(mut self, app_state: AppState) -> Result { + fn with_penumbra_sdk_auto_app_state(mut self, app_state: AppState) -> Result { let Self { keyring, .. } = &self; let mut content = match app_state { AppState::Content(c) => c, @@ -40,7 +40,7 @@ impl BuilderExt for Builder { // Generate a penumbra validator with this consensus key, and a corresponding // allocation of delegation tokens. - let (validator, allocation) = generate_penumbra_validator(consensus_vk, seed); + let (validator, allocation) = generate_penumbra_sdk_validator(consensus_vk, seed); // Add the validator to the staking component's genesis content. trace!(?validator, "adding validator to staking genesis content"); @@ -68,7 +68,7 @@ impl BuilderExt for Builder { } /// Generates a [`Validator`][PenumbraValidator] given a consensus verification key. -fn generate_penumbra_validator( +fn generate_penumbra_sdk_validator( consensus_key: &ed25519_consensus::VerificationKey, seed: Option, ) -> (PenumbraValidator, Allocation) { @@ -100,7 +100,7 @@ fn generate_penumbra_validator( .incoming() .payment_address(0u32.into()); - let ik = penumbra_stake::IdentityKey(validator_id_vk.into()); + let ik = penumbra_sdk_stake::IdentityKey(validator_id_vk.into()); let delegation_denom = DelegationToken::from(ik).denom(); let allocation = Allocation { diff --git a/crates/core/app/tests/common/test_node_ext.rs b/crates/core/app/tests/common/test_node_ext.rs index 241c3c25f6..edeb3d855e 100644 --- a/crates/core/app/tests/common/test_node_ext.rs +++ b/crates/core/app/tests/common/test_node_ext.rs @@ -2,8 +2,8 @@ #![allow(dead_code)] use { - async_trait::async_trait, cnidarium::TempStorage, penumbra_mock_consensus::TestNode, - penumbra_sct::component::clock::EpochRead as _, tap::Tap, + async_trait::async_trait, cnidarium::TempStorage, penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_sct::component::clock::EpochRead as _, tap::Tap, }; #[async_trait] @@ -11,7 +11,7 @@ pub trait TestNodeExt: Sized { async fn fast_forward_to_next_epoch( &mut self, storage: &TempStorage, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait] @@ -30,7 +30,7 @@ where async fn fast_forward_to_next_epoch( &mut self, storage: &TempStorage, - ) -> Result { + ) -> Result { let get_epoch = || async { storage.latest_snapshot().get_current_epoch().await }; let start = get_epoch() .await? diff --git a/crates/core/app/tests/common/validator_read_ext.rs b/crates/core/app/tests/common/validator_read_ext.rs index a88b4836ac..0379e70b4e 100644 --- a/crates/core/app/tests/common/validator_read_ext.rs +++ b/crates/core/app/tests/common/validator_read_ext.rs @@ -4,8 +4,8 @@ use { async_trait::async_trait, futures::TryStreamExt, - penumbra_proto::StateReadProto, - penumbra_stake::{ + penumbra_sdk_proto::StateReadProto, + penumbra_sdk_stake::{ component::validator_handler::ValidatorDataRead, state_key, validator::Validator, IdentityKey, }, diff --git a/crates/core/app/tests/ics23_transfer.rs b/crates/core/app/tests/ics23_transfer.rs index 14dc459db2..a4705b9884 100644 --- a/crates/core/app/tests/ics23_transfer.rs +++ b/crates/core/app/tests/ics23_transfer.rs @@ -2,9 +2,9 @@ use { anyhow::anyhow, common::ibc_tests::{MockRelayer, TestNodeWithIBC, ValidatorKeys}, once_cell::sync::Lazy, - penumbra_asset::{asset::Cache, Value}, - penumbra_ibc::IbcToken, - penumbra_num::Amount, + penumbra_sdk_asset::{asset::Cache, Value}, + penumbra_sdk_ibc::IbcToken, + penumbra_sdk_num::Amount, std::time::Duration, tap::Tap as _, }; diff --git a/crates/core/app/tests/mock_consensus_block_proving.rs b/crates/core/app/tests/mock_consensus_block_proving.rs index 59ae3a74b8..3c58973c84 100644 --- a/crates/core/app/tests/mock_consensus_block_proving.rs +++ b/crates/core/app/tests/mock_consensus_block_proving.rs @@ -14,15 +14,15 @@ use { path::ClientStatePath, DomainType as _, }, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_ibc::{IbcRelay, MerklePrefixExt as _, IBC_COMMITMENT_PREFIX, IBC_PROOF_SPECS}, - penumbra_keys::test_keys, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::{ + penumbra_sdk_ibc::{IbcRelay, MerklePrefixExt as _, IBC_COMMITMENT_PREFIX, IBC_PROOF_SPECS}, + penumbra_sdk_keys::test_keys, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::{ cnidarium::v1::{ query_service_client::QueryServiceClient as CnidariumQueryServiceClient, KeyValueRequest, @@ -32,8 +32,8 @@ use { }, DomainType, Message as _, }, - penumbra_test_subscriber::set_tracing_subscriber, - penumbra_transaction::{TransactionParameters, TransactionPlan}, + penumbra_sdk_test_subscriber::set_tracing_subscriber, + penumbra_sdk_transaction::{TransactionParameters, TransactionPlan}, std::{str::FromStr as _, time::Duration}, tap::{Tap as _, TapFallible as _}, tendermint::Hash, @@ -48,11 +48,11 @@ async fn verify_storage_proof_simple() -> anyhow::Result<()> { // Install a test logger, and acquire some temporary storage. let guard = set_tracing_subscriber(); - let storage = TempStorage::new_with_penumbra_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; let start_time = tendermint::Time::parse_from_rfc3339("2022-02-11T17:30:50.425417198Z")?; - let proxy = penumbra_mock_tendermint_proxy::TestNodeProxy::new::(); + let proxy = penumbra_sdk_mock_tendermint_proxy::TestNodeProxy::new::(); let mut node = { let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), @@ -61,7 +61,7 @@ async fn verify_storage_proof_simple() -> anyhow::Result<()> { // let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .on_block(proxy.on_block_callback()) .init_chain(consensus) .await @@ -191,7 +191,7 @@ async fn verify_storage_proof_simple() -> anyhow::Result<()> { // Spawn the node's RPC server. let _rpc_server = { let make_svc = - penumbra_app::rpc::routes(&storage, proxy, false /*enable_expensive_rpc*/)? + penumbra_sdk_app::rpc::routes(&storage, proxy, false /*enable_expensive_rpc*/)? .into_axum_router() .layer(tower_http::cors::CorsLayer::permissive()) .into_make_service() @@ -285,7 +285,7 @@ async fn verify_storage_proof_simple() -> anyhow::Result<()> { .revision_height ); - let proof_block: penumbra_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse = + let proof_block: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse = tendermint_proxy_service_client .get_block_by_height(GetBlockByHeightRequest { height: ibc_client_state_response @@ -307,7 +307,7 @@ async fn verify_storage_proof_simple() -> anyhow::Result<()> { // We should be able to get the block from the proof_height associated with // the proof and use the app_hash as the jmt root and succeed in proving: - let proof_block: penumbra_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse = + let proof_block: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse = tendermint_proxy_service_client .get_block_by_height(GetBlockByHeightRequest { height: ibc_client_state_response diff --git a/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs b/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs index a0077ae8f8..a3f40e26b3 100644 --- a/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs +++ b/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs @@ -3,12 +3,12 @@ use { anyhow::anyhow, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_mock_consensus::TestNode, - penumbra_stake::component::validator_handler::ValidatorDataRead as _, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_stake::component::validator_handler::ValidatorDataRead as _, tap::{Tap, TapFallible}, tracing::info, }; @@ -20,7 +20,7 @@ mod common; async fn mock_consensus_can_define_a_genesis_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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; let test_node = { let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), @@ -28,7 +28,7 @@ async fn mock_consensus_can_define_a_genesis_validator() -> anyhow::Result<()> { let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await .tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))? @@ -48,7 +48,7 @@ async fn mock_consensus_can_define_a_genesis_validator() -> anyhow::Result<()> { .ok_or_else(|| anyhow!("could not find validator status"))?; assert_eq!( status, - penumbra_stake::validator::State::Active, + penumbra_sdk_stake::validator::State::Active, "validator should be active" ); } diff --git a/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs b/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs index b0461b3d69..12e5c904d7 100644 --- a/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs +++ b/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs @@ -2,12 +2,12 @@ use { self::common::BuilderExt, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_mock_consensus::TestNode, - penumbra_sct::component::clock::EpochRead as _, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_sct::component::clock::EpochRead as _, tap::TapFallible, }; @@ -19,7 +19,7 @@ mod common; async fn mock_consensus_can_send_a_sequence_of_empty_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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; let mut test_node = { let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), @@ -27,7 +27,7 @@ async fn mock_consensus_can_send_a_sequence_of_empty_blocks() -> anyhow::Result< let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .init_chain(consensus) .await .tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))? diff --git a/crates/core/app/tests/spend.rs b/crates/core/app/tests/spend.rs index 94c9f63caf..890d799e1d 100644 --- a/crates/core/app/tests/spend.rs +++ b/crates/core/app/tests/spend.rs @@ -5,19 +5,19 @@ use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler as _, Component}; use decaf377::{Fq, Fr}; use decaf377_rdsa::{SpendAuth, VerificationKey}; -use penumbra_asset::Value; -use penumbra_compact_block::component::CompactBlockManager; -use penumbra_keys::{keys::NullifierKey, test_keys}; -use penumbra_mock_client::MockClient; -use penumbra_num::Amount; -use penumbra_sct::{ +use penumbra_sdk_asset::Value; +use penumbra_sdk_compact_block::component::CompactBlockManager; +use penumbra_sdk_keys::{keys::NullifierKey, test_keys}; +use penumbra_sdk_mock_client::MockClient; +use penumbra_sdk_num::Amount; +use penumbra_sdk_sct::{ component::{clock::EpochManager, source::SourceContext}, epoch::Epoch, }; -use penumbra_shielded_pool::{ +use penumbra_sdk_shielded_pool::{ component::ShieldedPool, Note, SpendPlan, SpendProof, SpendProofPrivate, SpendProofPublic, }; -use penumbra_txhash::{EffectHash, TransactionContext}; +use penumbra_sdk_txhash::{EffectHash, TransactionContext}; use rand_core::{OsRng, SeedableRng}; use std::{ops::Deref, sync::Arc}; use tendermint::abci; @@ -26,7 +26,7 @@ use tendermint::abci; async fn spend_happy_path() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await? .apply_default_genesis() .await?; @@ -105,7 +105,7 @@ async fn spend_happy_path() -> anyhow::Result<()> { async fn invalid_dummy_spend() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await .unwrap() .apply_default_genesis() @@ -178,7 +178,7 @@ async fn invalid_dummy_spend() { let bad_proof = SpendProof::prove( Fq::rand(&mut OsRng), Fq::rand(&mut OsRng), - &penumbra_proof_params::SPEND_PROOF_PROVING_KEY, + &penumbra_sdk_proof_params::SPEND_PROOF_PROVING_KEY, public, private, ) @@ -206,7 +206,7 @@ async fn invalid_dummy_spend() { async fn spend_duplicate_nullifier_previous_transaction() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await .expect("can start new temp storage") .apply_default_genesis() @@ -297,7 +297,7 @@ async fn spend_duplicate_nullifier_previous_transaction() { async fn spend_duplicate_nullifier_same_transaction() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await .expect("can start new temp storage") .apply_default_genesis() @@ -354,7 +354,7 @@ async fn spend_duplicate_nullifier_same_transaction() { asset_id: note.asset_id(), }; let output_plan = - penumbra_shielded_pool::OutputPlan::new(&mut rng, value, *test_keys::ADDRESS_1); + penumbra_sdk_shielded_pool::OutputPlan::new(&mut rng, value, *test_keys::ADDRESS_1); let fvk = &test_keys::FULL_VIEWING_KEY; let memo_key = PayloadKey::random_key(&mut rng); let output = output_plan.output(fvk.outgoing(), &memo_key); @@ -363,9 +363,9 @@ async fn spend_duplicate_nullifier_same_transaction() { // 5. Construct a transaction with both spends that use the same note/nullifier. let transaction_body = TransactionBody { actions: vec![ - penumbra_transaction::Action::Spend(spend_1), - penumbra_transaction::Action::Spend(spend_2), - penumbra_transaction::Action::Output(output), + penumbra_sdk_transaction::Action::Spend(spend_1), + penumbra_sdk_transaction::Action::Spend(spend_2), + penumbra_sdk_transaction::Action::Output(output), ], transaction_parameters: TransactionParameters::default(), detection_data: None, diff --git a/crates/core/app/tests/swap_and_swap_claim.rs b/crates/core/app/tests/swap_and_swap_claim.rs index 6cf1d8de45..56e571dc59 100644 --- a/crates/core/app/tests/swap_and_swap_claim.rs +++ b/crates/core/app/tests/swap_and_swap_claim.rs @@ -4,24 +4,24 @@ use self::common::TempStorageExt; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler, Component}; use decaf377::Fq; -use penumbra_asset::asset; -use penumbra_compact_block::component::CompactBlockManager as _; -use penumbra_dex::{ +use penumbra_sdk_asset::asset; +use penumbra_sdk_compact_block::component::CompactBlockManager as _; +use penumbra_sdk_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::{ +use penumbra_sdk_fee::Fee; +use penumbra_sdk_keys::{test_keys, Address}; +use penumbra_sdk_mock_client::MockClient; +use penumbra_sdk_num::Amount; +use penumbra_sdk_sct::{ component::{clock::EpochManager, source::SourceContext as _, StateReadExt as _}, epoch::Epoch, }; -use penumbra_shielded_pool::component::ShieldedPool; -use penumbra_transaction::Transaction; +use penumbra_sdk_shielded_pool::component::ShieldedPool; +use penumbra_sdk_transaction::Transaction; use rand_core::SeedableRng; use std::{ops::Deref, sync::Arc}; use tendermint::abci; @@ -30,7 +30,7 @@ use tendermint::abci; async fn swap_and_swap_claim() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await? .apply_default_genesis() .await?; @@ -144,7 +144,7 @@ async fn swap_and_swap_claim() -> anyhow::Result<()> { async fn swap_claim_duplicate_nullifier_previous_transaction() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await .unwrap() .apply_default_genesis() @@ -270,7 +270,7 @@ async fn swap_claim_duplicate_nullifier_previous_transaction() { async fn swap_with_nonzero_fee() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_prefixes() + let storage = TempStorage::new_with_penumbra_sdk_prefixes() .await? .apply_default_genesis() .await?; diff --git a/crates/core/app/tests/view_server_can_be_served_on_localhost.rs b/crates/core/app/tests/view_server_can_be_served_on_localhost.rs index 4603aadf1c..afbbbd394a 100644 --- a/crates/core/app/tests/view_server_can_be_served_on_localhost.rs +++ b/crates/core/app/tests/view_server_can_be_served_on_localhost.rs @@ -3,22 +3,22 @@ use { anyhow::Context, cnidarium::TempStorage, common::TempStorageExt as _, - penumbra_app::{ + penumbra_sdk_app::{ genesis::{self, AppState}, server::consensus::Consensus, }, - penumbra_asset::STAKING_TOKEN_ASSET_ID, - penumbra_keys::{keys::AddressIndex, test_keys}, - penumbra_mock_client::MockClient, - penumbra_mock_consensus::TestNode, - penumbra_proto::{ + penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID, + penumbra_sdk_keys::{keys::AddressIndex, test_keys}, + penumbra_sdk_mock_client::MockClient, + penumbra_sdk_mock_consensus::TestNode, + penumbra_sdk_proto::{ view::v1::{ view_service_client::ViewServiceClient, view_service_server::ViewServiceServer, GasPricesRequest, StatusRequest, StatusResponse, }, DomainType, }, - penumbra_view::{Planner, SpendableNoteRecord, ViewClient}, + penumbra_sdk_view::{Planner, SpendableNoteRecord, ViewClient}, std::ops::Deref, tap::{Tap, TapFallible}, }; @@ -31,10 +31,10 @@ mod common; async fn view_server_can_be_served_on_localhost() -> 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_prefixes().await?; + let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; // Instantiate a mock tendermint proxy, which we will connect to the test node. - let proxy = penumbra_mock_tendermint_proxy::TestNodeProxy::new::(); + let proxy = penumbra_sdk_mock_tendermint_proxy::TestNodeProxy::new::(); // Start the test node. let mut test_node = { @@ -44,7 +44,7 @@ async fn view_server_can_be_served_on_localhost() -> anyhow::Result<()> { let consensus = Consensus::new(storage.as_ref().clone()); TestNode::builder() .single_validator() - .with_penumbra_auto_app_state(app_state)? + .with_penumbra_sdk_auto_app_state(app_state)? .on_block(proxy.on_block_callback()) .init_chain(consensus) .await @@ -71,7 +71,7 @@ async fn view_server_can_be_served_on_localhost() -> anyhow::Result<()> { // Spawn the server-side view server. { - let make_svc = penumbra_app::rpc::routes( + let make_svc = penumbra_sdk_app::rpc::routes( storage.as_ref(), proxy, false, /*enable_expensive_rpc*/ @@ -91,7 +91,7 @@ async fn view_server_can_be_served_on_localhost() -> anyhow::Result<()> { // Spawn the client-side view server... let view_server = { - penumbra_view::ViewServer::load_or_initialize( + penumbra_sdk_view::ViewServer::load_or_initialize( None::<&camino::Utf8Path>, None::<&camino::Utf8Path>, &*test_keys::FULL_VIEWING_KEY, @@ -167,7 +167,7 @@ async fn view_server_can_be_served_on_localhost() -> anyhow::Result<()> { // Check that the nullifiers were spent as a result of the transaction: for nf in tx.spent_nullifiers() { - use penumbra_sct::component::tree::SctRead as _; + use penumbra_sdk_sct::component::tree::SctRead as _; assert!(pre_tx_snapshot.spend_info(nf).await?.is_none()); assert!(post_tx_snapshot.spend_info(nf).await?.is_some()); } diff --git a/crates/core/asset/src/asset.rs b/crates/core/asset/src/asset.rs index 59745565eb..f40da0aa74 100644 --- a/crates/core/asset/src/asset.rs +++ b/crates/core/asset/src/asset.rs @@ -109,28 +109,28 @@ mod tests { #[test] fn test_displaydenom_format_value() { // with exponent 6, 1782000 formats to 1.782 - let penumbra_display_denom = REGISTRY.parse_unit("penumbra"); + let penumbra_sdk_display_denom = REGISTRY.parse_unit("penumbra"); assert_eq!( - penumbra_display_denom.format_value(1782000u64.into()), + penumbra_sdk_display_denom.format_value(1782000u64.into()), "1.782" ); assert_eq!( - penumbra_display_denom.format_value(6700001u64.into()), + penumbra_sdk_display_denom.format_value(6700001u64.into()), "6.700001" ); - assert_eq!(penumbra_display_denom.format_value(1u64.into()), "0.000001"); + assert_eq!(penumbra_sdk_display_denom.format_value(1u64.into()), "0.000001"); // with exponent 3, 1782000 formats to 1782 - let mpenumbra_display_denom = REGISTRY.parse_unit("mpenumbra"); + let mpenumbra_sdk_display_denom = REGISTRY.parse_unit("mpenumbra"); assert_eq!( - mpenumbra_display_denom.format_value(1782000u64.into()), + mpenumbra_sdk_display_denom.format_value(1782000u64.into()), "1782" ); // with exponent 0, 1782000 formats to 1782000 - let upenumbra_display_denom = REGISTRY.parse_unit("upenumbra"); + let upenumbra_sdk_display_denom = REGISTRY.parse_unit("upenumbra"); assert_eq!( - upenumbra_display_denom.format_value(1782000u64.into()), + upenumbra_sdk_display_denom.format_value(1782000u64.into()), "1782000" ); } @@ -166,28 +166,28 @@ mod tests { #[test] fn test_displaydenom_parse_value() { - let penumbra_display_denom = REGISTRY.parse_unit("penumbra"); - assert!(penumbra_display_denom.parse_value("1.2.3").is_err()); + let penumbra_sdk_display_denom = REGISTRY.parse_unit("penumbra"); + assert!(penumbra_sdk_display_denom.parse_value("1.2.3").is_err()); assert_eq!( - penumbra_display_denom.parse_value("1.782").unwrap(), + penumbra_sdk_display_denom.parse_value("1.782").unwrap(), 1782000u64.into() ); assert_eq!( - penumbra_display_denom.parse_value("6.700001").unwrap(), + penumbra_sdk_display_denom.parse_value("6.700001").unwrap(), 6700001u64.into() ); - let mpenumbra_display_denom = REGISTRY.parse_unit("mpenumbra"); + let mpenumbra_sdk_display_denom = REGISTRY.parse_unit("mpenumbra"); assert_eq!( - mpenumbra_display_denom.parse_value("1782").unwrap(), + mpenumbra_sdk_display_denom.parse_value("1782").unwrap(), 1782000u64.into() ); - assert!(mpenumbra_display_denom.parse_value("1782.0001").is_err()); + assert!(mpenumbra_sdk_display_denom.parse_value("1782.0001").is_err()); - let upenumbra_display_denom = REGISTRY.parse_unit("upenumbra"); + let upenumbra_sdk_display_denom = REGISTRY.parse_unit("upenumbra"); assert_eq!( - upenumbra_display_denom.parse_value("1782000").unwrap(), + upenumbra_sdk_display_denom.parse_value("1782000").unwrap(), 1782000u64.into() ); } @@ -204,14 +204,14 @@ mod tests { fn displaydenom_parsing_formatting_roundtrip( v: u128 ) { - let penumbra_display_denom = REGISTRY.parse_unit("penumbra"); - let formatted = penumbra_display_denom.format_value(v.into()); - let parsed = penumbra_display_denom.parse_value(&formatted); + let penumbra_sdk_display_denom = REGISTRY.parse_unit("penumbra"); + let formatted = penumbra_sdk_display_denom.format_value(v.into()); + let parsed = penumbra_sdk_display_denom.parse_value(&formatted); assert_eq!(v, u128::from(parsed.unwrap())); - let mpenumbra_display_denom = REGISTRY.parse_unit("mpenumbra"); - let formatted = mpenumbra_display_denom.format_value(v.into()); - let parsed = mpenumbra_display_denom.parse_value(&formatted); + let mpenumbra_sdk_display_denom = REGISTRY.parse_unit("mpenumbra"); + let formatted = mpenumbra_sdk_display_denom.format_value(v.into()); + let parsed = mpenumbra_sdk_display_denom.parse_value(&formatted); assert_eq!(v, u128::from(parsed.unwrap())); } } diff --git a/crates/core/asset/src/asset/denom.rs b/crates/core/asset/src/asset/denom.rs index b67fe90ccc..fd2f77fd8d 100644 --- a/crates/core/asset/src/asset/denom.rs +++ b/crates/core/asset/src/asset/denom.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{penumbra::core::asset::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// An asset denomination. /// diff --git a/crates/core/asset/src/asset/denom_metadata.rs b/crates/core/asset/src/asset/denom_metadata.rs index 8d67bcb756..7e11128c4a 100644 --- a/crates/core/asset/src/asset/denom_metadata.rs +++ b/crates/core/asset/src/asset/denom_metadata.rs @@ -7,8 +7,8 @@ use std::{ use anyhow::{ensure, Context}; use decaf377::Fq; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::asset::v1 as pb, view::v1::AssetsResponse, DomainType}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, view::v1::AssetsResponse, DomainType}; use regex::Regex; use serde::{Deserialize, Serialize}; @@ -63,7 +63,7 @@ impl From<&Inner> for pb::Metadata { display: inner.units[inner.display_index].denom.clone(), name: inner.name.clone(), symbol: inner.symbol.clone(), - penumbra_asset_id: Some(inner.id.into()), + penumbra_sdk_asset_id: Some(inner.id.into()), denom_units: inner.units.clone().into_iter().map(|x| x.into()).collect(), images: inner.images.clone(), badges: inner.badges.clone(), @@ -85,7 +85,7 @@ impl TryFrom for Inner { // Compute the ID from the base denom to ensure we don't get confused. let id = Id::from_raw_denom(&base_denom); // If the ID was supplied, we should check that it's consistent with the base denom. - if let Some(supplied_id) = value.penumbra_asset_id { + if let Some(supplied_id) = value.penumbra_sdk_asset_id { let supplied_id = Id::try_from(supplied_id)?; ensure!( id == supplied_id, @@ -225,7 +225,7 @@ impl Inner { let id = Id(Fq::from_le_bytes_mod_order( // XXX choice of hash function? blake2b_simd::Params::default() - .personal(b"Penumbra_AssetID") + .personal(b"penumbra_sdk_AssetID") .hash(base_denom.as_bytes()) .as_bytes(), )); diff --git a/crates/core/asset/src/asset/id.rs b/crates/core/asset/src/asset/id.rs index f02e63b270..09d8f9c09d 100644 --- a/crates/core/asset/src/asset/id.rs +++ b/crates/core/asset/src/asset/id.rs @@ -4,8 +4,8 @@ use ark_serialize::CanonicalDeserialize; use base64::Engine; use decaf377::Fq; use once_cell::sync::Lazy; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::asset::v1 as pb, serializers::bech32str, DomainType}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, serializers::bech32str, DomainType}; use serde::{Deserialize, Serialize}; /// An identifier for an IBC asset type. @@ -158,7 +158,7 @@ impl Id { Id(Fq::from_le_bytes_mod_order( // XXX choice of hash function? blake2b_simd::Params::default() - .personal(b"Penumbra_AssetID") + .personal(b"penumbra_sdk_AssetID") .hash(base_denom.as_bytes()) .as_bytes(), )) @@ -184,7 +184,7 @@ mod tests { let id2 = Id::from_str(&bech32m_id).expect("can decode valid asset id"); - use penumbra_proto::Message; + use penumbra_sdk_proto::Message; let proto = id.encode_to_vec(); let proto2 = pb::AssetId { diff --git a/crates/core/asset/src/balance.rs b/crates/core/asset/src/balance.rs index 8b8e290dba..983fbd460d 100644 --- a/crates/core/asset/src/balance.rs +++ b/crates/core/asset/src/balance.rs @@ -2,7 +2,7 @@ use anyhow::anyhow; use ark_r1cs_std::prelude::*; use ark_r1cs_std::uint8::UInt8; use ark_relations::r1cs::SynthesisError; -use penumbra_num::{Amount, AmountVar}; +use penumbra_sdk_num::{Amount, AmountVar}; use serde::{Deserialize, Serialize}; use std::{ collections::{btree_map, BTreeMap}, @@ -29,7 +29,7 @@ use decaf377::{r1cs::ElementVar, Fq, Fr}; use imbalance::{Imbalance, Sign}; use self::commitment::BalanceCommitmentVar; -use penumbra_proto::{penumbra::core::asset::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, DomainType}; /// A `Balance` is a "vector of [`Value`]s", where some values may be required, while others may be /// provided. For a transaction to be valid, its balance must be zero. @@ -470,7 +470,7 @@ mod test { use ark_ff::Zero; use decaf377::Fr; use once_cell::sync::Lazy; - use penumbra_proto::core::num::v1::Amount as ProtoAmount; + use penumbra_sdk_proto::core::num::v1::Amount as ProtoAmount; use proptest::prelude::*; use rand_core::OsRng; diff --git a/crates/core/asset/src/balance/commitment.rs b/crates/core/asset/src/balance/commitment.rs index e857b3479a..647cedb634 100644 --- a/crates/core/asset/src/balance/commitment.rs +++ b/crates/core/asset/src/balance/commitment.rs @@ -7,8 +7,8 @@ use decaf377::r1cs::ElementVar; use decaf377::Fq; use decaf377::Fr; use once_cell::sync::Lazy; -use penumbra_proto::penumbra::core::asset::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::penumbra::core::asset::v1 as pb; +use penumbra_sdk_proto::DomainType; use crate::value::ValueVar; use crate::Value; diff --git a/crates/core/asset/src/equivalent_value.rs b/crates/core/asset/src/equivalent_value.rs index 688f989c13..9092f0b8e9 100644 --- a/crates/core/asset/src/equivalent_value.rs +++ b/crates/core/asset/src/equivalent_value.rs @@ -1,6 +1,6 @@ use crate::asset::Metadata; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::asset::v1 as pb, DomainType}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// An equivalent value in terms of a different numeraire. diff --git a/crates/core/asset/src/estimated_price.rs b/crates/core/asset/src/estimated_price.rs index 6f8df75a2f..ecbc52f2a1 100644 --- a/crates/core/asset/src/estimated_price.rs +++ b/crates/core/asset/src/estimated_price.rs @@ -1,5 +1,5 @@ use crate::asset; -use penumbra_proto::{penumbra::core::asset::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// The estimated price of one asset in terms of another. diff --git a/crates/core/asset/src/value.rs b/crates/core/asset/src/value.rs index a8b6b1e9c9..c1b85e4b22 100644 --- a/crates/core/asset/src/value.rs +++ b/crates/core/asset/src/value.rs @@ -11,8 +11,8 @@ use std::{ }; use anyhow::Context; -use penumbra_num::{Amount, AmountVar}; -use penumbra_proto::{penumbra::core::asset::v1 as pb, DomainType}; +use penumbra_sdk_num::{Amount, AmountVar}; +use penumbra_sdk_proto::{penumbra::core::asset::v1 as pb, DomainType}; use regex::Regex; use serde::{Deserialize, Serialize}; @@ -498,7 +498,7 @@ mod tests { #[test] fn value_parsing_happy() { - let upenumbra_base_denom = crate::asset::Cache::with_known_assets() + let upenumbra_sdk_base_denom = crate::asset::Cache::with_known_assets() .get_unit("upenumbra") .unwrap() .base(); @@ -506,19 +506,19 @@ mod tests { .get_unit("unala") .unwrap() .base(); - let cache = [upenumbra_base_denom.clone(), nala_base_denom.clone()] + let cache = [upenumbra_sdk_base_denom.clone(), nala_base_denom.clone()] .into_iter() .collect::(); let v1: Value = "1823.298penumbra".parse().unwrap(); assert_eq!(v1.amount, 1823298000u64.into()); - assert_eq!(v1.asset_id, upenumbra_base_denom.id()); + assert_eq!(v1.asset_id, upenumbra_sdk_base_denom.id()); // Check that we can also parse the output of try_format assert_eq!(v1, v1.format(&cache).parse().unwrap()); let v2: Value = "3930upenumbra".parse().unwrap(); assert_eq!(v2.amount, 3930u64.into()); - assert_eq!(v2.asset_id, upenumbra_base_denom.id()); + assert_eq!(v2.asset_id, upenumbra_sdk_base_denom.id()); assert_eq!(v2, v2.format(&cache).parse().unwrap()); let v1: Value = "1unala".parse().unwrap(); @@ -535,11 +535,11 @@ mod tests { #[test] fn format_picks_best_unit() { - let upenumbra_base_denom = crate::asset::Cache::with_known_assets() + let upenumbra_sdk_base_denom = crate::asset::Cache::with_known_assets() .get_unit("upenumbra") .unwrap() .base(); - let cache = [upenumbra_base_denom].into_iter().collect::(); + let cache = [upenumbra_sdk_base_denom].into_iter().collect::(); let v1: Value = "999upenumbra".parse().unwrap(); let v2: Value = "1000upenumbra".parse().unwrap(); diff --git a/crates/core/component/auction/src/auction/dutch.rs b/crates/core/component/auction/src/auction/dutch.rs index 804fdef667..c0cbd70e75 100644 --- a/crates/core/component/auction/src/auction/dutch.rs +++ b/crates/core/component/auction/src/auction/dutch.rs @@ -1,10 +1,10 @@ use std::num::NonZeroU64; use anyhow::anyhow; -use penumbra_asset::{asset, Value}; -use penumbra_dex::lp::position::{self}; -use penumbra_num::Amount; -use penumbra_proto::{core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_dex::lp::position::{self}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::auction::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::auction::AuctionId; @@ -12,7 +12,7 @@ use crate::auction::AuctionId; pub mod actions; pub use actions::{ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdraw}; -pub const DUTCH_AUCTION_DOMAIN_SEP: &[u8] = b"penumbra_DA_nft"; +pub const DUTCH_AUCTION_DOMAIN_SEP: &[u8] = b"penumbra_sdk_DA_nft"; /// A deployed Dutch Auction, containing an immutable description /// and stateful data about its current state. diff --git a/crates/core/component/auction/src/auction/dutch/actions/end.rs b/crates/core/component/auction/src/auction/dutch/actions/end.rs index 8bc436c42c..1e29fd6f4c 100644 --- a/crates/core/component/auction/src/auction/dutch/actions/end.rs +++ b/crates/core/component/auction/src/auction/dutch/actions/end.rs @@ -1,7 +1,7 @@ use anyhow::anyhow; -use penumbra_asset::{Balance, Value}; -use penumbra_proto::{core::component::auction::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_proto::{core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::auction::{id::AuctionId, AuctionNft}; diff --git a/crates/core/component/auction/src/auction/dutch/actions/plan.rs b/crates/core/component/auction/src/auction/dutch/actions/plan.rs index dca1265ba1..f92ea08340 100644 --- a/crates/core/component/auction/src/auction/dutch/actions/plan.rs +++ b/crates/core/component/auction/src/auction/dutch/actions/plan.rs @@ -1,7 +1,7 @@ use ark_ff::Zero; use decaf377::Fr; -use penumbra_asset::{balance, Balance, Value}; -use penumbra_proto::{penumbra::core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_asset::{balance, Balance, Value}; +use penumbra_sdk_proto::{penumbra::core::component::auction::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::auction::{dutch::ActionDutchAuctionWithdraw, AuctionId, AuctionNft}; diff --git a/crates/core/component/auction/src/auction/dutch/actions/schedule.rs b/crates/core/component/auction/src/auction/dutch/actions/schedule.rs index 349371041f..1ae2163188 100644 --- a/crates/core/component/auction/src/auction/dutch/actions/schedule.rs +++ b/crates/core/component/auction/src/auction/dutch/actions/schedule.rs @@ -1,8 +1,8 @@ use crate::auction::{dutch::DutchAuctionDescription, nft::AuctionNft}; use anyhow::anyhow; -use penumbra_asset::{Balance, Value}; -use penumbra_proto::{core::component::auction::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_proto::{core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; /// The maximum amount of input/output in a Dutch auction description. diff --git a/crates/core/component/auction/src/auction/dutch/actions/view.rs b/crates/core/component/auction/src/auction/dutch/actions/view.rs index b1a3861750..a764a41e1c 100644 --- a/crates/core/component/auction/src/auction/dutch/actions/view.rs +++ b/crates/core/component/auction/src/auction/dutch/actions/view.rs @@ -6,8 +6,8 @@ use crate::auction::{ id::AuctionId, }; use anyhow::anyhow; -use penumbra_asset::ValueView; -use penumbra_proto::{core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_asset::ValueView; +use penumbra_sdk_proto::{core::component::auction::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /* Domain type definitions */ diff --git a/crates/core/component/auction/src/auction/dutch/actions/withdraw.rs b/crates/core/component/auction/src/auction/dutch/actions/withdraw.rs index 6266b8e836..555971689b 100644 --- a/crates/core/component/auction/src/auction/dutch/actions/withdraw.rs +++ b/crates/core/component/auction/src/auction/dutch/actions/withdraw.rs @@ -2,9 +2,9 @@ use crate::auction::{id::AuctionId, AuctionNft}; use anyhow::anyhow; use ark_ff::Zero; use decaf377_rdsa::Fr; -use penumbra_asset::{balance, Balance, Value}; -use penumbra_proto::{core::component::auction::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{balance, Balance, Value}; +use penumbra_sdk_proto::{core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/crates/core/component/auction/src/auction/id.rs b/crates/core/component/auction/src/auction/id.rs index 767b6ffc1f..5b561a8531 100644 --- a/crates/core/component/auction/src/auction/id.rs +++ b/crates/core/component/auction/src/auction/id.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Context}; -use penumbra_proto::{ +use penumbra_sdk_proto::{ penumbra::core::component::auction::v1 as pb, serializers::bech32str, DomainType, }; use serde::{Deserialize, Serialize}; diff --git a/crates/core/component/auction/src/auction/nft.rs b/crates/core/component/auction/src/auction/nft.rs index f5dc11d22a..a324c04c51 100644 --- a/crates/core/component/auction/src/auction/nft.rs +++ b/crates/core/component/auction/src/auction/nft.rs @@ -1,7 +1,7 @@ use crate::auction::id::AuctionId; use anyhow::{anyhow, Result}; -use penumbra_asset::asset::{self, Metadata}; -use penumbra_proto::{core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_asset::asset::{self, Metadata}; +use penumbra_sdk_proto::{core::component::auction::v1 as pb, DomainType}; use regex::Regex; /// An non-fungible token (NFT) tracking the state and ownership of an auction. diff --git a/crates/core/component/auction/src/component/action_handler/dutch/end.rs b/crates/core/component/auction/src/component/action_handler/dutch/end.rs index 529ea7e853..a20ee84ede 100644 --- a/crates/core/component/auction/src/component/action_handler/dutch/end.rs +++ b/crates/core/component/auction/src/component/action_handler/dutch/end.rs @@ -2,7 +2,7 @@ use anyhow::{ensure, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_proto::StateWriteProto; +use penumbra_sdk_proto::StateWriteProto; use tracing::instrument; use crate::auction::dutch::ActionDutchAuctionEnd; diff --git a/crates/core/component/auction/src/component/action_handler/dutch/schedule.rs b/crates/core/component/auction/src/component/action_handler/dutch/schedule.rs index 2652a0e7f6..03ea6f1356 100644 --- a/crates/core/component/auction/src/component/action_handler/dutch/schedule.rs +++ b/crates/core/component/auction/src/component/action_handler/dutch/schedule.rs @@ -5,8 +5,8 @@ use anyhow::{ensure, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_num::Amount; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_num::Amount; +use penumbra_sdk_sct::component::clock::EpochRead; use crate::auction::dutch::ActionDutchAuctionSchedule; use crate::component::DutchAuctionManager; diff --git a/crates/core/component/auction/src/component/auction.rs b/crates/core/component/auction/src/component/auction.rs index 2bf431db16..5e3bbc0abf 100644 --- a/crates/core/component/auction/src/component/auction.rs +++ b/crates/core/component/auction/src/component/auction.rs @@ -4,11 +4,11 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use cnidarium_component::Component; -use penumbra_asset::asset; -use penumbra_asset::Value; -use penumbra_num::Amount; -use penumbra_proto::StateReadProto; -use penumbra_proto::StateWriteProto; +use penumbra_sdk_asset::asset; +use penumbra_sdk_asset::Value; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::StateReadProto; +use penumbra_sdk_proto::StateWriteProto; use std::sync::Arc; use tap::Tap; use tendermint::v0_37::abci; diff --git a/crates/core/component/auction/src/component/auction_store.rs b/crates/core/component/auction/src/component/auction_store.rs index 75301a170b..2ed645f694 100644 --- a/crates/core/component/auction/src/component/auction_store.rs +++ b/crates/core/component/auction/src/component/auction_store.rs @@ -2,10 +2,10 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateRead; use pbjson_types::Any; -use penumbra_proto::core::component::auction::v1 as pb; -use penumbra_proto::DomainType; -use penumbra_proto::Name; -use penumbra_proto::StateReadProto; +use penumbra_sdk_proto::core::component::auction::v1 as pb; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_proto::Name; +use penumbra_sdk_proto::StateReadProto; use crate::{ auction::{dutch::DutchAuction, id::AuctionId}, diff --git a/crates/core/component/auction/src/component/dutch_auction.rs b/crates/core/component/auction/src/component/dutch_auction.rs index a91c501b31..f6b49458b7 100644 --- a/crates/core/component/auction/src/component/dutch_auction.rs +++ b/crates/core/component/auction/src/component/dutch_auction.rs @@ -11,15 +11,15 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::StreamExt; -use penumbra_asset::{Balance, Value}; -use penumbra_dex::component::{PositionManager, PositionRead, StateReadExt as _}; -use penumbra_dex::lp::position::{self, Position}; -use penumbra_dex::lp::Reserves; -use penumbra_dex::DirectedTradingPair; -use penumbra_num::Amount; -use penumbra_proto::core::component::auction::v1 as pb; -use penumbra_proto::StateWriteProto; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_dex::component::{PositionManager, PositionRead, StateReadExt as _}; +use penumbra_sdk_dex::lp::position::{self, Position}; +use penumbra_sdk_dex::lp::Reserves; +use penumbra_sdk_dex::DirectedTradingPair; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::auction::v1 as pb; +use penumbra_sdk_proto::StateWriteProto; +use penumbra_sdk_sct::component::clock::EpochRead; use prost::{Message, Name}; use tracing::instrument; @@ -456,7 +456,7 @@ pub(crate) trait DutchAuctionData: StateRead { &self, trigger_height: u64, ) -> Pin + Send + 'static>> { - use penumbra_proto::StateReadProto; + use penumbra_sdk_proto::StateReadProto; let prefix_key = state_key::dutch::trigger::by_height(trigger_height) .as_bytes() .to_vec(); diff --git a/crates/core/component/auction/src/component/metrics.rs b/crates/core/component/auction/src/component/metrics.rs index 3d73682b5f..bf7cc1df9f 100644 --- a/crates/core/component/auction/src/component/metrics.rs +++ b/crates/core/component/auction/src/component/metrics.rs @@ -22,4 +22,4 @@ pub fn register_metrics() { // ); } -// pub const SOMETHING_TO_MEASURE: &str = "penumbra_auction_something_to_measure"; +// pub const SOMETHING_TO_MEASURE: &str = "penumbra_sdk_auction_something_to_measure"; diff --git a/crates/core/component/auction/src/component/rpc.rs b/crates/core/component/auction/src/component/rpc.rs index 203266006c..4a8626830f 100755 --- a/crates/core/component/auction/src/component/rpc.rs +++ b/crates/core/component/auction/src/component/rpc.rs @@ -1,7 +1,7 @@ #![allow(unused)] // TODO: remove this when filling in the RPCs -use penumbra_dex::{component::PositionRead, lp::position}; -use penumbra_proto::{ +use penumbra_sdk_dex::{component::PositionRead, lp::position}; +use penumbra_sdk_proto::{ core::component::auction::v1 as pb, core::component::auction::v1::{ query_service_server::QueryService, AuctionStateByIdRequest, AuctionStateByIdResponse, @@ -12,7 +12,7 @@ use penumbra_proto::{ use async_stream::try_stream; use futures::{StreamExt, TryStreamExt}; -use penumbra_proto::Message; +use penumbra_sdk_proto::Message; use prost::Name; use std::pin::Pin; use tonic::Status; diff --git a/crates/core/component/auction/src/event.rs b/crates/core/component/auction/src/event.rs index 5463856c47..495c715ce0 100644 --- a/crates/core/component/auction/src/event.rs +++ b/crates/core/component/auction/src/event.rs @@ -1,8 +1,8 @@ use crate::auction::dutch::{DutchAuctionDescription, DutchAuctionState}; use crate::auction::AuctionId; -use penumbra_asset::asset; -use penumbra_num::Amount; -use penumbra_proto::penumbra::core::component::auction::v1 as pb; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::penumbra::core::component::auction::v1 as pb; /// Event for a Dutch auction that has been scheduled. pub fn dutch_auction_schedule_event( diff --git a/crates/core/component/auction/src/genesis.rs b/crates/core/component/auction/src/genesis.rs index 52f78277d5..82da0e7ce2 100644 --- a/crates/core/component/auction/src/genesis.rs +++ b/crates/core/component/auction/src/genesis.rs @@ -2,7 +2,7 @@ use crate::params::AuctionParameters; use anyhow::Context; use serde::{Deserialize, Serialize}; -use penumbra_proto::{penumbra::core::component::auction::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::auction::v1 as pb, DomainType}; #[derive(Deserialize, Serialize, Debug, Clone, Default)] #[serde(try_from = "pb::GenesisContent", into = "pb::GenesisContent")] diff --git a/crates/core/component/auction/src/params.rs b/crates/core/component/auction/src/params.rs index dded262c56..7270d7decc 100644 --- a/crates/core/component/auction/src/params.rs +++ b/crates/core/component/auction/src/params.rs @@ -1,5 +1,5 @@ -use penumbra_proto::core::component::auction::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::core::component::auction::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/auction/src/state_key.rs b/crates/core/component/auction/src/state_key.rs index 7a3f70ce93..e349b877e4 100644 --- a/crates/core/component/auction/src/state_key.rs +++ b/crates/core/component/auction/src/state_key.rs @@ -9,7 +9,7 @@ pub mod parameters { } pub mod value_balance { - use penumbra_asset::asset; + use penumbra_sdk_asset::asset; #[allow(dead_code)] // For some reason, this shows up as unused pub fn prefix() -> &'static str { diff --git a/crates/core/component/community-pool/src/action/community_pool_deposit.rs b/crates/core/component/community-pool/src/action/community_pool_deposit.rs index 5208cd829d..3c5f1a01fa 100644 --- a/crates/core/component/community-pool/src/action/community_pool_deposit.rs +++ b/crates/core/component/community-pool/src/action/community_pool_deposit.rs @@ -1,11 +1,11 @@ use anyhow::{Context, Error}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use std::convert::{TryFrom, TryInto}; -use penumbra_asset::{Balance, Value}; +use penumbra_sdk_asset::{Balance, Value}; // TODO: why are the CommunityPool actions not in the Community Pool protos? -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde( diff --git a/crates/core/component/community-pool/src/action/community_pool_output.rs b/crates/core/component/community-pool/src/action/community_pool_output.rs index e44721a424..de2d0fc4b3 100644 --- a/crates/core/component/community-pool/src/action/community_pool_output.rs +++ b/crates/core/component/community-pool/src/action/community_pool_output.rs @@ -2,10 +2,10 @@ use anyhow::{Context, Error}; use serde::{Deserialize, Serialize}; use std::convert::{TryFrom, TryInto}; -use penumbra_asset::{Balance, Value}; -use penumbra_keys::Address; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(try_from = "pb::CommunityPoolOutput", into = "pb::CommunityPoolOutput")] diff --git a/crates/core/component/community-pool/src/action/community_pool_spend.rs b/crates/core/component/community-pool/src/action/community_pool_spend.rs index 0e0fa3a06f..bef155868f 100644 --- a/crates/core/component/community-pool/src/action/community_pool_spend.rs +++ b/crates/core/component/community-pool/src/action/community_pool_spend.rs @@ -2,9 +2,9 @@ use anyhow::{Context, Error}; use serde::{Deserialize, Serialize}; use std::convert::TryFrom; -use penumbra_asset::{Balance, Value}; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(try_from = "pb::CommunityPoolSpend", into = "pb::CommunityPoolSpend")] diff --git a/crates/core/component/community-pool/src/component/action_handler/community_pool_output.rs b/crates/core/component/community-pool/src/component/action_handler/community_pool_output.rs index e0259bab4b..4accebfd7a 100644 --- a/crates/core/component/community-pool/src/component/action_handler/community_pool_output.rs +++ b/crates/core/component/community-pool/src/component/action_handler/community_pool_output.rs @@ -2,8 +2,8 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_sct::CommitmentSource; -use penumbra_shielded_pool::component::NoteManager; +use penumbra_sdk_sct::CommitmentSource; +use penumbra_sdk_shielded_pool::component::NoteManager; use crate::CommunityPoolOutput; diff --git a/crates/core/component/community-pool/src/component/state_key.rs b/crates/core/component/community-pool/src/component/state_key.rs index 593be88f2d..2a60f36bdb 100644 --- a/crates/core/component/community-pool/src/component/state_key.rs +++ b/crates/core/component/community-pool/src/component/state_key.rs @@ -1,4 +1,4 @@ -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; pub fn community_pool_params() -> &'static str { "community_pool/params" diff --git a/crates/core/component/community-pool/src/component/view.rs b/crates/core/component/community-pool/src/component/view.rs index c36cb3d928..bb0e1f8262 100644 --- a/crates/core/component/community-pool/src/component/view.rs +++ b/crates/core/component/community-pool/src/component/view.rs @@ -5,9 +5,9 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::{StreamExt, TryStreamExt}; -use penumbra_asset::{asset, Value}; -use penumbra_num::Amount; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use crate::params::CommunityPoolParameters; diff --git a/crates/core/component/community-pool/src/genesis.rs b/crates/core/component/community-pool/src/genesis.rs index 1b5f5b159d..ae828576fc 100644 --- a/crates/core/component/community-pool/src/genesis.rs +++ b/crates/core/component/community-pool/src/genesis.rs @@ -1,6 +1,6 @@ use anyhow::Context; -use penumbra_asset::{Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_proto::{penumbra::core::component::community_pool::v1 as pb, DomainType}; +use penumbra_sdk_asset::{Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_proto::{penumbra::core::component::community_pool::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::CommunityPoolParameters; diff --git a/crates/core/component/community-pool/src/params.rs b/crates/core/component/community-pool/src/params.rs index 25a61b5be8..0e793b4fd3 100644 --- a/crates/core/component/community-pool/src/params.rs +++ b/crates/core/component/community-pool/src/params.rs @@ -1,5 +1,5 @@ -use penumbra_proto::core::component::community_pool::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::core::component::community_pool::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/compact-block/src/compact_block.rs b/crates/core/component/compact-block/src/compact_block.rs index 0e5a8d2d2b..9051212f1e 100644 --- a/crates/core/component/compact-block/src/compact_block.rs +++ b/crates/core/component/compact-block/src/compact_block.rs @@ -1,15 +1,15 @@ use std::{collections::BTreeMap, convert::TryFrom}; use anyhow::Result; -use penumbra_dex::{BatchSwapOutputData, TradingPair}; -use penumbra_fee::GasPrices; -use penumbra_proto::{ +use penumbra_sdk_dex::{BatchSwapOutputData, TradingPair}; +use penumbra_sdk_fee::GasPrices; +use penumbra_sdk_proto::{ core::component::compact_block::v1::CompactBlockRangeResponse, penumbra::core::component::compact_block::v1 as pb, DomainType, }; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::fmd; -use penumbra_tct::builder::{block, epoch}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::fmd; +use penumbra_sdk_tct::builder::{block, epoch}; use serde::{Deserialize, Serialize}; use super::StatePayload; diff --git a/crates/core/component/compact-block/src/component/manager.rs b/crates/core/component/compact-block/src/component/manager.rs index 2d38177ebe..607b0e303f 100644 --- a/crates/core/component/compact-block/src/component/manager.rs +++ b/crates/core/component/compact-block/src/component/manager.rs @@ -2,13 +2,13 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; #[cfg(feature = "component")] -use penumbra_dex::component::SwapDataRead; -use penumbra_fee::component::StateReadExt as _; -use penumbra_governance::StateReadExt as _; -use penumbra_proto::DomainType; -use penumbra_sct::component::clock::EpochRead; -use penumbra_sct::component::tree::{SctManager as _, SctRead}; -use penumbra_shielded_pool::component::NoteManager as _; +use penumbra_sdk_dex::component::SwapDataRead; +use penumbra_sdk_fee::component::StateReadExt as _; +use penumbra_sdk_governance::StateReadExt as _; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_sct::component::tree::{SctManager as _, SctRead}; +use penumbra_sdk_shielded_pool::component::NoteManager as _; use tracing::instrument; use crate::{state_key, CompactBlock}; @@ -32,7 +32,7 @@ impl CompactBlockManager for T {} trait Inner: StateWrite { #[instrument(skip_all)] async fn finalize_compact_block(&mut self, end_epoch: bool) -> Result<()> { - use penumbra_shielded_pool::component::StateReadExt as _; + use penumbra_sdk_shielded_pool::component::StateReadExt as _; // Find out what our block height is (this is set even during the genesis block) let height = self .get_block_height() @@ -51,7 +51,7 @@ trait Inner: StateWrite { app_parameters_updated = app_parameters_updated || height == 0; // Check to see if the gas prices have changed, and include them in the compact block - // if they have (this is signaled by `penumbra_fee::StateWriteExt::put_gas_prices`): + // if they have (this is signaled by `penumbra_sdk_fee::StateWriteExt::put_gas_prices`): let (gas_prices, alt_gas_prices) = if self.gas_prices_changed() || height == 0 { ( Some( diff --git a/crates/core/component/compact-block/src/component/rpc.rs b/crates/core/component/compact-block/src/component/rpc.rs index b277e3a6bf..0f70ff112c 100644 --- a/crates/core/component/compact-block/src/component/rpc.rs +++ b/crates/core/component/compact-block/src/component/rpc.rs @@ -3,11 +3,11 @@ use std::pin::Pin; use anyhow::bail; use cnidarium::Storage; use futures::{StreamExt, TryFutureExt, TryStreamExt}; -use penumbra_proto::core::component::compact_block::v1::{ +use penumbra_sdk_proto::core::component::compact_block::v1::{ query_service_server::QueryService, CompactBlock, CompactBlockRangeRequest, CompactBlockRangeResponse, CompactBlockRequest, CompactBlockResponse, }; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_sct::component::clock::EpochRead; use tokio::sync::mpsc; use tonic::Status; use tracing::{instrument, Instrument}; diff --git a/crates/core/component/compact-block/src/component/view.rs b/crates/core/component/compact-block/src/component/view.rs index 431ccf1f44..907a95d759 100644 --- a/crates/core/component/compact-block/src/component/view.rs +++ b/crates/core/component/compact-block/src/component/view.rs @@ -6,14 +6,14 @@ use async_trait::async_trait; use cnidarium::StateRead; use futures::Stream; use futures::StreamExt; -use penumbra_proto::{penumbra::core::component::compact_block::v1::CompactBlock, Message}; +use penumbra_sdk_proto::{penumbra::core::component::compact_block::v1::CompactBlock, Message}; use std::pin::Pin; #[async_trait] pub trait StateReadExt: StateRead { /// Returns a stream of [`CompactBlock`]s starting from `start_height`. /// - /// Note: this method returns the proto type from `penumbra_proto`, rather + /// Note: this method returns the proto type from `penumbra_sdk_proto`, rather /// than deserializing into the domain type, because the primary use is in /// serving RPC requests, where the proto type will be re-serialized and /// sent to clients. @@ -38,7 +38,7 @@ pub trait StateReadExt: StateRead { /// Returns a single [`CompactBlock`] at the given `height`. /// - /// Note: this method returns the proto type from `penumbra_proto`, rather + /// Note: this method returns the proto type from `penumbra_sdk_proto`, rather /// than deserializing into the domain type, because the primary use is in /// serving RPC requests, where the proto type will be re-serialized and /// sent to clients. diff --git a/crates/core/component/compact-block/src/state_payload.rs b/crates/core/component/compact-block/src/state_payload.rs index a249dd3037..f400b789da 100644 --- a/crates/core/component/compact-block/src/state_payload.rs +++ b/crates/core/component/compact-block/src/state_payload.rs @@ -1,13 +1,13 @@ use std::convert::TryFrom; use anyhow::{Context, Result}; -use penumbra_dex::swap::SwapPayload; -use penumbra_proto::penumbra::core::component::compact_block::v1::{self as pb}; -use penumbra_shielded_pool::{note, NotePayload}; +use penumbra_sdk_dex::swap::SwapPayload; +use penumbra_sdk_proto::penumbra::core::component::compact_block::v1::{self as pb}; +use penumbra_sdk_shielded_pool::{note, NotePayload}; use serde::{Deserialize, Serialize}; -use penumbra_sct::CommitmentSource; +use penumbra_sdk_sct::CommitmentSource; /// A note payload annotated with the source of the note. #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/crates/core/component/dex/src/batch_swap_output_data.rs b/crates/core/component/dex/src/batch_swap_output_data.rs index 33afb327f5..90df57723b 100644 --- a/crates/core/component/dex/src/batch_swap_output_data.rs +++ b/crates/core/component/dex/src/batch_swap_output_data.rs @@ -7,12 +7,12 @@ use ark_r1cs_std::{ }; use ark_relations::r1cs::{ConstraintSystemRef, SynthesisError}; use decaf377::{r1cs::FqVar, Fq}; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; -use penumbra_tct::Position; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_tct::Position; use serde::{Deserialize, Serialize}; -use penumbra_num::fixpoint::{bit_constrain, U128x128, U128x128Var}; -use penumbra_num::{Amount, AmountVar}; +use penumbra_sdk_num::fixpoint::{bit_constrain, U128x128, U128x128Var}; +use penumbra_sdk_num::{Amount, AmountVar}; use crate::TradingPairVar; @@ -346,8 +346,8 @@ mod tests { use ark_relations::r1cs::ConstraintSynthesizer; use ark_snark::SNARK; use decaf377::Bls12_377; - use penumbra_asset::asset; - use penumbra_proof_params::{generate_test_parameters, DummyWitness}; + use penumbra_sdk_asset::asset; + use penumbra_sdk_proof_params::{generate_test_parameters, DummyWitness}; use rand_core::OsRng; use super::*; diff --git a/crates/core/component/dex/src/candlestick.rs b/crates/core/component/dex/src/candlestick.rs index 6ff7a7a013..366202dca4 100644 --- a/crates/core/component/dex/src/candlestick.rs +++ b/crates/core/component/dex/src/candlestick.rs @@ -1,7 +1,7 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use penumbra_proto::{core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::component::dex::v1 as pb, DomainType}; #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] #[serde(try_from = "pb::CandlestickData", into = "pb::CandlestickData")] diff --git a/crates/core/component/dex/src/component/action_handler/position/close.rs b/crates/core/component/dex/src/component/action_handler/position/close.rs index a13d8d8764..143b88ed0b 100644 --- a/crates/core/component/dex/src/component/action_handler/position/close.rs +++ b/crates/core/component/dex/src/component/action_handler/position/close.rs @@ -2,7 +2,7 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_proto::{DomainType as _, StateWriteProto as _}; +use penumbra_sdk_proto::{DomainType as _, StateWriteProto as _}; use crate::{component::PositionManager, event, lp::action::PositionClose}; diff --git a/crates/core/component/dex/src/component/action_handler/swap.rs b/crates/core/component/dex/src/component/action_handler/swap.rs index 8b69289ba0..1ca8de7fda 100644 --- a/crates/core/component/dex/src/component/action_handler/swap.rs +++ b/crates/core/component/dex/src/component/action_handler/swap.rs @@ -4,9 +4,9 @@ use anyhow::{ensure, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_proof_params::SWAP_PROOF_VERIFICATION_KEY; -use penumbra_proto::{DomainType as _, StateWriteProto}; -use penumbra_sct::component::source::SourceContext; +use penumbra_sdk_proof_params::SWAP_PROOF_VERIFICATION_KEY; +use penumbra_sdk_proto::{DomainType as _, StateWriteProto}; +use penumbra_sdk_sct::component::source::SourceContext; use crate::{ component::{InternalDexWrite, StateReadExt, SwapDataWrite, SwapManager}, diff --git a/crates/core/component/dex/src/component/action_handler/swap_claim.rs b/crates/core/component/dex/src/component/action_handler/swap_claim.rs index cf5408f305..4b83ee9e7e 100644 --- a/crates/core/component/dex/src/component/action_handler/swap_claim.rs +++ b/crates/core/component/dex/src/component/action_handler/swap_claim.rs @@ -3,17 +3,17 @@ use std::sync::Arc; use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium_component::ActionHandler; -use penumbra_txhash::TransactionContext; +use penumbra_sdk_txhash::TransactionContext; use cnidarium::{StateRead, StateWrite}; -use penumbra_proof_params::SWAPCLAIM_PROOF_VERIFICATION_KEY; -use penumbra_proto::{DomainType as _, StateWriteProto}; -use penumbra_sct::component::{ +use penumbra_sdk_proof_params::SWAPCLAIM_PROOF_VERIFICATION_KEY; +use penumbra_sdk_proto::{DomainType as _, StateWriteProto}; +use penumbra_sdk_sct::component::{ source::SourceContext, tree::{SctManager, VerificationExt}, StateReadExt as _, }; -use penumbra_shielded_pool::component::NoteManager; +use penumbra_sdk_shielded_pool::component::NoteManager; use crate::{ component::StateReadExt, diff --git a/crates/core/component/dex/src/component/arb.rs b/crates/core/component/dex/src/component/arb.rs index c6618d5756..2e3e9a00f7 100644 --- a/crates/core/component/dex/src/component/arb.rs +++ b/crates/core/component/dex/src/component/arb.rs @@ -4,9 +4,9 @@ use crate::component::{metrics, StateReadExt}; use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateDelta, StateWrite}; -use penumbra_asset::{asset, Value}; -use penumbra_proto::{DomainType as _, StateWriteProto as _}; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_proto::{DomainType as _, StateWriteProto as _}; +use penumbra_sdk_sct::component::clock::EpochRead; use tracing::instrument; use crate::{ diff --git a/crates/core/component/dex/src/component/chandelier.rs b/crates/core/component/dex/src/component/chandelier.rs index 27281a03a1..f36a09b857 100644 --- a/crates/core/component/dex/src/component/chandelier.rs +++ b/crates/core/component/dex/src/component/chandelier.rs @@ -3,9 +3,9 @@ use anyhow::{Context as _, Result}; use cnidarium::{StateRead, StateWrite}; use futures::{StreamExt, TryStreamExt as _}; -use penumbra_num::fixpoint::U128x128; -use penumbra_proto::{DomainType, StateReadProto, StateWriteProto}; -use penumbra_sct::component::clock::EpochRead as _; +use penumbra_sdk_num::fixpoint::U128x128; +use penumbra_sdk_proto::{DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::component::clock::EpochRead as _; use tonic::async_trait; use crate::event::EventCandlestickData; @@ -272,8 +272,8 @@ mod tests { use cnidarium::{ArcStateDeltaExt as _, StateDelta, TempStorage}; use cnidarium_component::Component as _; - use penumbra_asset::asset; - use penumbra_sct::{component::clock::EpochManager as _, epoch::Epoch}; + use penumbra_sdk_asset::asset; + use penumbra_sdk_sct::{component::clock::EpochManager as _, epoch::Epoch}; use tendermint::abci; use crate::{ @@ -298,7 +298,7 @@ mod tests { state_tx.put_block_height(0); state_tx.put_epoch_by_height( 0, - penumbra_sct::epoch::Epoch { + penumbra_sdk_sct::epoch::Epoch { index: 0, start_height: 0, }, diff --git a/crates/core/component/dex/src/component/circuit_breaker/value.rs b/crates/core/component/dex/src/component/circuit_breaker/value.rs index bbe9785bad..b8d150e0a6 100644 --- a/crates/core/component/dex/src/component/circuit_breaker/value.rs +++ b/crates/core/component/dex/src/component/circuit_breaker/value.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Result}; use cnidarium::{StateRead, StateWrite}; -use penumbra_asset::{asset, Value}; -use penumbra_num::Amount; -use penumbra_proto::{DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{DomainType, StateReadProto, StateWriteProto}; use tonic::async_trait; use tracing::instrument; @@ -97,12 +97,12 @@ mod tests { use crate::{BatchSwapOutputData, PositionOpen}; use cnidarium::{ArcStateDeltaExt as _, StateDelta, TempStorage}; use cnidarium_component::ActionHandler as _; - use penumbra_asset::asset; - use penumbra_num::Amount; - use penumbra_proto::StateWriteProto as _; - use penumbra_sct::component::clock::EpochManager as _; - use penumbra_sct::component::source::SourceContext as _; - use penumbra_sct::epoch::Epoch; + use penumbra_sdk_asset::asset; + use penumbra_sdk_num::Amount; + use penumbra_sdk_proto::StateWriteProto as _; + use penumbra_sdk_sct::component::clock::EpochManager as _; + use penumbra_sdk_sct::component::source::SourceContext as _; + use penumbra_sdk_sct::epoch::Epoch; use super::*; diff --git a/crates/core/component/dex/src/component/dex.rs b/crates/core/component/dex/src/component/dex.rs index 816a79f965..ddb7c86d3e 100644 --- a/crates/core/component/dex/src/component/dex.rs +++ b/crates/core/component/dex/src/component/dex.rs @@ -5,12 +5,12 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use cnidarium_component::Component; -use penumbra_asset::asset; -use penumbra_asset::{Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_fee::component::StateWriteExt as _; -use penumbra_fee::Fee; -use penumbra_num::Amount; -use penumbra_proto::{DomainType as _, StateReadProto, StateWriteProto}; +use penumbra_sdk_asset::asset; +use penumbra_sdk_asset::{Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_fee::component::StateWriteExt as _; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{DomainType as _, StateReadProto, StateWriteProto}; use tendermint::v0_37::abci; use tracing::instrument; diff --git a/crates/core/component/dex/src/component/flow.rs b/crates/core/component/dex/src/component/flow.rs index cda0a36abe..13a5e329d8 100644 --- a/crates/core/component/dex/src/component/flow.rs +++ b/crates/core/component/dex/src/component/flow.rs @@ -1,6 +1,6 @@ use std::ops::{Deref, DerefMut}; -use penumbra_num::Amount; +use penumbra_sdk_num::Amount; // Tuple represents: // ((amount of asset 1 being exchanged for asset 2), diff --git a/crates/core/component/dex/src/component/metrics.rs b/crates/core/component/dex/src/component/metrics.rs index c894307077..615468d20d 100644 --- a/crates/core/component/dex/src/component/metrics.rs +++ b/crates/core/component/dex/src/component/metrics.rs @@ -70,14 +70,14 @@ const GENERIC_DEX_BUCKETS: &[f64; 16] = &[ 0.06786044041, ]; -pub const DEX_PATH_SEARCH_DURATION: &str = "penumbra_dex_path_search_duration_seconds"; +pub const DEX_PATH_SEARCH_DURATION: &str = "penumbra_sdk_dex_path_search_duration_seconds"; pub const DEX_PATH_SEARCH_RELAX_PATH_DURATION: &str = - "penumbra_dex_path_search_relax_path_duration_seconds"; -pub const DEX_ROUTE_FILL_DURATION: &str = "penumbra_dex_route_fill_duration_seconds"; -pub const DEX_ARB_DURATION: &str = "penumbra_dex_arb_duration_seconds"; -pub const DEX_BATCH_DURATION: &str = "penumbra_dex_batch_duration_seconds"; + "penumbra_sdk_dex_path_search_relax_path_duration_seconds"; +pub const DEX_ROUTE_FILL_DURATION: &str = "penumbra_sdk_dex_route_fill_duration_seconds"; +pub const DEX_ARB_DURATION: &str = "penumbra_sdk_dex_arb_duration_seconds"; +pub const DEX_BATCH_DURATION: &str = "penumbra_sdk_dex_batch_duration_seconds"; pub const DEX_RPC_SIMULATE_TRADE_DURATION: &str = - "penumbra_dex_rpc_simulate_trade_duration_seconds"; + "penumbra_sdk_dex_rpc_simulate_trade_duration_seconds"; /// An extension trait providing DEX-related interfaces for [`PrometheusBuilder`]. /// diff --git a/crates/core/component/dex/src/component/position_manager.rs b/crates/core/component/dex/src/component/position_manager.rs index 5858f185c8..2f27ada402 100644 --- a/crates/core/component/dex/src/component/position_manager.rs +++ b/crates/core/component/dex/src/component/position_manager.rs @@ -7,9 +7,9 @@ use async_trait::async_trait; use cnidarium::{EscapedByteSlice, StateRead, StateWrite}; use futures::Stream; use futures::StreamExt; -use penumbra_asset::{asset, Balance}; -use penumbra_proto::DomainType; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_asset::{asset, Balance}; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use tap::Tap; use tracing::instrument; diff --git a/crates/core/component/dex/src/component/position_manager/base_liquidity_index.rs b/crates/core/component/dex/src/component/position_manager/base_liquidity_index.rs index 5e8b8ffaa3..4677ea1064 100644 --- a/crates/core/component/dex/src/component/position_manager/base_liquidity_index.rs +++ b/crates/core/component/dex/src/component/position_manager/base_liquidity_index.rs @@ -1,6 +1,6 @@ use anyhow::Result; use cnidarium::StateWrite; -use penumbra_num::Amount; +use penumbra_sdk_num::Amount; use position::State::*; use tracing::instrument; @@ -8,7 +8,7 @@ use crate::lp::position::{self, Position}; use crate::state_key::engine; use crate::DirectedTradingPair; use async_trait::async_trait; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; #[async_trait] pub(crate) trait AssetByLiquidityIndex: StateWrite { diff --git a/crates/core/component/dex/src/component/position_manager/counter.rs b/crates/core/component/dex/src/component/position_manager/counter.rs index 67ffad31af..115e2cc579 100644 --- a/crates/core/component/dex/src/component/position_manager/counter.rs +++ b/crates/core/component/dex/src/component/position_manager/counter.rs @@ -96,7 +96,7 @@ impl Inner for T {} #[allow(unused_imports)] mod tests { use cnidarium::{StateDelta, StateWrite, TempStorage}; - use penumbra_asset::{asset::REGISTRY, Value}; + use penumbra_sdk_asset::{asset::REGISTRY, Value}; use crate::component::position_manager::counter::{ Inner, PositionCounter, PositionCounterRead, diff --git a/crates/core/component/dex/src/component/position_manager/price_index.rs b/crates/core/component/dex/src/component/position_manager/price_index.rs index ac373e9851..a0452fae04 100644 --- a/crates/core/component/dex/src/component/position_manager/price_index.rs +++ b/crates/core/component/dex/src/component/position_manager/price_index.rs @@ -1,5 +1,5 @@ use cnidarium::StateWrite; -use penumbra_proto::StateWriteProto; +use penumbra_sdk_proto::StateWriteProto; use crate::{ lp::position::{self, Position}, diff --git a/crates/core/component/dex/src/component/router/fill_route.rs b/crates/core/component/dex/src/component/router/fill_route.rs index 4e3c24af0a..ea38f7f67d 100644 --- a/crates/core/component/dex/src/component/router/fill_route.rs +++ b/crates/core/component/dex/src/component/router/fill_route.rs @@ -7,8 +7,8 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateDelta, StateRead, StateWrite}; use futures::{Stream, StreamExt}; -use penumbra_asset::{asset, Value}; -use penumbra_num::{ +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::{ fixpoint::{Error, U128x128}, Amount, }; diff --git a/crates/core/component/dex/src/component/router/params.rs b/crates/core/component/dex/src/component/router/params.rs index 6d18a9c2c7..20f70e4199 100644 --- a/crates/core/component/dex/src/component/router/params.rs +++ b/crates/core/component/dex/src/component/router/params.rs @@ -1,7 +1,7 @@ use std::sync::Arc; -use penumbra_asset::asset; -use penumbra_num::fixpoint::U128x128; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::fixpoint::U128x128; use crate::DexParameters; diff --git a/crates/core/component/dex/src/component/router/path.rs b/crates/core/component/dex/src/component/router/path.rs index dde86045aa..9bc5056dc9 100644 --- a/crates/core/component/dex/src/component/router/path.rs +++ b/crates/core/component/dex/src/component/router/path.rs @@ -1,8 +1,8 @@ use anyhow::Result; use cnidarium::{StateDelta, StateRead}; -use penumbra_asset::asset; -use penumbra_num::fixpoint::U128x128; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::fixpoint::U128x128; use std::cmp::Ordering; use tracing::Instrument; diff --git a/crates/core/component/dex/src/component/router/path_cache.rs b/crates/core/component/dex/src/component/router/path_cache.rs index a8b5cebf51..556b00136a 100644 --- a/crates/core/component/dex/src/component/router/path_cache.rs +++ b/crates/core/component/dex/src/component/router/path_cache.rs @@ -2,7 +2,7 @@ use std::{collections::BTreeMap, sync::Arc}; use cnidarium::{StateDelta, StateRead}; use parking_lot::Mutex; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; use super::Path; diff --git a/crates/core/component/dex/src/component/router/path_search.rs b/crates/core/component/dex/src/component/router/path_search.rs index e44e46cd9f..5fed7d3041 100644 --- a/crates/core/component/dex/src/component/router/path_search.rs +++ b/crates/core/component/dex/src/component/router/path_search.rs @@ -4,8 +4,8 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateDelta, StateRead}; use futures::StreamExt; -use penumbra_asset::asset; -use penumbra_num::fixpoint::U128x128; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::fixpoint::U128x128; use tap::Tap; use tokio::task::JoinSet; use tracing::{instrument, Instrument}; diff --git a/crates/core/component/dex/src/component/router/route_and_fill.rs b/crates/core/component/dex/src/component/router/route_and_fill.rs index 4d7b5476a8..81d24031a6 100644 --- a/crates/core/component/dex/src/component/router/route_and_fill.rs +++ b/crates/core/component/dex/src/component/router/route_and_fill.rs @@ -3,9 +3,9 @@ use std::sync::Arc; use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_asset::{asset, Value}; -use penumbra_num::Amount; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_sct::component::clock::EpochRead; use tracing::instrument; use crate::{ diff --git a/crates/core/component/dex/src/component/router/tests.rs b/crates/core/component/dex/src/component/router/tests.rs index 5484ccd9f6..320206b98d 100644 --- a/crates/core/component/dex/src/component/router/tests.rs +++ b/crates/core/component/dex/src/component/router/tests.rs @@ -3,8 +3,8 @@ use cnidarium::TempStorage; use cnidarium::{StateDelta, StateWrite}; use core::panic; use futures::StreamExt; -use penumbra_asset::{asset, Value}; -use penumbra_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; use rand_core::OsRng; use std::sync::Arc; diff --git a/crates/core/component/dex/src/component/rpc.rs b/crates/core/component/dex/src/component/rpc.rs index 89cef38079..46853854c4 100644 --- a/crates/core/component/dex/src/component/rpc.rs +++ b/crates/core/component/dex/src/component/rpc.rs @@ -8,8 +8,8 @@ use tonic::Status; use tracing::instrument; use cnidarium::{StateDelta, Storage}; -use penumbra_asset::{asset, Value}; -use penumbra_proto::{ +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_proto::{ core::component::dex::v1::{ query_service_server::QueryService, simulate_trade_request::{ @@ -571,7 +571,7 @@ impl QueryService for Server { } }; Ok(tonic::Response::new( - s.map_ok(|p: penumbra_proto::core::component::dex::v1::Position| { + s.map_ok(|p: penumbra_sdk_proto::core::component::dex::v1::Position| { LiquidityPositionsByIdResponse { data: Some(p) } }) .map_err(|e: anyhow::Error| { diff --git a/crates/core/component/dex/src/component/swap_manager.rs b/crates/core/component/dex/src/component/swap_manager.rs index 75b3c00766..8c8a24e1e6 100644 --- a/crates/core/component/dex/src/component/swap_manager.rs +++ b/crates/core/component/dex/src/component/swap_manager.rs @@ -1,8 +1,8 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_asset::Value; -use penumbra_sct::{component::tree::SctManager, CommitmentSource}; -use penumbra_tct as tct; +use penumbra_sdk_asset::Value; +use penumbra_sdk_sct::{component::tree::SctManager, CommitmentSource}; +use penumbra_sdk_tct as tct; use tracing::instrument; use crate::component::circuit_breaker::value::ValueCircuitBreaker; @@ -12,7 +12,7 @@ use crate::{ component::flow::SwapFlow, state_key, swap::SwapPayload, DirectedTradingPair, TradingPair, }; use anyhow::Result; -use penumbra_proto::StateWriteProto; +use penumbra_sdk_proto::StateWriteProto; /// Manages the addition of new notes to the chain state. #[async_trait] diff --git a/crates/core/component/dex/src/component/tests.rs b/crates/core/component/dex/src/component/tests.rs index 318852c13e..6282be1187 100644 --- a/crates/core/component/dex/src/component/tests.rs +++ b/crates/core/component/dex/src/component/tests.rs @@ -4,8 +4,8 @@ use anyhow::Ok; use async_trait::async_trait; use cnidarium::{ArcStateDeltaExt, StateDelta, TempStorage}; use futures::StreamExt; -use penumbra_asset::{asset, Value}; -use penumbra_num::Amount; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::Amount; use rand_core::OsRng; use crate::component::{SwapDataRead, SwapDataWrite}; @@ -30,13 +30,13 @@ pub trait TempStorageExt: Sized { #[async_trait] impl TempStorageExt for TempStorage { async fn apply_minimal_genesis(self) -> anyhow::Result { - use penumbra_sct::component::clock::EpochManager as _; + use penumbra_sdk_sct::component::clock::EpochManager as _; let mut state = StateDelta::new(self.latest_snapshot()); state.put_block_height(0); state.put_epoch_by_height( 0, - penumbra_sct::epoch::Epoch { + penumbra_sdk_sct::epoch::Epoch { index: 0, start_height: 0, }, @@ -679,7 +679,7 @@ async fn swap_execution_tests() -> anyhow::Result<()> { tracing::info!(gm_id = ?gm.id()); tracing::info!(gn_id = ?gn.id()); tracing::info!(pusd_id = ?pusd.id()); - tracing::info!(penumbra_id = ?penumbra.id()); + tracing::info!(penumbra_sdk_id = ?penumbra.id()); // Working backwards through the graph: @@ -809,7 +809,7 @@ async fn basic_cycle_arb() -> anyhow::Result<()> { tracing::info!(gm_id = ?gm.id()); tracing::info!(gn_id = ?gn.id()); - tracing::info!(penumbra_id = ?penumbra.id()); + tracing::info!(penumbra_sdk_id = ?penumbra.id()); // Sell 10 gn at 1 penumbra each. state_tx @@ -886,10 +886,10 @@ async fn reproduce_arbitrage_loop_testnet_53() -> anyhow::Result<()> { .get_unit("test_usd") .unwrap(); - tracing::info!(penumbra_id= ?penumbra.id()); + tracing::info!(penumbra_sdk_id= ?penumbra.id()); tracing::info!(test_usd_id = ?test_usd.id()); - let penumbra_usd = DirectedUnitPair::new(penumbra.clone(), test_usd.clone()); + let penumbra_sdk_usd = DirectedUnitPair::new(penumbra.clone(), test_usd.clone()); /* * INITIAL STATE: @@ -921,13 +921,13 @@ async fn reproduce_arbitrage_loop_testnet_53() -> anyhow::Result<()> { * */ - let mut buy_1 = create_buy(penumbra_usd.clone(), 1u64.into(), 110u64.into()); + let mut buy_1 = create_buy(penumbra_sdk_usd.clone(), 1u64.into(), 110u64.into()); buy_1.nonce = [1; 32]; - let mut buy_2 = create_buy(penumbra_usd.clone(), 1u64.into(), 100u64.into()); + let mut buy_2 = create_buy(penumbra_sdk_usd.clone(), 1u64.into(), 100u64.into()); buy_2.nonce = [2; 32]; - let mut sell_1 = create_sell(penumbra_usd.clone(), 10u64.into(), 100u64.into()); + let mut sell_1 = create_sell(penumbra_sdk_usd.clone(), 10u64.into(), 100u64.into()); sell_1.nonce = [0; 32]; state_tx.open_position(buy_1).await.unwrap(); @@ -1028,7 +1028,7 @@ async fn check_routable_asset_ordering() -> anyhow::Result<()> { let gn = asset::Cache::with_known_assets().get_unit("gn").unwrap(); let gm = asset::Cache::with_known_assets().get_unit("gm").unwrap(); - let penumbra_usd = DirectedTradingPair::new(penumbra.id(), test_usd.id()); + let penumbra_sdk_usd = DirectedTradingPair::new(penumbra.id(), test_usd.id()); let reserves_1 = Reserves { // 0 penumbra @@ -1039,7 +1039,7 @@ async fn check_routable_asset_ordering() -> anyhow::Result<()> { let position_1 = Position::new( OsRng, - penumbra_usd, + penumbra_sdk_usd, 0u32, 1_200_000u64.into(), 1_000_000u64.into(), @@ -1048,7 +1048,7 @@ async fn check_routable_asset_ordering() -> anyhow::Result<()> { state_tx.open_position(position_1).await.unwrap(); - let penumbra_gn = DirectedTradingPair::new(penumbra.id(), gn.id()); + let penumbra_sdk_gn = DirectedTradingPair::new(penumbra.id(), gn.id()); let reserves_2 = Reserves { // 130,000 penumbra @@ -1059,7 +1059,7 @@ async fn check_routable_asset_ordering() -> anyhow::Result<()> { let position_2 = Position::new( OsRng, - penumbra_gn, + penumbra_sdk_gn, 0u32, 1_200_000u64.into(), 1_000_000u64.into(), @@ -1068,7 +1068,7 @@ async fn check_routable_asset_ordering() -> anyhow::Result<()> { state_tx.open_position(position_2).await.unwrap(); - let penumbra_btc = DirectedTradingPair::new(penumbra.id(), test_btc.id()); + let penumbra_sdk_btc = DirectedTradingPair::new(penumbra.id(), test_btc.id()); let reserves_3 = Reserves { // 100,000 penumbra @@ -1079,7 +1079,7 @@ async fn check_routable_asset_ordering() -> anyhow::Result<()> { let position_3 = Position::new( OsRng, - penumbra_btc, + penumbra_sdk_btc, 0u32, 1_200_000u64.into(), 1_000_000u64.into(), diff --git a/crates/core/component/dex/src/event.rs b/crates/core/component/dex/src/event.rs index 5e2f052ead..8b39d6a7e3 100644 --- a/crates/core/component/dex/src/event.rs +++ b/crates/core/component/dex/src/event.rs @@ -5,11 +5,11 @@ use crate::{ BatchSwapOutputData, CandlestickData, DirectedTradingPair, SwapExecution, TradingPair, }; use anyhow::{anyhow, Context}; -use penumbra_asset::asset; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_tct::StateCommitment; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct::StateCommitment; use prost::Name as _; #[derive(Clone, Debug)] diff --git a/crates/core/component/dex/src/genesis.rs b/crates/core/component/dex/src/genesis.rs index 943fb6ad65..73c467ac60 100644 --- a/crates/core/component/dex/src/genesis.rs +++ b/crates/core/component/dex/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::DexParameters; diff --git a/crates/core/component/dex/src/lp/action.rs b/crates/core/component/dex/src/lp/action.rs index 6c399e4282..70267f31de 100644 --- a/crates/core/component/dex/src/lp/action.rs +++ b/crates/core/component/dex/src/lp/action.rs @@ -1,8 +1,8 @@ use serde::{Deserialize, Serialize}; -use penumbra_asset::{balance, Balance, Value}; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{balance, Balance, Value}; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use super::{position, position::Position, LpNft}; diff --git a/crates/core/component/dex/src/lp/nft.rs b/crates/core/component/dex/src/lp/nft.rs index fe4174b1d6..8f9049d9a7 100644 --- a/crates/core/component/dex/src/lp/nft.rs +++ b/crates/core/component/dex/src/lp/nft.rs @@ -1,5 +1,5 @@ -use penumbra_asset::asset; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_asset::asset; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use regex::Regex; use super::position::{Id, State}; @@ -150,7 +150,7 @@ impl From for pb::LpNft { #[cfg(test)] mod tests { use super::*; - use penumbra_asset::STAKING_TOKEN_ASSET_ID; + use penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID; use super::super::{super::DirectedTradingPair, position::*}; diff --git a/crates/core/component/dex/src/lp/order.rs b/crates/core/component/dex/src/lp/order.rs index ff15e7f6c5..f27dde8a3c 100644 --- a/crates/core/component/dex/src/lp/order.rs +++ b/crates/core/component/dex/src/lp/order.rs @@ -1,9 +1,9 @@ use anyhow::{anyhow, Result}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset::{self, Unit}, Value, }; -use penumbra_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; use rand_core::CryptoRngCore; use regex::Regex; diff --git a/crates/core/component/dex/src/lp/plan.rs b/crates/core/component/dex/src/lp/plan.rs index d74208353e..ed26d1c903 100644 --- a/crates/core/component/dex/src/lp/plan.rs +++ b/crates/core/component/dex/src/lp/plan.rs @@ -1,7 +1,7 @@ use ark_ff::Zero; use decaf377::Fr; -use penumbra_asset::{balance, Balance, Value}; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_asset::{balance, Balance, Value}; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/crates/core/component/dex/src/lp/position.rs b/crates/core/component/dex/src/lp/position.rs index 85029612de..a551dad6e4 100644 --- a/crates/core/component/dex/src/lp/position.rs +++ b/crates/core/component/dex/src/lp/position.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Context}; -use penumbra_asset::{asset, Value}; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ penumbra::core::component::dex::v1 as pb, serializers::bech32str, DomainType, }; use rand_core::CryptoRngCore; @@ -144,7 +144,7 @@ impl Position { /// Get the ID of this position. pub fn id(&self) -> Id { let mut state = blake2b_simd::Params::default() - .personal(b"penumbra_lp_id") + .personal(b"penumbra_sdk_lp_id") .to_state(); state.update(&self.nonce); @@ -433,7 +433,7 @@ mod test { use super::*; use ark_ff::Zero; use decaf377::Fq; - use penumbra_asset::asset; + use penumbra_sdk_asset::asset; use rand_core::OsRng; #[test] diff --git a/crates/core/component/dex/src/lp/reserves.rs b/crates/core/component/dex/src/lp/reserves.rs index 215d12aa5c..bfc5e98e95 100644 --- a/crates/core/component/dex/src/lp/reserves.rs +++ b/crates/core/component/dex/src/lp/reserves.rs @@ -1,6 +1,6 @@ -use penumbra_asset::{Balance, Value}; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use crate::TradingPair; diff --git a/crates/core/component/dex/src/lp/trading_function.rs b/crates/core/component/dex/src/lp/trading_function.rs index 8db44f981a..456813e5fd 100644 --- a/crates/core/component/dex/src/lp/trading_function.rs +++ b/crates/core/component/dex/src/lp/trading_function.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Result}; -use penumbra_asset::{asset, Value}; -use penumbra_num::{fixpoint::U128x128, Amount}; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use tracing::instrument; @@ -488,7 +488,7 @@ impl From for pb::BareTradingFunction { mod tests { use ark_ff::Zero; use decaf377::Fq; - use penumbra_asset::asset::Id; + use penumbra_sdk_asset::asset::Id; use super::*; diff --git a/crates/core/component/dex/src/params.rs b/crates/core/component/dex/src/params.rs index ea497ff4b2..0da9223e3a 100644 --- a/crates/core/component/dex/src/params.rs +++ b/crates/core/component/dex/src/params.rs @@ -1,6 +1,6 @@ -use penumbra_asset::{asset, STAKING_TOKEN_ASSET_ID}; -use penumbra_proto::penumbra::core::component::dex::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_asset::{asset, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_proto::penumbra::core::component::dex::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/dex/src/state_key.rs b/crates/core/component/dex/src/state_key.rs index 01e653de27..89bcfe9184 100644 --- a/crates/core/component/dex/src/state_key.rs +++ b/crates/core/component/dex/src/state_key.rs @@ -1,6 +1,6 @@ use std::string::String; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; use crate::{lp::position, DirectedTradingPair, TradingPair}; @@ -146,8 +146,8 @@ pub(crate) mod engine { } pub(crate) mod routable_assets { - use penumbra_asset::asset; - use penumbra_num::Amount; + use penumbra_sdk_asset::asset; + use penumbra_sdk_num::Amount; use super::*; @@ -224,7 +224,7 @@ pub(crate) mod eviction_queue { use crate::lp::position; use crate::DirectedTradingPair; use anyhow::ensure; - use penumbra_num::Amount; + use penumbra_sdk_num::Amount; pub(crate) fn by_trading_pair(pair: &DirectedTradingPair) -> [u8; 107] { let mut prefix = [0u8; 107]; diff --git a/crates/core/component/dex/src/swap/action.rs b/crates/core/component/dex/src/swap/action.rs index 2ac4859a78..805296cf6b 100644 --- a/crates/core/component/dex/src/swap/action.rs +++ b/crates/core/component/dex/src/swap/action.rs @@ -1,12 +1,12 @@ use anyhow::Context; use ark_ff::Zero; use decaf377::Fr; -use penumbra_asset::{balance, Balance, Value}; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_asset::{balance, Balance, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ core::component::dex::v1 as pbc, penumbra::core::component::dex::v1 as pb, DomainType, }; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::TradingPair; diff --git a/crates/core/component/dex/src/swap/ciphertext.rs b/crates/core/component/dex/src/swap/ciphertext.rs index 5594c9dcfd..cebd8eb608 100644 --- a/crates/core/component/dex/src/swap/ciphertext.rs +++ b/crates/core/component/dex/src/swap/ciphertext.rs @@ -1,7 +1,7 @@ use anyhow::Result; -use penumbra_keys::{keys::OutgoingViewingKey, PayloadKey}; -use penumbra_shielded_pool::note; +use penumbra_sdk_keys::{keys::OutgoingViewingKey, PayloadKey}; +use penumbra_sdk_shielded_pool::note; use super::{SwapPlaintext, SWAP_CIPHERTEXT_BYTES, SWAP_LEN_BYTES}; diff --git a/crates/core/component/dex/src/swap/payload.rs b/crates/core/component/dex/src/swap/payload.rs index 0b4b648c22..57f3ec2cd0 100644 --- a/crates/core/component/dex/src/swap/payload.rs +++ b/crates/core/component/dex/src/swap/payload.rs @@ -1,6 +1,6 @@ use anyhow::anyhow; -use penumbra_keys::FullViewingKey; -use penumbra_proto::penumbra::core::component::dex::v1 as pb; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proto::penumbra::core::component::dex::v1 as pb; use serde::{Deserialize, Serialize}; use super::{SwapCiphertext, SwapPlaintext}; @@ -8,7 +8,7 @@ use super::{SwapCiphertext, SwapPlaintext}; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(try_from = "pb::SwapPayload", into = "pb::SwapPayload")] pub struct SwapPayload { - pub commitment: penumbra_tct::StateCommitment, + pub commitment: penumbra_sdk_tct::StateCommitment, pub encrypted_swap: SwapCiphertext, } diff --git a/crates/core/component/dex/src/swap/plaintext.rs b/crates/core/component/dex/src/swap/plaintext.rs index f570cdaa02..0c738cf84e 100644 --- a/crates/core/component/dex/src/swap/plaintext.rs +++ b/crates/core/component/dex/src/swap/plaintext.rs @@ -5,20 +5,20 @@ use ark_relations::r1cs::SynthesisError; use decaf377::r1cs::FqVar; use decaf377::Fq; use once_cell::sync::Lazy; -use penumbra_fee::Fee; -use penumbra_proto::{ +use penumbra_sdk_fee::Fee; +use penumbra_sdk_proto::{ core::keys::v1 as pb_keys, penumbra::core::component::dex::v1 as pb, DomainType, }; -use penumbra_tct::StateCommitment; +use penumbra_sdk_tct::StateCommitment; use poseidon377::{hash_1, hash_4, hash_7}; use rand_core::{CryptoRng, RngCore}; use decaf377_ka as ka; -use penumbra_asset::{asset, Value, ValueVar}; -use penumbra_keys::{keys::OutgoingViewingKey, Address, AddressVar, PayloadKey}; -use penumbra_num::{Amount, AmountVar}; -use penumbra_shielded_pool::{Note, Rseed}; -use penumbra_tct::r1cs::StateCommitmentVar; +use penumbra_sdk_asset::{asset, Value, ValueVar}; +use penumbra_sdk_keys::{keys::OutgoingViewingKey, Address, AddressVar, PayloadKey}; +use penumbra_sdk_num::{Amount, AmountVar}; +use penumbra_sdk_shielded_pool::{Note, Rseed}; +use penumbra_sdk_tct::r1cs::StateCommitmentVar; use crate::{BatchSwapOutputData, TradingPair, TradingPairVar}; @@ -420,8 +420,8 @@ mod tests { use rand_core::OsRng; use super::*; - use penumbra_asset::{asset, Value}; - use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; + use penumbra_sdk_asset::{asset, Value}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; #[test] /// Check the swap plaintext can be encrypted and decrypted with the OVK. diff --git a/crates/core/component/dex/src/swap/plan.rs b/crates/core/component/dex/src/swap/plan.rs index 61b7f3097c..8523a5081c 100644 --- a/crates/core/component/dex/src/swap/plan.rs +++ b/crates/core/component/dex/src/swap/plan.rs @@ -2,9 +2,9 @@ use anyhow::{anyhow, Context, Result}; use ark_ff::Zero; use decaf377::{Fq, Fr}; -use penumbra_asset::{balance, Balance, Value}; -use penumbra_keys::FullViewingKey; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_asset::{balance, Balance, Value}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use rand_core::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; @@ -57,7 +57,7 @@ impl SwapPlan { /// Construct the [`SwapProof`] required by the [`swap::Body`] described by this [`SwapPlan`]. pub fn swap_proof(&self) -> SwapProof { - use penumbra_proof_params::SWAP_PROOF_PROVING_KEY; + use penumbra_sdk_proof_params::SWAP_PROOF_PROVING_KEY; let balance_commitment = self.transparent_balance().commit(Fr::zero()) + self.fee_commitment(); diff --git a/crates/core/component/dex/src/swap/proof.rs b/crates/core/component/dex/src/swap/proof.rs index 08b12a41e3..a4b85b074b 100644 --- a/crates/core/component/dex/src/swap/proof.rs +++ b/crates/core/component/dex/src/swap/proof.rs @@ -11,25 +11,25 @@ use decaf377::Bls12_377; use decaf377::{Fq, Fr}; use decaf377_fmd as fmd; use decaf377_ka as ka; -use penumbra_fee::Fee; -use penumbra_proto::{core::component::dex::v1 as pb, DomainType}; -use penumbra_tct as tct; -use penumbra_tct::r1cs::StateCommitmentVar; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_proto::{core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_tct::r1cs::StateCommitmentVar; -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset, balance::{self, commitment::BalanceCommitmentVar, BalanceVar}, Value, }; -use penumbra_keys::{keys::Diversifier, Address}; -use penumbra_shielded_pool::Rseed; +use penumbra_sdk_keys::{keys::Diversifier, Address}; +use penumbra_sdk_shielded_pool::Rseed; use crate::{ swap::{SwapPlaintext, SwapPlaintextVar}, TradingPair, }; -use penumbra_proof_params::{DummyWitness, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_proof_params::{DummyWitness, GROTH16_PROOF_LENGTH_BYTES}; /// The public inputs to a [`SwapProof`]. #[derive(Clone, Debug)] @@ -53,7 +53,7 @@ pub struct SwapProofPrivate { #[cfg(test)] fn check_satisfaction(public: &SwapProofPublic, private: &SwapProofPrivate) -> Result<()> { - use penumbra_asset::Balance; + use penumbra_sdk_asset::Balance; let swap_commitment = private.swap_plaintext.swap_commitment(); if swap_commitment != public.swap_commitment { @@ -293,9 +293,9 @@ impl TryFrom for SwapProof { #[cfg(test)] mod tests { use super::*; - use penumbra_asset::{Balance, Value}; - use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; - use penumbra_num::Amount; + use penumbra_sdk_asset::{Balance, Value}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; + use penumbra_sdk_num::Amount; use proptest::prelude::*; fn fr_strategy() -> BoxedStrategy { diff --git a/crates/core/component/dex/src/swap/view.rs b/crates/core/component/dex/src/swap/view.rs index db50783eeb..c8d2c1bf64 100644 --- a/crates/core/component/dex/src/swap/view.rs +++ b/crates/core/component/dex/src/swap/view.rs @@ -1,7 +1,7 @@ -use penumbra_asset::{asset::Metadata, ValueView}; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; -use penumbra_shielded_pool::NoteView; -use penumbra_txhash::TransactionId; +use penumbra_sdk_asset::{asset::Metadata, ValueView}; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_shielded_pool::NoteView; +use penumbra_sdk_txhash::TransactionId; use serde::{Deserialize, Serialize}; use crate::BatchSwapOutputData; diff --git a/crates/core/component/dex/src/swap_claim/action.rs b/crates/core/component/dex/src/swap_claim/action.rs index 61158b7ba0..08975d73ca 100644 --- a/crates/core/component/dex/src/swap_claim/action.rs +++ b/crates/core/component/dex/src/swap_claim/action.rs @@ -1,11 +1,11 @@ use anyhow::Context; -use penumbra_asset::Balance; -use penumbra_fee::Fee; -use penumbra_proof_params::GROTH16_PROOF_LENGTH_BYTES; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_tct as tct; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::Balance; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_proof_params::GROTH16_PROOF_LENGTH_BYTES; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct as tct; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::BatchSwapOutputData; diff --git a/crates/core/component/dex/src/swap_claim/plan.rs b/crates/core/component/dex/src/swap_claim/plan.rs index a6e70f8fd2..8cf6931ac0 100644 --- a/crates/core/component/dex/src/swap_claim/plan.rs +++ b/crates/core/component/dex/src/swap_claim/plan.rs @@ -1,10 +1,10 @@ use decaf377::Fq; -use penumbra_asset::{Balance, Value}; -use penumbra_keys::{keys::IncomingViewingKey, FullViewingKey}; -use penumbra_proof_params::SWAPCLAIM_PROOF_PROVING_KEY; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_tct as tct; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_keys::{keys::IncomingViewingKey, FullViewingKey}; +use penumbra_sdk_proof_params::SWAPCLAIM_PROOF_PROVING_KEY; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct as tct; use serde::{Deserialize, Serialize}; use tct::Position; diff --git a/crates/core/component/dex/src/swap_claim/proof.rs b/crates/core/component/dex/src/swap_claim/proof.rs index 8ea7e8ab50..79f4546305 100644 --- a/crates/core/component/dex/src/swap_claim/proof.rs +++ b/crates/core/component/dex/src/swap_claim/proof.rs @@ -9,22 +9,22 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_snark::SNARK; use decaf377::{r1cs::FqVar, Bls12_377, Fq}; use decaf377_rdsa::{SpendAuth, VerificationKey}; -use penumbra_fee::Fee; -use penumbra_proto::{core::component::dex::v1 as pb, DomainType}; -use penumbra_tct as tct; -use penumbra_tct::r1cs::StateCommitmentVar; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_proto::{core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_tct::r1cs::StateCommitmentVar; -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset::{self, Id}, Value, ValueVar, }; -use penumbra_keys::keys::{ +use penumbra_sdk_keys::keys::{ AuthorizationKeyVar, Bip44Path, IncomingViewingKeyVar, NullifierKey, NullifierKeyVar, SeedPhrase, SpendKey, }; -use penumbra_num::{Amount, AmountVar}; -use penumbra_sct::{Nullifier, NullifierVar}; -use penumbra_shielded_pool::{ +use penumbra_sdk_num::{Amount, AmountVar}; +use penumbra_sdk_sct::{Nullifier, NullifierVar}; +use penumbra_sdk_shielded_pool::{ note::{self, NoteVar}, Rseed, }; @@ -37,7 +37,7 @@ use crate::{ BatchSwapOutputData, TradingPair, }; -use penumbra_proof_params::{DummyWitness, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_proof_params::{DummyWitness, GROTH16_PROOF_LENGTH_BYTES}; /// The public inputs to a [`SwapProofPublic`]. #[derive(Clone, Debug)] @@ -82,7 +82,7 @@ fn check_satisfaction( public: &SwapClaimProofPublic, private: &SwapClaimProofPrivate, ) -> Result<()> { - use penumbra_keys::FullViewingKey; + use penumbra_sdk_keys::FullViewingKey; let swap_commitment = private.swap_plaintext.swap_commitment(); if swap_commitment != private.state_commitment_proof.commitment() { @@ -537,8 +537,8 @@ impl TryFrom for SwapClaimProof { #[cfg(test)] mod tests { use super::*; - use penumbra_keys::keys::{SeedPhrase, SpendKey}; - use penumbra_num::Amount; + use penumbra_sdk_keys::keys::{SeedPhrase, SpendKey}; + use penumbra_sdk_num::Amount; use proptest::prelude::*; #[derive(Debug)] diff --git a/crates/core/component/dex/src/swap_claim/view.rs b/crates/core/component/dex/src/swap_claim/view.rs index 7f8125279f..061b1f4b6f 100644 --- a/crates/core/component/dex/src/swap_claim/view.rs +++ b/crates/core/component/dex/src/swap_claim/view.rs @@ -1,6 +1,6 @@ -use penumbra_proto::{penumbra::core::component::dex::v1 as pbd, DomainType}; -use penumbra_shielded_pool::NoteView; -use penumbra_txhash::TransactionId; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pbd, DomainType}; +use penumbra_sdk_shielded_pool::NoteView; +use penumbra_sdk_txhash::TransactionId; use serde::{Deserialize, Serialize}; use super::SwapClaim; diff --git a/crates/core/component/dex/src/swap_execution.rs b/crates/core/component/dex/src/swap_execution.rs index a602ce74c6..f5a6221a25 100644 --- a/crates/core/component/dex/src/swap_execution.rs +++ b/crates/core/component/dex/src/swap_execution.rs @@ -1,7 +1,7 @@ use anyhow::Result; -use penumbra_asset::Value; -use penumbra_num::fixpoint::U128x128; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_asset::Value; +use penumbra_sdk_num::fixpoint::U128x128; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// Contains the summary data of a trade, for client consumption. diff --git a/crates/core/component/dex/src/trading_pair.rs b/crates/core/component/dex/src/trading_pair.rs index 6b41328588..936c3ec675 100644 --- a/crates/core/component/dex/src/trading_pair.rs +++ b/crates/core/component/dex/src/trading_pair.rs @@ -3,14 +3,14 @@ use ark_ff::ToConstraintField; use ark_r1cs_std::prelude::{AllocVar, EqGadget}; use ark_relations::r1cs::SynthesisError; use decaf377::Fq; -use penumbra_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::dex::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use std::{ fmt::{self, Display, Formatter}, str::FromStr, }; -use penumbra_asset::asset::{self, AssetIdVar, Unit, REGISTRY}; +use penumbra_sdk_asset::asset::{self, AssetIdVar, Unit, REGISTRY}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] #[serde(try_from = "pb::DirectedTradingPair", into = "pb::DirectedTradingPair")] diff --git a/crates/core/component/dex/tests/integration/harness.rs b/crates/core/component/dex/tests/integration/harness.rs index a9348fd592..4c3e7f7f0f 100644 --- a/crates/core/component/dex/tests/integration/harness.rs +++ b/crates/core/component/dex/tests/integration/harness.rs @@ -8,8 +8,8 @@ //! The outcome consists of the remaining reserves for each position, and the output for each swapper. use cnidarium::{Snapshot, StateDelta, TempStorage}; use cnidarium_component::{ActionHandler, Component}; -use penumbra_asset::asset; -use penumbra_dex::{ +use penumbra_sdk_asset::asset; +use penumbra_sdk_dex::{ component::{Dex, PositionRead, StateReadExt}, lp::{ position::{self, Position}, @@ -19,10 +19,10 @@ use penumbra_dex::{ BatchSwapOutputData, DirectedTradingPair, PositionClose, PositionOpen, PositionWithdraw, Swap, TradingPair, }; -use penumbra_keys::test_keys; -use penumbra_num::Amount; -use penumbra_proto::core::component::dex::v1::ZkSwapProof; -use penumbra_sct::{ +use penumbra_sdk_keys::test_keys; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::dex::v1::ZkSwapProof; +use penumbra_sdk_sct::{ component::{clock::EpochManager, source::SourceContext}, epoch::Epoch, }; diff --git a/crates/core/component/distributions/src/component.rs b/crates/core/component/distributions/src/component.rs index 4abeaff0a4..7ff7217fe1 100644 --- a/crates/core/component/distributions/src/component.rs +++ b/crates/core/component/distributions/src/component.rs @@ -9,7 +9,7 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::Component; -use penumbra_num::Amount; +use penumbra_sdk_num::Amount; use tendermint::v0_37::abci; use tracing::instrument; @@ -58,7 +58,7 @@ impl Component for Distributions { trait DistributionManager: StateWriteExt { /// Compute the total new issuance of staking tokens for this epoch. async fn compute_new_issuance(&self) -> Result { - use penumbra_sct::component::clock::EpochRead; + use penumbra_sdk_sct::component::clock::EpochRead; let current_block_height = self.get_block_height().await?; let current_epoch = self.get_current_epoch().await?; diff --git a/crates/core/component/distributions/src/component/view.rs b/crates/core/component/distributions/src/component/view.rs index e674316e12..b348cf9510 100644 --- a/crates/core/component/distributions/src/component/view.rs +++ b/crates/core/component/distributions/src/component/view.rs @@ -3,8 +3,8 @@ use async_trait::async_trait; use crate::{component::state_key, params::DistributionsParameters}; use anyhow::Result; use cnidarium::{StateRead, StateWrite}; -use penumbra_num::Amount; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; #[async_trait] pub trait StateReadExt: StateRead { diff --git a/crates/core/component/distributions/src/genesis.rs b/crates/core/component/distributions/src/genesis.rs index eca8566e18..1b74ec6b4f 100644 --- a/crates/core/component/distributions/src/genesis.rs +++ b/crates/core/component/distributions/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::distributions::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::distributions::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::DistributionsParameters; diff --git a/crates/core/component/distributions/src/params.rs b/crates/core/component/distributions/src/params.rs index 10ccf3cbb2..87c05730a7 100644 --- a/crates/core/component/distributions/src/params.rs +++ b/crates/core/component/distributions/src/params.rs @@ -1,5 +1,5 @@ -use penumbra_proto::core::component::distributions::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::core::component::distributions::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/fee/src/component.rs b/crates/core/component/fee/src/component.rs index 25ffa10451..48607e2e7f 100644 --- a/crates/core/component/fee/src/component.rs +++ b/crates/core/component/fee/src/component.rs @@ -8,8 +8,8 @@ use crate::{event::EventBlockFees, genesis, Fee}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::Component; -use penumbra_proto::state::StateWriteProto as _; -use penumbra_proto::DomainType as _; +use penumbra_sdk_proto::state::StateWriteProto as _; +use penumbra_sdk_proto::DomainType as _; use tendermint::abci; use tracing::instrument; @@ -50,7 +50,7 @@ impl Component for FeeComponent { let fees = state_ref.accumulated_base_fees_and_tips(); let (swapped_base, swapped_tip) = fees - .get(&penumbra_asset::STAKING_TOKEN_ASSET_ID) + .get(&penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID) .cloned() .unwrap_or_default(); diff --git a/crates/core/component/fee/src/component/fee_pay.rs b/crates/core/component/fee/src/component/fee_pay.rs index c0272f5b4c..9245112067 100644 --- a/crates/core/component/fee/src/component/fee_pay.rs +++ b/crates/core/component/fee/src/component/fee_pay.rs @@ -1,9 +1,9 @@ use anyhow::{ensure, Result}; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_asset::Value; -use penumbra_proto::core::component::fee::v1 as pb; -use penumbra_proto::state::StateWriteProto as _; +use penumbra_sdk_asset::Value; +use penumbra_sdk_proto::core::component::fee::v1 as pb; +use penumbra_sdk_proto::state::StateWriteProto as _; use crate::{Fee, Gas}; @@ -14,7 +14,7 @@ use super::view::{StateReadExt, StateWriteExt}; pub trait FeePay: StateWrite { /// Uses the provided `fee` to pay for `gas_used`, erroring if the fee is insufficient. async fn pay_fee(&mut self, gas_used: Gas, fee: Fee) -> Result<()> { - let current_gas_prices = if fee.asset_id() == *penumbra_asset::STAKING_TOKEN_ASSET_ID { + let current_gas_prices = if fee.asset_id() == *penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID { self.get_gas_prices() .await .expect("gas prices must be present in state") diff --git a/crates/core/component/fee/src/component/rpc.rs b/crates/core/component/fee/src/component/rpc.rs index f93d1bac44..f1dea0f2ff 100644 --- a/crates/core/component/fee/src/component/rpc.rs +++ b/crates/core/component/fee/src/component/rpc.rs @@ -1,6 +1,6 @@ use async_trait::async_trait; use cnidarium::Storage; -use penumbra_proto::core::component::fee::v1::{self as pb, query_service_server::QueryService}; +use penumbra_sdk_proto::core::component::fee::v1::{self as pb, query_service_server::QueryService}; use super::StateReadExt; diff --git a/crates/core/component/fee/src/component/view.rs b/crates/core/component/fee/src/component/view.rs index ab95a02a41..8052d05a26 100644 --- a/crates/core/component/fee/src/component/view.rs +++ b/crates/core/component/fee/src/component/view.rs @@ -1,9 +1,9 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_asset::asset; -use penumbra_num::Amount; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_asset::asset; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use crate::{params::FeeParameters, state_key, Fee, GasPrices}; diff --git a/crates/core/component/fee/src/event.rs b/crates/core/component/fee/src/event.rs index 5a87c81976..bc6ec25587 100644 --- a/crates/core/component/fee/src/event.rs +++ b/crates/core/component/fee/src/event.rs @@ -1,6 +1,6 @@ use crate::Fee; use anyhow::{anyhow, Context}; -use penumbra_proto::{core::component::fee::v1 as pb, DomainType, Name as _}; +use penumbra_sdk_proto::{core::component::fee::v1 as pb, DomainType, Name as _}; #[derive(Clone, Debug)] pub struct EventBlockFees { diff --git a/crates/core/component/fee/src/fee.rs b/crates/core/component/fee/src/fee.rs index 72cac599c6..16e140a3a2 100644 --- a/crates/core/component/fee/src/fee.rs +++ b/crates/core/component/fee/src/fee.rs @@ -1,11 +1,11 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::fee::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::fee::v1 as pb, DomainType}; use std::fmt; use std::str::FromStr; use decaf377::Fr; -use penumbra_asset::{asset, balance, Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::Amount; +use penumbra_sdk_asset::{asset, balance, Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::Amount; // Each fee tier multiplier has an implicit 100 denominator. pub static FEE_TIER_LOW_MULTIPLIER: u32 = 105; diff --git a/crates/core/component/fee/src/gas.rs b/crates/core/component/fee/src/gas.rs index c06bbc170a..3f62e20940 100644 --- a/crates/core/component/fee/src/gas.rs +++ b/crates/core/component/fee/src/gas.rs @@ -3,11 +3,11 @@ use std::{ ops::{Add, AddAssign}, }; -use penumbra_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; use serde::{Deserialize, Serialize}; -use penumbra_num::Amount; -use penumbra_proto::{core::component::fee::v1 as pb, DomainType}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::fee::v1 as pb, DomainType}; use crate::Fee; diff --git a/crates/core/component/fee/src/genesis.rs b/crates/core/component/fee/src/genesis.rs index 9ffc74df50..1a973a8c14 100644 --- a/crates/core/component/fee/src/genesis.rs +++ b/crates/core/component/fee/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::fee::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::fee::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::FeeParameters; diff --git a/crates/core/component/fee/src/params.rs b/crates/core/component/fee/src/params.rs index 5e7dd78c33..39b0fbaffc 100644 --- a/crates/core/component/fee/src/params.rs +++ b/crates/core/component/fee/src/params.rs @@ -1,6 +1,6 @@ -use penumbra_proto::penumbra::core::component::fee::v1 as pb; +use penumbra_sdk_proto::penumbra::core::component::fee::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; use crate::GasPrices; diff --git a/crates/core/component/funding/src/component.rs b/crates/core/component/funding/src/component.rs index a0ea863ec7..3447562bcf 100644 --- a/crates/core/component/funding/src/component.rs +++ b/crates/core/component/funding/src/component.rs @@ -5,9 +5,9 @@ use ::metrics::{gauge, histogram}; pub use metrics::register_metrics; /* Component implementation */ -use penumbra_asset::{Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_proto::{DomainType, StateWriteProto}; -use penumbra_stake::component::validator_handler::ValidatorDataRead; +use penumbra_sdk_asset::{Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_proto::{DomainType, StateWriteProto}; +use penumbra_sdk_stake::component::validator_handler::ValidatorDataRead; pub use view::{StateReadExt, StateWriteExt}; use std::sync::Arc; @@ -56,12 +56,12 @@ impl Component for Funding { // TODO(erwan): scoping these strictly will make it easy to refactor // this code when we introduce additional funding processing logic // e.g. for proposer tips. - use penumbra_community_pool::StateWriteExt as _; - use penumbra_distributions::component::StateReadExt as _; - use penumbra_sct::CommitmentSource; - use penumbra_shielded_pool::component::NoteManager; - use penumbra_stake::funding_stream::Recipient; - use penumbra_stake::StateReadExt as _; + use penumbra_sdk_community_pool::StateWriteExt as _; + use penumbra_sdk_distributions::component::StateReadExt as _; + use penumbra_sdk_sct::CommitmentSource; + use penumbra_sdk_shielded_pool::component::NoteManager; + use penumbra_sdk_stake::funding_stream::Recipient; + use penumbra_sdk_stake::StateReadExt as _; let state = Arc::get_mut(state).expect("state should be unique"); let funding_execution_start = std::time::Instant::now(); diff --git a/crates/core/component/funding/src/component/metrics.rs b/crates/core/component/funding/src/component/metrics.rs index 075e01abf4..4cf6edc71b 100644 --- a/crates/core/component/funding/src/component/metrics.rs +++ b/crates/core/component/funding/src/component/metrics.rs @@ -40,10 +40,10 @@ pub fn register_metrics() { ); } -pub const TOTAL_VALIDATOR_REWARDS: &str = "penumbra_funding_total_validator_rewards_staking_token"; +pub const TOTAL_VALIDATOR_REWARDS: &str = "penumbra_sdk_funding_total_validator_rewards_staking_token"; pub const VALIDATOR_FUNDING_VS_BUDGET_DIFFERENCE: &str = - "penumbra_funding_validator_vs_budget_difference_staking_token"; + "penumbra_sdk_funding_validator_vs_budget_difference_staking_token"; pub const FETCH_FUNDING_QUEUE_LATENCY: &str = - "penumbra_funding_fetch_funding_queue_latency_milliseconds"; + "penumbra_sdk_funding_fetch_funding_queue_latency_milliseconds"; pub const TOTAL_FUNDING_STREAMS_PROCESSING_TIME: &str = - "penumbra_funding_streams_total_processing_time_milliseconds"; + "penumbra_sdk_funding_streams_total_processing_time_milliseconds"; diff --git a/crates/core/component/funding/src/component/view.rs b/crates/core/component/funding/src/component/view.rs index 65f1b56013..83fbdd0398 100644 --- a/crates/core/component/funding/src/component/view.rs +++ b/crates/core/component/funding/src/component/view.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use crate::{component::state_key, params::FundingParameters}; use anyhow::Result; use cnidarium::{StateRead, StateWrite}; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; #[async_trait] pub trait StateReadExt: StateRead { diff --git a/crates/core/component/funding/src/event.rs b/crates/core/component/funding/src/event.rs index 6d646bfe53..6f15fecaf3 100644 --- a/crates/core/component/funding/src/event.rs +++ b/crates/core/component/funding/src/event.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Context}; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::funding::v1 as pb, DomainType, Name as _}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::funding::v1 as pb, DomainType, Name as _}; #[derive(Clone, Debug)] pub struct EventFundingStreamReward { diff --git a/crates/core/component/funding/src/genesis.rs b/crates/core/component/funding/src/genesis.rs index 7e3847b745..c5005c6a3b 100644 --- a/crates/core/component/funding/src/genesis.rs +++ b/crates/core/component/funding/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::funding::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::funding::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::FundingParameters; diff --git a/crates/core/component/funding/src/params.rs b/crates/core/component/funding/src/params.rs index 9ec2bec443..ee5784528a 100644 --- a/crates/core/component/funding/src/params.rs +++ b/crates/core/component/funding/src/params.rs @@ -1,5 +1,5 @@ -use penumbra_proto::core::component::funding::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::core::component::funding::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/governance/src/action_handler/delegator_vote.rs b/crates/core/component/governance/src/action_handler/delegator_vote.rs index 00194240aa..7bdb1ea712 100644 --- a/crates/core/component/governance/src/action_handler/delegator_vote.rs +++ b/crates/core/component/governance/src/action_handler/delegator_vote.rs @@ -3,9 +3,9 @@ use ark_ff::Zero; use async_trait::async_trait; use cnidarium::StateWrite; use decaf377::Fr; -use penumbra_proof_params::DELEGATOR_VOTE_PROOF_VERIFICATION_KEY; -use penumbra_proto::StateWriteProto as _; -use penumbra_txhash::TransactionContext; +use penumbra_sdk_proof_params::DELEGATOR_VOTE_PROOF_VERIFICATION_KEY; +use penumbra_sdk_proto::StateWriteProto as _; +use penumbra_sdk_txhash::TransactionContext; use crate::{ event, DelegatorVote, DelegatorVoteBody, DelegatorVoteProofPublic, diff --git a/crates/core/component/governance/src/action_handler/deposit_claim.rs b/crates/core/component/governance/src/action_handler/deposit_claim.rs index 6cc605f64e..dbd297091b 100644 --- a/crates/core/component/governance/src/action_handler/deposit_claim.rs +++ b/crates/core/component/governance/src/action_handler/deposit_claim.rs @@ -1,8 +1,8 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_proto::StateWriteProto as _; -use penumbra_shielded_pool::component::AssetRegistry; +use penumbra_sdk_proto::StateWriteProto as _; +use penumbra_sdk_shielded_pool::component::AssetRegistry; use crate::action_handler::ActionHandler; use crate::component::{StateReadExt as _, StateWriteExt as _}; diff --git a/crates/core/component/governance/src/action_handler/validator_vote.rs b/crates/core/component/governance/src/action_handler/validator_vote.rs index 68f9f100a3..ea38722039 100644 --- a/crates/core/component/governance/src/action_handler/validator_vote.rs +++ b/crates/core/component/governance/src/action_handler/validator_vote.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_proto::{DomainType, StateWriteProto as _}; +use penumbra_sdk_proto::{DomainType, StateWriteProto as _}; use crate::component::StateWriteExt; use crate::event; diff --git a/crates/core/component/governance/src/action_handler/withdraw.rs b/crates/core/component/governance/src/action_handler/withdraw.rs index 43721128cc..54f512ebed 100644 --- a/crates/core/component/governance/src/action_handler/withdraw.rs +++ b/crates/core/component/governance/src/action_handler/withdraw.rs @@ -1,8 +1,8 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_proto::StateWriteProto as _; -use penumbra_shielded_pool::component::AssetRegistry; +use penumbra_sdk_proto::StateWriteProto as _; +use penumbra_sdk_shielded_pool::component::AssetRegistry; use crate::{ action_handler::ActionHandler, diff --git a/crates/core/component/governance/src/change.rs b/crates/core/component/governance/src/change.rs index e2b877186a..524716c7cc 100644 --- a/crates/core/component/governance/src/change.rs +++ b/crates/core/component/governance/src/change.rs @@ -1,7 +1,7 @@ use std::str::FromStr; use anyhow::Context; -use penumbra_proto::{core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::component::governance::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// An encoded parameter. @@ -199,7 +199,7 @@ fn get_component<'a>( #[cfg(test)] mod tests { use super::*; - use penumbra_num::Amount; + use penumbra_sdk_num::Amount; use crate::params::GovernanceParameters; diff --git a/crates/core/component/governance/src/component.rs b/crates/core/component/governance/src/component.rs index 4581dc0d81..0ff33168b2 100644 --- a/crates/core/component/governance/src/component.rs +++ b/crates/core/component/governance/src/component.rs @@ -4,7 +4,7 @@ use crate::{event, genesis}; use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_proto::StateWriteProto as _; +use penumbra_sdk_proto::StateWriteProto as _; use tendermint::v0_37::abci; use tracing::instrument; @@ -24,7 +24,7 @@ pub mod rpc; pub use view::StateReadExt; pub use view::StateWriteExt; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_sct::component::clock::EpochRead; pub struct Governance {} diff --git a/crates/core/component/governance/src/component/rpc.rs b/crates/core/component/governance/src/component/rpc.rs index 7da6c5ede4..21763d74e1 100644 --- a/crates/core/component/governance/src/component/rpc.rs +++ b/crates/core/component/governance/src/component/rpc.rs @@ -5,14 +5,14 @@ use anyhow::Context; use async_stream::try_stream; use cnidarium::Storage; use futures::{StreamExt, TryStreamExt}; -use penumbra_num::Amount; -use penumbra_proto::core::component::governance::v1::AllTalliedDelegatorVotesForProposalRequest; -use penumbra_proto::core::component::governance::v1::AllTalliedDelegatorVotesForProposalResponse; -use penumbra_proto::core::component::governance::v1::NextProposalIdRequest; -use penumbra_proto::core::component::governance::v1::NextProposalIdResponse; -use penumbra_proto::core::component::governance::v1::VotingPowerAtProposalStartRequest; -use penumbra_proto::core::component::governance::v1::VotingPowerAtProposalStartResponse; -use penumbra_proto::{ +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::governance::v1::AllTalliedDelegatorVotesForProposalRequest; +use penumbra_sdk_proto::core::component::governance::v1::AllTalliedDelegatorVotesForProposalResponse; +use penumbra_sdk_proto::core::component::governance::v1::NextProposalIdRequest; +use penumbra_sdk_proto::core::component::governance::v1::NextProposalIdResponse; +use penumbra_sdk_proto::core::component::governance::v1::VotingPowerAtProposalStartRequest; +use penumbra_sdk_proto::core::component::governance::v1::VotingPowerAtProposalStartResponse; +use penumbra_sdk_proto::{ core::component::governance::v1::{ query_service_server::QueryService, ProposalDataRequest, ProposalDataResponse, ProposalInfoRequest, ProposalInfoResponse, ProposalListRequest, ProposalListResponse, @@ -21,8 +21,8 @@ use penumbra_proto::{ }, StateReadProto, }; -use penumbra_stake::rate::RateData; -use penumbra_stake::IdentityKey; +use penumbra_sdk_stake::rate::RateData; +use penumbra_sdk_stake::IdentityKey; use tonic::Status; use tracing::instrument; diff --git a/crates/core/component/governance/src/component/view.rs b/crates/core/component/governance/src/component/view.rs index a83e2a9e81..4629e8f232 100644 --- a/crates/core/component/governance/src/component/view.rs +++ b/crates/core/component/governance/src/component/view.rs @@ -8,25 +8,25 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::StreamExt; use ibc_types::core::client::ClientId; -use penumbra_asset::{asset, Value, STAKING_TOKEN_DENOM}; -use penumbra_ibc::component::ClientStateReadExt as _; -use penumbra_ibc::component::ClientStateWriteExt as _; -use penumbra_num::Amount; -use penumbra_proto::{StateReadProto, StateWriteProto}; -use penumbra_sct::{ +use penumbra_sdk_asset::{asset, Value, STAKING_TOKEN_DENOM}; +use penumbra_sdk_ibc::component::ClientStateReadExt as _; +use penumbra_sdk_ibc::component::ClientStateWriteExt as _; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::{ component::{clock::EpochRead, tree::SctRead}, Nullifier, }; -use penumbra_shielded_pool::component::AssetRegistryRead; -use penumbra_stake::{ +use penumbra_sdk_shielded_pool::component::AssetRegistryRead; +use penumbra_sdk_stake::{ component::{validator_handler::ValidatorDataRead, ConsensusIndexRead}, DelegationToken, GovernanceKey, IdentityKey, }; -use penumbra_tct as tct; +use penumbra_sdk_tct as tct; use tokio::task::JoinSet; use tracing::instrument; -use penumbra_stake::{rate::RateData, validator}; +use penumbra_sdk_stake::{rate::RateData, validator}; use crate::{ change::ParameterChange, @@ -40,7 +40,7 @@ use crate::{ use crate::{state_key, tally::Tally}; #[async_trait] -pub trait StateReadExt: StateRead + penumbra_stake::StateReadExt { +pub trait StateReadExt: StateRead + penumbra_sdk_stake::StateReadExt { /// Returns true if the next height is an upgrade height. /// We look-ahead to the next height because we want to halt the chain immediately after /// committing the block. @@ -584,10 +584,10 @@ pub trait StateReadExt: StateRead + penumbra_stake::StateReadExt { } } -impl StateReadExt for T {} +impl StateReadExt for T {} #[async_trait] -pub trait StateWriteExt: StateWrite + penumbra_ibc::component::ConnectionStateWriteExt { +pub trait StateWriteExt: StateWrite + penumbra_sdk_ibc::component::ConnectionStateWriteExt { /// Writes the provided governance parameters to the JMT. fn put_governance_params(&mut self, params: GovernanceParameters) { // Change the governance parameters: @@ -618,7 +618,7 @@ pub trait StateWriteExt: StateWrite + penumbra_ibc::component::ConnectionStateWr let state = self.get_validator_state(&identity_key); let rate_data = self.get_validator_rate(&identity_key); - let power: penumbra_proto::state::future::DomainFuture< + let power: penumbra_sdk_proto::state::future::DomainFuture< Amount, ::GetRawFut, > = self.get_validator_power(&identity_key); diff --git a/crates/core/component/governance/src/delegator_vote/action.rs b/crates/core/component/governance/src/delegator_vote/action.rs index 3c801d2724..901ae72b76 100644 --- a/crates/core/component/governance/src/delegator_vote/action.rs +++ b/crates/core/component/governance/src/delegator_vote/action.rs @@ -2,12 +2,12 @@ use anyhow::Context; use crate::{vote::Vote, DelegatorVoteProof}; use decaf377_rdsa::{Signature, SpendAuth, VerificationKey}; -use penumbra_asset::Value; -use penumbra_num::Amount; -use penumbra_proto::{core::component::governance::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_tct as tct; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::Value; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct as tct; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; #[derive(Debug, Clone, Copy)] pub struct DelegatorVote { diff --git a/crates/core/component/governance/src/delegator_vote/plan.rs b/crates/core/component/governance/src/delegator_vote/plan.rs index dccd2668cc..3ab0214404 100644 --- a/crates/core/component/governance/src/delegator_vote/plan.rs +++ b/crates/core/component/governance/src/delegator_vote/plan.rs @@ -1,14 +1,14 @@ use ark_ff::Zero; use decaf377::{Fq, Fr}; use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_asset::{Balance, Value}; -use penumbra_keys::FullViewingKey; -use penumbra_num::Amount; -use penumbra_proof_params::DELEGATOR_VOTE_PROOF_PROVING_KEY; -use penumbra_proto::{core::component::governance::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::Note; -use penumbra_tct as tct; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_params::DELEGATOR_VOTE_PROOF_PROVING_KEY; +use penumbra_sdk_proto::{core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::Note; +use penumbra_sdk_tct as tct; use rand::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; diff --git a/crates/core/component/governance/src/delegator_vote/proof.rs b/crates/core/component/governance/src/delegator_vote/proof.rs index 362b270d0c..9a66e36e99 100644 --- a/crates/core/component/governance/src/delegator_vote/proof.rs +++ b/crates/core/component/governance/src/delegator_vote/proof.rs @@ -10,19 +10,19 @@ use ark_snark::SNARK; use base64::{engine::general_purpose, Engine as _}; use decaf377::{r1cs::FqVar, Bls12_377, Fq, Fr}; use decaf377_rdsa::{SpendAuth, VerificationKey}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ balance::{self, commitment::BalanceCommitmentVar, Commitment}, Value, }; -use penumbra_keys::keys::{ +use penumbra_sdk_keys::keys::{ AuthorizationKeyVar, Bip44Path, IncomingViewingKeyVar, NullifierKey, NullifierKeyVar, RandomizedVerificationKey, SeedPhrase, SpendAuthRandomizerVar, SpendKey, }; -use penumbra_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; -use penumbra_proto::{core::component::governance::v1 as pb, DomainType}; -use penumbra_sct::{Nullifier, NullifierVar}; -use penumbra_shielded_pool::{note, Note, Rseed}; -use penumbra_tct::{ +use penumbra_sdk_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_proto::{core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_sct::{Nullifier, NullifierVar}; +use penumbra_sdk_shielded_pool::{note, Note, Rseed}; +use penumbra_sdk_tct::{ self as tct, r1cs::{PositionVar, StateCommitmentVar}, Root, @@ -67,7 +67,7 @@ fn check_satisfaction( public: &DelegatorVoteProofPublic, private: &DelegatorVoteProofPrivate, ) -> Result<()> { - use penumbra_keys::keys::FullViewingKey; + use penumbra_sdk_keys::keys::FullViewingKey; let note_commitment = private.note.commit(); if note_commitment != private.state_commitment_proof.commitment() { @@ -421,10 +421,10 @@ mod tests { use super::*; use decaf377::{Fq, Fr}; - use penumbra_asset::{asset, Value}; - use penumbra_keys::keys::{SeedPhrase, SpendKey}; - use penumbra_num::Amount; - use penumbra_sct::Nullifier; + use penumbra_sdk_asset::{asset, Value}; + use penumbra_sdk_keys::keys::{SeedPhrase, SpendKey}; + use penumbra_sdk_num::Amount; + use penumbra_sdk_sct::Nullifier; use proptest::prelude::*; fn fr_strategy() -> BoxedStrategy { diff --git a/crates/core/component/governance/src/delegator_vote/view.rs b/crates/core/component/governance/src/delegator_vote/view.rs index a2120eaa5a..cb87d75105 100644 --- a/crates/core/component/governance/src/delegator_vote/view.rs +++ b/crates/core/component/governance/src/delegator_vote/view.rs @@ -1,5 +1,5 @@ -use penumbra_proto::{core::component::governance::v1 as pbt, DomainType}; -use penumbra_shielded_pool::NoteView; +use penumbra_sdk_proto::{core::component::governance::v1 as pbt, DomainType}; +use penumbra_sdk_shielded_pool::NoteView; use serde::{Deserialize, Serialize}; use crate::DelegatorVote; diff --git a/crates/core/component/governance/src/event.rs b/crates/core/component/governance/src/event.rs index 699f2bd2b4..82103fb93c 100644 --- a/crates/core/component/governance/src/event.rs +++ b/crates/core/component/governance/src/event.rs @@ -1,5 +1,5 @@ -use penumbra_proto::penumbra::core::component::governance::v1 as pb; -use penumbra_stake::IdentityKey; +use penumbra_sdk_proto::penumbra::core::component::governance::v1 as pb; +use penumbra_sdk_stake::IdentityKey; use crate::{ DelegatorVote, Proposal, ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, diff --git a/crates/core/component/governance/src/genesis.rs b/crates/core/component/governance/src/genesis.rs index 21ae4a3b51..94e3019f6f 100644 --- a/crates/core/component/governance/src/genesis.rs +++ b/crates/core/component/governance/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::GovernanceParameters; diff --git a/crates/core/component/governance/src/metrics.rs b/crates/core/component/governance/src/metrics.rs index 668c4d13b5..aff73c3131 100644 --- a/crates/core/component/governance/src/metrics.rs +++ b/crates/core/component/governance/src/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; diff --git a/crates/core/component/governance/src/params.rs b/crates/core/component/governance/src/params.rs index 54ae16bf07..a0cc9186c6 100644 --- a/crates/core/component/governance/src/params.rs +++ b/crates/core/component/governance/src/params.rs @@ -1,7 +1,7 @@ use anyhow::Context; -use penumbra_num::Amount; -use penumbra_proto::core::component::governance::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::governance::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; use crate::tally::Ratio; diff --git a/crates/core/component/governance/src/proposal.rs b/crates/core/component/governance/src/proposal.rs index 8931f2dfc1..ece4e24910 100644 --- a/crates/core/component/governance/src/proposal.rs +++ b/crates/core/component/governance/src/proposal.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use std::str::FromStr; use crate::change::ParameterChange; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; /// A governance proposal. #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/governance/src/proposal_deposit_claim/action.rs b/crates/core/component/governance/src/proposal_deposit_claim/action.rs index 310fcd0e99..424544530a 100644 --- a/crates/core/component/governance/src/proposal_deposit_claim/action.rs +++ b/crates/core/component/governance/src/proposal_deposit_claim/action.rs @@ -1,12 +1,12 @@ use serde::{Deserialize, Serialize}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset::{self, Metadata}, Balance, Value, STAKING_TOKEN_ASSET_ID, }; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use crate::proposal_state::{Outcome, Withdrawn}; diff --git a/crates/core/component/governance/src/proposal_nft.rs b/crates/core/component/governance/src/proposal_nft.rs index 81bdef11be..2dcf971edb 100644 --- a/crates/core/component/governance/src/proposal_nft.rs +++ b/crates/core/component/governance/src/proposal_nft.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use regex::Regex; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; /// Unbonding tokens represent staking tokens that are currently unbonding and /// subject to slashing. diff --git a/crates/core/component/governance/src/proposal_state.rs b/crates/core/component/governance/src/proposal_state.rs index 5525a2c29e..64d4b36412 100644 --- a/crates/core/component/governance/src/proposal_state.rs +++ b/crates/core/component/governance/src/proposal_state.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; use crate::MAX_VALIDATOR_VOTE_REASON_LENGTH; diff --git a/crates/core/component/governance/src/proposal_submit/action.rs b/crates/core/component/governance/src/proposal_submit/action.rs index 820a0e6f81..ef62e01caa 100644 --- a/crates/core/component/governance/src/proposal_submit/action.rs +++ b/crates/core/component/governance/src/proposal_submit/action.rs @@ -1,9 +1,9 @@ use serde::{Deserialize, Serialize}; -use penumbra_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use crate::proposal::Proposal; diff --git a/crates/core/component/governance/src/proposal_withdraw/action.rs b/crates/core/component/governance/src/proposal_withdraw/action.rs index 2d5b54f0d0..ce7d6beecf 100644 --- a/crates/core/component/governance/src/proposal_withdraw/action.rs +++ b/crates/core/component/governance/src/proposal_withdraw/action.rs @@ -1,9 +1,9 @@ use serde::{Deserialize, Serialize}; -use penumbra_asset::{Balance, Value}; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use crate::ProposalNft; diff --git a/crates/core/component/governance/src/state_key.rs b/crates/core/component/governance/src/state_key.rs index a97d183b64..6cf7c0c14d 100644 --- a/crates/core/component/governance/src/state_key.rs +++ b/crates/core/component/governance/src/state_key.rs @@ -1,5 +1,5 @@ -use penumbra_sct::Nullifier; -use penumbra_stake::IdentityKey; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_stake::IdentityKey; pub fn governance_params() -> &'static str { "governance/params" diff --git a/crates/core/component/governance/src/tally.rs b/crates/core/component/governance/src/tally.rs index c715081663..35c081b888 100644 --- a/crates/core/component/governance/src/tally.rs +++ b/crates/core/component/governance/src/tally.rs @@ -6,7 +6,7 @@ use std::{ str::FromStr, }; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; use crate::{ params::GovernanceParameters, diff --git a/crates/core/component/governance/src/validator_vote/action.rs b/crates/core/component/governance/src/validator_vote/action.rs index d5e69db700..38285926de 100644 --- a/crates/core/component/governance/src/validator_vote/action.rs +++ b/crates/core/component/governance/src/validator_vote/action.rs @@ -1,7 +1,7 @@ use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; -use penumbra_stake::{GovernanceKey, IdentityKey}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_stake::{GovernanceKey, IdentityKey}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::{vote::Vote, MAX_VALIDATOR_VOTE_REASON_LENGTH}; diff --git a/crates/core/component/governance/src/vote.rs b/crates/core/component/governance/src/vote.rs index 1ddf27723d..31df6c2f4d 100644 --- a/crates/core/component/governance/src/vote.rs +++ b/crates/core/component/governance/src/vote.rs @@ -4,7 +4,7 @@ use std::{ }; use anyhow::anyhow; -use penumbra_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::governance::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// A vote on a proposal. diff --git a/crates/core/component/governance/src/voting_receipt_token.rs b/crates/core/component/governance/src/voting_receipt_token.rs index a761f223dc..71b5b7034e 100644 --- a/crates/core/component/governance/src/voting_receipt_token.rs +++ b/crates/core/component/governance/src/voting_receipt_token.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use regex::Regex; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; /// Unbonding tokens represent staking tokens that are currently unbonding and /// subject to slashing. diff --git a/crates/core/component/ibc/src/component/channel.rs b/crates/core/component/ibc/src/component/channel.rs index 490f804737..fbb3362764 100644 --- a/crates/core/component/ibc/src/component/channel.rs +++ b/crates/core/component/ibc/src/component/channel.rs @@ -11,7 +11,7 @@ use ibc_types::path::{ use cnidarium::{StateRead, StateWrite}; use ibc_types::core::channel::{ChannelEnd, ChannelId, Packet, PortId}; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; // Note: many of the methods on this trait need to write raw bytes, // because the data they write is interpreted by counterparty chains. diff --git a/crates/core/component/ibc/src/component/client.rs b/crates/core/component/ibc/src/component/client.rs index aa1ce26c4f..a21347e89f 100644 --- a/crates/core/component/ibc/src/component/client.rs +++ b/crates/core/component/ibc/src/component/client.rs @@ -17,7 +17,7 @@ use ibc_types::lightclients::tendermint::{ consensus_state::ConsensusState as TendermintConsensusState, header::Header as TendermintHeader, }; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use crate::component::client_counter::{ClientCounter, VerifiedHeights}; use crate::prefix::MerklePrefixExt; @@ -216,14 +216,14 @@ pub trait StateWriteExt: StateWrite + StateReadExt { format!( // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. - "penumbra_verified_heights/{client_id}/verified_heights" + "penumbra_sdk_verified_heights/{client_id}/verified_heights" ), verified_heights, ); } // returns the ConsensusState for the penumbra chain (this chain) at the given height - fn put_penumbra_consensus_state( + fn put_penumbra_sdk_consensus_state( &mut self, height: Height, consensus_state: TendermintConsensusState, @@ -231,7 +231,7 @@ pub trait StateWriteExt: StateWrite + StateReadExt { // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. self.put( - format!("penumbra_consensus_states/{height}"), + format!("penumbra_sdk_consensus_states/{height}"), consensus_state, ); } @@ -324,19 +324,19 @@ pub trait StateReadExt: StateRead { self.get(&format!( // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. - "penumbra_verified_heights/{client_id}/verified_heights" + "penumbra_sdk_verified_heights/{client_id}/verified_heights" )) .await } // returns the ConsensusState for the penumbra chain (this chain) at the given height - async fn get_penumbra_consensus_state( + async fn get_penumbra_sdk_consensus_state( &self, height: Height, ) -> Result { // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. - self.get(&format!("penumbra_consensus_states/{height}")) + self.get(&format!("penumbra_sdk_consensus_states/{height}")) .await? .ok_or_else(|| { anyhow::anyhow!("penumbra consensus state not found for height {height}") @@ -466,7 +466,7 @@ mod tests { use cnidarium::{ArcStateDeltaExt, StateDelta}; use ibc_types::core::client::msgs::MsgUpdateClient; use ibc_types::{core::client::msgs::MsgCreateClient, DomainType}; - use penumbra_sct::component::clock::{EpochManager as _, EpochRead}; + use penumbra_sdk_sct::component::clock::{EpochManager as _, EpochRead}; use std::str::FromStr; use tendermint::Time; @@ -588,7 +588,7 @@ mod tests { // test that we can create and update a light client. #[tokio::test] async fn test_create_and_update_light_client() -> anyhow::Result<()> { - use penumbra_sct::epoch::Epoch; + use penumbra_sdk_sct::epoch::Epoch; // create a storage backend for testing // TODO(erwan): `apply_default_genesis` is not available here. We need a component diff --git a/crates/core/component/ibc/src/component/client_counter.rs b/crates/core/component/ibc/src/component/client_counter.rs index 3459c32952..f9f1d671db 100644 --- a/crates/core/component/ibc/src/component/client_counter.rs +++ b/crates/core/component/ibc/src/component/client_counter.rs @@ -1,6 +1,6 @@ use ibc_types::core::client::Height; use ibc_types::core::connection::ConnectionId; -use penumbra_proto::{penumbra::core::component::ibc::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::ibc::v1 as pb, DomainType}; #[derive(Clone, Debug)] pub struct ClientCounter(pub u64); diff --git a/crates/core/component/ibc/src/component/connection.rs b/crates/core/component/ibc/src/component/connection.rs index f19fc2b478..9b5eb17939 100644 --- a/crates/core/component/ibc/src/component/connection.rs +++ b/crates/core/component/ibc/src/component/connection.rs @@ -9,7 +9,7 @@ use ibc_types::{ }, path::{ClientConnectionPath, ConnectionPath}, }; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use crate::{prefix::MerklePrefixExt, IBC_COMMITMENT_PREFIX}; diff --git a/crates/core/component/ibc/src/component/connection_counter.rs b/crates/core/component/ibc/src/component/connection_counter.rs index c885ecef43..2174e5b7bb 100644 --- a/crates/core/component/ibc/src/component/connection_counter.rs +++ b/crates/core/component/ibc/src/component/connection_counter.rs @@ -1,6 +1,6 @@ use ibc_types::core::connection::Version; use once_cell::sync::Lazy; -use penumbra_proto::{penumbra::core::component::ibc::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::ibc::v1 as pb, DomainType}; #[derive(Debug, Clone)] pub struct ConnectionCounter(pub u64); diff --git a/crates/core/component/ibc/src/component/ibc_component.rs b/crates/core/component/ibc/src/component/ibc_component.rs index 8e5488cd73..c2e9ee719f 100644 --- a/crates/core/component/ibc/src/component/ibc_component.rs +++ b/crates/core/component/ibc/src/component/ibc_component.rs @@ -61,7 +61,7 @@ impl Ibc { ) .expect("block height cannot be zero"); - state.put_penumbra_consensus_state(height, cs); + state.put_penumbra_sdk_consensus_state(height, cs); } #[instrument(name = "ibc", skip(_state, _end_block))] diff --git a/crates/core/component/ibc/src/component/ics02_validation.rs b/crates/core/component/ibc/src/component/ics02_validation.rs index c117f50517..a8aa7739a6 100644 --- a/crates/core/component/ibc/src/component/ics02_validation.rs +++ b/crates/core/component/ibc/src/component/ics02_validation.rs @@ -82,7 +82,7 @@ pub fn get_tendermint_client_state(client_state: Any) -> Result(&state, self).await?; // verify that the client state is well formed - penumbra_client_state_is_well_formed::<&S, HI>(&state, self).await?; + penumbra_sdk_client_state_is_well_formed::<&S, HI>(&state, self).await?; // verify the previous connection that we're ACKing is in the correct state let connection = verify_previous_connection(&state, self).await?; @@ -131,7 +131,7 @@ impl MsgHandler for MsgConnectionOpenAck { .context("couldn't verify client state")?; let expected_consensus = state - .get_penumbra_consensus_state(self.consensus_height_of_a_on_b) + .get_penumbra_sdk_consensus_state(self.consensus_height_of_a_on_b) .await?; // 3. verify that the counterparty chain stored the correct consensus state of Penumbra at @@ -204,13 +204,13 @@ async fn consensus_height_is_correct( Ok(()) } -async fn penumbra_client_state_is_well_formed( +async fn penumbra_sdk_client_state_is_well_formed( state: S, msg: &MsgConnectionOpenAck, ) -> anyhow::Result<()> { let height = HI::get_block_height(&state).await?; let chain_id = HI::get_chain_id(&state).await?; - validate_penumbra_client_state(msg.client_state_of_a_on_b.clone(), &chain_id, height)?; + validate_penumbra_sdk_client_state(msg.client_state_of_a_on_b.clone(), &chain_id, height)?; Ok(()) } diff --git a/crates/core/component/ibc/src/component/msg_handler/connection_open_try.rs b/crates/core/component/ibc/src/component/msg_handler/connection_open_try.rs index f9b85c836e..bd8dd8cabe 100644 --- a/crates/core/component/ibc/src/component/msg_handler/connection_open_try.rs +++ b/crates/core/component/ibc/src/component/msg_handler/connection_open_try.rs @@ -18,7 +18,7 @@ use crate::component::{ client::StateReadExt as _, connection::{StateReadExt as _, StateWriteExt as _}, connection_counter::SUPPORTED_VERSIONS, - ics02_validation::validate_penumbra_client_state, + ics02_validation::validate_penumbra_sdk_client_state, MsgHandler, }; @@ -53,7 +53,7 @@ impl MsgHandler for MsgConnectionOpenTry { // verify that the client state (which is a Penumbra client) is well-formed for a // penumbra client. - penumbra_client_state_is_well_formed::<&S, HI>(&mut state, self).await?; + penumbra_sdk_client_state_is_well_formed::<&S, HI>(&mut state, self).await?; // TODO(erwan): how to handle this with ibc-rs@0.23.0? // if this msg provides a previous_connection_id to resume from, then check that the @@ -134,7 +134,7 @@ impl MsgHandler for MsgConnectionOpenTry { .context("couldn't verify client state")?; let expected_consensus = state - .get_penumbra_consensus_state(self.consensus_height_of_b_on_a) + .get_penumbra_sdk_consensus_state(self.consensus_height_of_b_on_a) .await?; // 3. verify that the counterparty chain stored the correct consensus state of Penumbra at @@ -210,13 +210,13 @@ async fn consensus_height_is_correct( Ok(()) } -async fn penumbra_client_state_is_well_formed( +async fn penumbra_sdk_client_state_is_well_formed( state: S, msg: &MsgConnectionOpenTry, ) -> anyhow::Result<()> { let height = HI::get_block_height(&state).await?; let chain_id = HI::get_chain_id(&state).await?; - validate_penumbra_client_state(msg.client_state_of_b_on_a.clone(), &chain_id, height)?; + validate_penumbra_sdk_client_state(msg.client_state_of_b_on_a.clone(), &chain_id, height)?; Ok(()) } diff --git a/crates/core/component/ibc/src/component/state_key.rs b/crates/core/component/ibc/src/component/state_key.rs index 98b8b2add7..16b73f1da0 100644 --- a/crates/core/component/ibc/src/component/state_key.rs +++ b/crates/core/component/ibc/src/component/state_key.rs @@ -20,7 +20,7 @@ pub fn counter() -> &'static str { pub mod ics20_value_balance { use ibc_types::core::channel::ChannelId; - use penumbra_asset::asset; + use penumbra_sdk_asset::asset; pub fn prefix() -> &'static str { "ibc/ics20-value-balance/" diff --git a/crates/core/component/ibc/src/component/view.rs b/crates/core/component/ibc/src/component/view.rs index 1b40d237e8..188eb724a3 100644 --- a/crates/core/component/ibc/src/component/view.rs +++ b/crates/core/component/ibc/src/component/view.rs @@ -1,7 +1,7 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use crate::params::IBCParameters; diff --git a/crates/core/component/ibc/src/genesis.rs b/crates/core/component/ibc/src/genesis.rs index 612cdad140..113ccd66d0 100644 --- a/crates/core/component/ibc/src/genesis.rs +++ b/crates/core/component/ibc/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::ibc::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::ibc::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::IBCParameters; diff --git a/crates/core/component/ibc/src/ibc_action.rs b/crates/core/component/ibc/src/ibc_action.rs index 1047f70024..d2504118a4 100644 --- a/crates/core/component/ibc/src/ibc_action.rs +++ b/crates/core/component/ibc/src/ibc_action.rs @@ -31,9 +31,9 @@ use ibc_types::core::{ use ibc_types::DomainType as IbcTypesDomainType; -use penumbra_proto::penumbra::core::component::ibc::v1::{self as pb}; -use penumbra_proto::{DomainType, Name}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_proto::penumbra::core::component::ibc::v1::{self as pb}; +use penumbra_sdk_proto::{DomainType, Name}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/crates/core/component/ibc/src/ibc_token.rs b/crates/core/component/ibc/src/ibc_token.rs index 09b26c6264..3143d8f31d 100644 --- a/crates/core/component/ibc/src/ibc_token.rs +++ b/crates/core/component/ibc/src/ibc_token.rs @@ -1,5 +1,5 @@ use ibc_types::core::channel::{ChannelId, PortId}; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; /// IBC token represents a token that was created through IBC. #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/core/component/ibc/src/params.rs b/crates/core/component/ibc/src/params.rs index 4894e9b95c..631ada5ce3 100644 --- a/crates/core/component/ibc/src/params.rs +++ b/crates/core/component/ibc/src/params.rs @@ -1,5 +1,5 @@ -use penumbra_proto::core::component::ibc::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::core::component::ibc::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/sct/src/component/clock.rs b/crates/core/component/sct/src/component/clock.rs index e74b1aec84..593c07d852 100644 --- a/crates/core/component/sct/src/component/clock.rs +++ b/crates/core/component/sct/src/component/clock.rs @@ -2,7 +2,7 @@ use crate::{epoch::Epoch, state_key}; use anyhow::{anyhow, Context, Result}; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use std::str::FromStr; #[async_trait] diff --git a/crates/core/component/sct/src/component/rpc.rs b/crates/core/component/sct/src/component/rpc.rs index 7a33abce3e..ae8f6ee034 100644 --- a/crates/core/component/sct/src/component/rpc.rs +++ b/crates/core/component/sct/src/component/rpc.rs @@ -1,7 +1,7 @@ use cnidarium::Storage; use pbjson_types::Timestamp; -use penumbra_proto::core::component::sct::v1::query_service_server::QueryService; -use penumbra_proto::core::component::sct::v1::{ +use penumbra_sdk_proto::core::component::sct::v1::query_service_server::QueryService; +use penumbra_sdk_proto::core::component::sct::v1::{ AnchorByHeightRequest, AnchorByHeightResponse, EpochByHeightRequest, EpochByHeightResponse, TimestampByHeightRequest, TimestampByHeightResponse, }; diff --git a/crates/core/component/sct/src/component/sct.rs b/crates/core/component/sct/src/component/sct.rs index a209ea6ad1..42561e2cde 100644 --- a/crates/core/component/sct/src/component/sct.rs +++ b/crates/core/component/sct/src/component/sct.rs @@ -4,7 +4,7 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use cnidarium_component::Component; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use tendermint::v0_37::abci; use tracing::instrument; diff --git a/crates/core/component/sct/src/component/tree.rs b/crates/core/component/sct/src/component/tree.rs index 9bbd83e263..296608a73b 100644 --- a/crates/core/component/sct/src/component/tree.rs +++ b/crates/core/component/sct/src/component/tree.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_proto::{DomainType as _, StateReadProto, StateWriteProto}; -use penumbra_tct as tct; +use penumbra_sdk_proto::{DomainType as _, StateReadProto, StateWriteProto}; +use penumbra_sdk_tct as tct; use tct::builder::{block, epoch}; use tracing::instrument; diff --git a/crates/core/component/sct/src/epoch.rs b/crates/core/component/sct/src/epoch.rs index 0655fb88c1..cdf457a8f9 100644 --- a/crates/core/component/sct/src/epoch.rs +++ b/crates/core/component/sct/src/epoch.rs @@ -1,5 +1,5 @@ -use penumbra_proto::penumbra::core::component::sct::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::penumbra::core::component::sct::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Copy, Clone, Serialize, Deserialize)] diff --git a/crates/core/component/sct/src/event.rs b/crates/core/component/sct/src/event.rs index 43bef0da20..6f31b6f879 100644 --- a/crates/core/component/sct/src/event.rs +++ b/crates/core/component/sct/src/event.rs @@ -1,9 +1,9 @@ use anyhow::{anyhow, Context as _}; use pbjson_types::Timestamp; -use penumbra_tct as tct; +use penumbra_sdk_tct as tct; use tct::builder::{block, epoch}; -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::sct::v1::{self as pb}, DomainType, Name as _, }; diff --git a/crates/core/component/sct/src/genesis.rs b/crates/core/component/sct/src/genesis.rs index cb99600664..0d1ac952f5 100644 --- a/crates/core/component/sct/src/genesis.rs +++ b/crates/core/component/sct/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::sct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::sct::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::SctParameters; diff --git a/crates/core/component/sct/src/nullification_info.rs b/crates/core/component/sct/src/nullification_info.rs index b09be69cea..f0176c5dcb 100644 --- a/crates/core/component/sct/src/nullification_info.rs +++ b/crates/core/component/sct/src/nullification_info.rs @@ -1,5 +1,5 @@ use anyhow::anyhow; -use penumbra_proto::{core::component::sct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::component::sct::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/sct/src/nullifier.rs b/crates/core/component/sct/src/nullifier.rs index 3b96c84f9b..35ac2d66c5 100644 --- a/crates/core/component/sct/src/nullifier.rs +++ b/crates/core/component/sct/src/nullifier.rs @@ -1,13 +1,13 @@ use ark_r1cs_std::prelude::*; use ark_relations::r1cs::SynthesisError; use decaf377::{r1cs::FqVar, Fq}; -use penumbra_tct as tct; -use penumbra_tct::{r1cs::StateCommitmentVar, StateCommitment}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_tct::{r1cs::StateCommitmentVar, StateCommitment}; use poseidon377::hash_3; use once_cell::sync::Lazy; -use penumbra_keys::keys::{NullifierKey, NullifierKeyVar}; -use penumbra_proto::{core::component::sct::v1 as pb, DomainType}; +use penumbra_sdk_keys::keys::{NullifierKey, NullifierKeyVar}; +use penumbra_sdk_proto::{core::component::sct::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; #[derive(PartialEq, Eq, Clone, Copy, Hash, PartialOrd, Ord, Serialize, Deserialize)] @@ -68,7 +68,7 @@ impl Nullifier { /// and [`Commitment`]. pub fn derive( nk: &NullifierKey, - pos: penumbra_tct::Position, + pos: penumbra_sdk_tct::Position, state_commitment: &StateCommitment, ) -> Nullifier { Nullifier(hash_3( diff --git a/crates/core/component/sct/src/params.rs b/crates/core/component/sct/src/params.rs index e5acf500eb..6438e5ef48 100644 --- a/crates/core/component/sct/src/params.rs +++ b/crates/core/component/sct/src/params.rs @@ -1,5 +1,5 @@ -use penumbra_proto::penumbra::core::component::sct::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::penumbra::core::component::sct::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/sct/src/source.rs b/crates/core/component/sct/src/source.rs index 2c8370c3f3..39af1ca0c7 100644 --- a/crates/core/component/sct/src/source.rs +++ b/crates/core/component/sct/src/source.rs @@ -1,5 +1,5 @@ use anyhow::anyhow; -use penumbra_proto::{core::component::sct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::component::sct::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; #[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)] diff --git a/crates/core/component/sct/src/state_key.rs b/crates/core/component/sct/src/state_key.rs index 93a32120cb..bf2c4fb2c8 100644 --- a/crates/core/component/sct/src/state_key.rs +++ b/crates/core/component/sct/src/state_key.rs @@ -49,7 +49,7 @@ pub mod tree { format!("sct/tree/anchor_by_height/{}", height) } - pub fn anchor_lookup(anchor: penumbra_tct::Root) -> String { + pub fn anchor_lookup(anchor: penumbra_sdk_tct::Root) -> String { format!("sct/tree/anchor_lookup/{}", anchor) } @@ -57,7 +57,7 @@ pub mod tree { "sct/tree/state_commitment_tree" } - pub fn note_source(note_commitment: &penumbra_tct::StateCommitment) -> String { + pub fn note_source(note_commitment: &penumbra_sdk_tct::StateCommitment) -> String { format!("sct/tree/note_source/{}", note_commitment) } } diff --git a/crates/core/component/shielded-pool/src/backref.rs b/crates/core/component/shielded-pool/src/backref.rs index 7eef7f4d96..a94db09ff8 100644 --- a/crates/core/component/shielded-pool/src/backref.rs +++ b/crates/core/component/shielded-pool/src/backref.rs @@ -4,9 +4,9 @@ use chacha20poly1305::{ ChaCha20Poly1305, Nonce, }; -use penumbra_keys::BackreferenceKey; -use penumbra_sct::Nullifier; -use penumbra_tct as tct; +use penumbra_sdk_keys::BackreferenceKey; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct as tct; pub const ENCRYPTED_BACKREF_LEN: usize = 48; @@ -133,8 +133,8 @@ mod tests { use super::*; use proptest::prelude::*; - use penumbra_asset::{asset, Value}; - use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; + use penumbra_sdk_asset::{asset, Value}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; use crate::{Note, Rseed}; @@ -159,7 +159,7 @@ mod tests { let rseed = Rseed(rseed_randomness); let note = Note::from_parts(sender, value_to_send, rseed).expect("valid note"); - let note_commitment: penumbra_tct::StateCommitment = note.commit(); + let note_commitment: penumbra_sdk_tct::StateCommitment = note.commit(); let nk = *sk.nullifier_key(); let mut sct = tct::Tree::new(); @@ -198,7 +198,7 @@ mod tests { let rseed = Rseed(rseed_randomness); let note = Note::from_parts(sender, value_to_send, rseed).expect("valid note"); - let note_commitment: penumbra_tct::StateCommitment = note.commit(); + let note_commitment: penumbra_sdk_tct::StateCommitment = note.commit(); let nk = *sk.nullifier_key(); let mut sct = tct::Tree::new(); diff --git a/crates/core/component/shielded-pool/src/component/action_handler/ics20_withdrawal.rs b/crates/core/component/shielded-pool/src/component/action_handler/ics20_withdrawal.rs index ddc3f7d12c..0bd0b17c27 100644 --- a/crates/core/component/shielded-pool/src/component/action_handler/ics20_withdrawal.rs +++ b/crates/core/component/shielded-pool/src/component/action_handler/ics20_withdrawal.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::{ensure, Result}; use cnidarium::{StateRead, StateWrite}; -use penumbra_ibc::{component::HostInterface, StateReadExt as _}; +use penumbra_sdk_ibc::{component::HostInterface, StateReadExt as _}; use crate::component::transfer::{Ics20TransferReadExt as _, Ics20TransferWriteExt as _}; use crate::component::Ics20WithdrawalWithHandler; diff --git a/crates/core/component/shielded-pool/src/component/action_handler/output.rs b/crates/core/component/shielded-pool/src/component/action_handler/output.rs index 18a4515c9f..d9b6049989 100644 --- a/crates/core/component/shielded-pool/src/component/action_handler/output.rs +++ b/crates/core/component/shielded-pool/src/component/action_handler/output.rs @@ -2,9 +2,9 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_proof_params::OUTPUT_PROOF_VERIFICATION_KEY; -use penumbra_proto::{DomainType as _, StateWriteProto as _}; -use penumbra_sct::component::source::SourceContext; +use penumbra_sdk_proof_params::OUTPUT_PROOF_VERIFICATION_KEY; +use penumbra_sdk_proto::{DomainType as _, StateWriteProto as _}; +use penumbra_sdk_sct::component::source::SourceContext; use crate::{component::NoteManager, event, output::OutputProofPublic, Output}; diff --git a/crates/core/component/shielded-pool/src/component/action_handler/spend.rs b/crates/core/component/shielded-pool/src/component/action_handler/spend.rs index b3da310650..13263c4671 100644 --- a/crates/core/component/shielded-pool/src/component/action_handler/spend.rs +++ b/crates/core/component/shielded-pool/src/component/action_handler/spend.rs @@ -2,13 +2,13 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_proof_params::SPEND_PROOF_VERIFICATION_KEY; -use penumbra_proto::{DomainType, StateWriteProto as _}; -use penumbra_sct::component::{ +use penumbra_sdk_proof_params::SPEND_PROOF_VERIFICATION_KEY; +use penumbra_sdk_proto::{DomainType, StateWriteProto as _}; +use penumbra_sdk_sct::component::{ source::SourceContext, tree::{SctManager, VerificationExt}, }; -use penumbra_txhash::TransactionContext; +use penumbra_sdk_txhash::TransactionContext; use crate::{event, Spend, SpendProofPublic}; diff --git a/crates/core/component/shielded-pool/src/component/assets.rs b/crates/core/component/shielded-pool/src/component/assets.rs index e56207e036..c71771b58f 100644 --- a/crates/core/component/shielded-pool/src/component/assets.rs +++ b/crates/core/component/shielded-pool/src/component/assets.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; -use penumbra_asset::asset::{self, Metadata}; -use penumbra_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_asset::asset::{self, Metadata}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; use tracing::instrument; diff --git a/crates/core/component/shielded-pool/src/component/fmd.rs b/crates/core/component/shielded-pool/src/component/fmd.rs index 2675955659..3363862d79 100644 --- a/crates/core/component/shielded-pool/src/component/fmd.rs +++ b/crates/core/component/shielded-pool/src/component/fmd.rs @@ -2,11 +2,11 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use decaf377_fmd::Clue; -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::shielded_pool::v1::{self as pb}, StateWriteProto, }; -use penumbra_txhash::TransactionId; +use penumbra_sdk_txhash::TransactionId; use crate::fmd::state_key; diff --git a/crates/core/component/shielded-pool/src/component/ics20_withdrawal_with_handler.rs b/crates/core/component/shielded-pool/src/component/ics20_withdrawal_with_handler.rs index cee833da45..587e17b8e7 100644 --- a/crates/core/component/shielded-pool/src/component/ics20_withdrawal_with_handler.rs +++ b/crates/core/component/shielded-pool/src/component/ics20_withdrawal_with_handler.rs @@ -1,5 +1,5 @@ use crate::Ics20Withdrawal; -use penumbra_ibc::component::HostInterface; +use penumbra_sdk_ibc::component::HostInterface; use std::marker::PhantomData; pub struct Ics20WithdrawalWithHandler(Ics20Withdrawal, PhantomData); diff --git a/crates/core/component/shielded-pool/src/component/metrics.rs b/crates/core/component/shielded-pool/src/component/metrics.rs index 668c4d13b5..aff73c3131 100644 --- a/crates/core/component/shielded-pool/src/component/metrics.rs +++ b/crates/core/component/shielded-pool/src/component/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; diff --git a/crates/core/component/shielded-pool/src/component/note_manager.rs b/crates/core/component/shielded-pool/src/component/note_manager.rs index a4d13ef343..a8d1153ce3 100644 --- a/crates/core/component/shielded-pool/src/component/note_manager.rs +++ b/crates/core/component/shielded-pool/src/component/note_manager.rs @@ -1,11 +1,11 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_asset::Value; -use penumbra_keys::Address; -use penumbra_sct::component::tree::{SctManager, SctRead}; -use penumbra_sct::CommitmentSource; -use penumbra_tct as tct; +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::Address; +use penumbra_sdk_sct::component::tree::{SctManager, SctRead}; +use penumbra_sdk_sct::CommitmentSource; +use penumbra_sdk_tct as tct; use tct::StateCommitment; use tracing::instrument; diff --git a/crates/core/component/shielded-pool/src/component/rpc.rs b/crates/core/component/shielded-pool/src/component/rpc.rs index 01c9558f1a..aa7c4551a3 100644 --- a/crates/core/component/shielded-pool/src/component/rpc.rs +++ b/crates/core/component/shielded-pool/src/component/rpc.rs @@ -1,8 +1,8 @@ use std::pin::Pin; use cnidarium::Storage; -use penumbra_asset::asset::{self}; -use penumbra_proto::core::component::shielded_pool::v1::{ +use penumbra_sdk_asset::asset::{self}; +use penumbra_sdk_proto::core::component::shielded_pool::v1::{ query_service_server::QueryService, AssetMetadataByIdRequest, AssetMetadataByIdResponse, AssetMetadataByIdsRequest, AssetMetadataByIdsResponse, }; diff --git a/crates/core/component/shielded-pool/src/component/rpc/bank_query.rs b/crates/core/component/shielded-pool/src/component/rpc/bank_query.rs index a675402ecd..9d16a4332f 100644 --- a/crates/core/component/shielded-pool/src/component/rpc/bank_query.rs +++ b/crates/core/component/shielded-pool/src/component/rpc/bank_query.rs @@ -17,10 +17,10 @@ use ibc_proto::cosmos::bank::v1beta1::{ QuerySpendableBalanceByDenomResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, }; -use penumbra_asset::asset::{self, Metadata}; -use penumbra_ibc::component::state_key as ibc_state_key; -use penumbra_num::Amount; -use penumbra_proto::StateReadProto as _; +use penumbra_sdk_asset::asset::{self, Metadata}; +use penumbra_sdk_ibc::component::state_key as ibc_state_key; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::StateReadProto as _; use tracing::instrument; use crate::component::AssetRegistryRead as _; diff --git a/crates/core/component/shielded-pool/src/component/rpc/transfer_query.rs b/crates/core/component/shielded-pool/src/component/rpc/transfer_query.rs index 700faafe5c..b3ae1097a2 100644 --- a/crates/core/component/shielded-pool/src/component/rpc/transfer_query.rs +++ b/crates/core/component/shielded-pool/src/component/rpc/transfer_query.rs @@ -8,8 +8,8 @@ use ibc_proto::ibc::apps::transfer::v1::{ QueryEscrowAddressRequest, QueryEscrowAddressResponse, QueryParamsRequest, QueryParamsResponse, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponse, }; -use penumbra_asset::asset::Metadata; -use penumbra_proto::StateReadProto as _; +use penumbra_sdk_asset::asset::Metadata; +use penumbra_sdk_proto::StateReadProto as _; use crate::state_key; diff --git a/crates/core/component/shielded-pool/src/component/shielded_pool.rs b/crates/core/component/shielded-pool/src/component/shielded_pool.rs index 399922901c..2a3bbdb6b2 100644 --- a/crates/core/component/shielded-pool/src/component/shielded_pool.rs +++ b/crates/core/component/shielded-pool/src/component/shielded_pool.rs @@ -9,9 +9,9 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use cnidarium_component::Component; -use penumbra_proto::StateReadProto as _; -use penumbra_proto::StateWriteProto as _; -use penumbra_sct::CommitmentSource; +use penumbra_sdk_proto::StateReadProto as _; +use penumbra_sdk_proto::StateWriteProto as _; +use penumbra_sdk_sct::CommitmentSource; use tendermint::v0_37::abci; use tracing::instrument; diff --git a/crates/core/component/shielded-pool/src/component/transfer.rs b/crates/core/component/shielded-pool/src/component/transfer.rs index 88c0e799ab..704412cfd0 100644 --- a/crates/core/component/shielded-pool/src/component/transfer.rs +++ b/crates/core/component/shielded-pool/src/component/transfer.rs @@ -21,17 +21,17 @@ use ibc_types::{ }, transfer::acknowledgement::TokenTransferAcknowledgement, }; -use penumbra_asset::{asset, asset::Metadata, Value}; -use penumbra_ibc::component::ChannelStateReadExt; -use penumbra_keys::Address; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_asset::{asset, asset::Metadata, Value}; +use penumbra_sdk_ibc::component::ChannelStateReadExt; +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ penumbra::core::component::ibc::v1::FungibleTokenPacketData, DomainType as _, StateReadProto, StateWriteProto, }; -use penumbra_sct::CommitmentSource; +use penumbra_sdk_sct::CommitmentSource; -use penumbra_ibc::component::{ +use penumbra_sdk_ibc::component::{ app_handler::{AppHandler, AppHandlerCheck, AppHandlerExecute}, packet::{ IBCPacket, SendPacketRead as _, SendPacketWrite as _, Unchecked, WriteAcknowledgement as _, diff --git a/crates/core/component/shielded-pool/src/convert.rs b/crates/core/component/shielded-pool/src/convert.rs index 5e9f2f6bb1..a5fa03cdc9 100644 --- a/crates/core/component/shielded-pool/src/convert.rs +++ b/crates/core/component/shielded-pool/src/convert.rs @@ -8,16 +8,16 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_snark::SNARK; use base64::prelude::*; use decaf377::{Bls12_377, Fq, Fr}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset::{self, AssetIdVar}, balance::{self, commitment::BalanceCommitmentVar, BalanceVar}, Balance, Value, ValueVar, STAKING_TOKEN_ASSET_ID, }; -use penumbra_num::{ +use penumbra_sdk_num::{ fixpoint::{U128x128, U128x128Var}, Amount, AmountVar, }; -use penumbra_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; /// The public input for a [`ConvertProof`]. #[derive(Clone, Debug)] diff --git a/crates/core/component/shielded-pool/src/event.rs b/crates/core/component/shielded-pool/src/event.rs index e0f14b67fa..e8065bd288 100644 --- a/crates/core/component/shielded-pool/src/event.rs +++ b/crates/core/component/shielded-pool/src/event.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Context}; -use penumbra_asset::Value; -use penumbra_keys::Address; -use penumbra_proto::{core::component::shielded_pool::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::{core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; use prost::Name as _; use crate::note::StateCommitment; diff --git a/crates/core/component/shielded-pool/src/fmd.rs b/crates/core/component/shielded-pool/src/fmd.rs index eb2fa46bdd..0f46e25719 100644 --- a/crates/core/component/shielded-pool/src/fmd.rs +++ b/crates/core/component/shielded-pool/src/fmd.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Result}; use decaf377_fmd::Precision; -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::shielded_pool::v1::{self as pb}, DomainType, }; diff --git a/crates/core/component/shielded-pool/src/genesis.rs b/crates/core/component/shielded-pool/src/genesis.rs index 54e10da0d4..35f4998411 100644 --- a/crates/core/component/shielded-pool/src/genesis.rs +++ b/crates/core/component/shielded-pool/src/genesis.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; mod allocation; @@ -57,7 +57,7 @@ impl Default for Content { raw_denom: "penumbra" .parse() .expect("hardcoded \"penumbra\" denom should be parseable"), - address: penumbra_keys::test_keys::ADDRESS_0_STR + address: penumbra_sdk_keys::test_keys::ADDRESS_0_STR .parse() .expect("hardcoded test address should be valid"), }, @@ -66,7 +66,7 @@ impl Default for Content { raw_denom: "test_usd" .parse() .expect("hardcoded \"test_usd\" denom should be parseable"), - address: penumbra_keys::test_keys::ADDRESS_0_STR + address: penumbra_sdk_keys::test_keys::ADDRESS_0_STR .parse() .expect("hardcoded test address should be valid"), }, @@ -75,7 +75,7 @@ impl Default for Content { raw_denom: "gm" .parse() .expect("hardcoded \"gm\" denom should be parseable"), - address: penumbra_keys::test_keys::ADDRESS_1_STR + address: penumbra_sdk_keys::test_keys::ADDRESS_1_STR .parse() .expect("hardcoded test address should be valid"), }, @@ -84,7 +84,7 @@ impl Default for Content { raw_denom: "gn" .parse() .expect("hardcoded \"gn\" denom should be parseable"), - address: penumbra_keys::test_keys::ADDRESS_1_STR + address: penumbra_sdk_keys::test_keys::ADDRESS_1_STR .parse() .expect("hardcoded test address should be valid"), }, diff --git a/crates/core/component/shielded-pool/src/genesis/allocation.rs b/crates/core/component/shielded-pool/src/genesis/allocation.rs index d5e12fb807..43132ef507 100644 --- a/crates/core/component/shielded-pool/src/genesis/allocation.rs +++ b/crates/core/component/shielded-pool/src/genesis/allocation.rs @@ -1,10 +1,10 @@ -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset::{self, Metadata, Unit}, Value, }; -use penumbra_keys::Address; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// A (transparent) genesis allocation. diff --git a/crates/core/component/shielded-pool/src/ics20_withdrawal.rs b/crates/core/component/shielded-pool/src/ics20_withdrawal.rs index ed95901dac..847a38201b 100644 --- a/crates/core/component/shielded-pool/src/ics20_withdrawal.rs +++ b/crates/core/component/shielded-pool/src/ics20_withdrawal.rs @@ -1,20 +1,20 @@ use ibc_types::core::{channel::ChannelId, channel::PortId, client::Height as IbcHeight}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ asset::{self, Metadata}, Balance, Value, }; -use penumbra_keys::Address; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ penumbra::core::component::ibc::v1::{self as pb, FungibleTokenPacketData}, DomainType, }; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use std::str::FromStr; #[cfg(feature = "component")] -use penumbra_ibc::component::packet::{IBCPacket, Unchecked}; +use penumbra_sdk_ibc::component::packet::{IBCPacket, Unchecked}; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(try_from = "pb::Ics20Withdrawal", into = "pb::Ics20Withdrawal")] diff --git a/crates/core/component/shielded-pool/src/note.rs b/crates/core/component/shielded-pool/src/note.rs index 2f9a24c5d4..fe972b8466 100644 --- a/crates/core/component/shielded-pool/src/note.rs +++ b/crates/core/component/shielded-pool/src/note.rs @@ -6,12 +6,12 @@ use decaf377::Fq; use decaf377_fmd as fmd; use decaf377_ka as ka; use once_cell::sync::Lazy; -use penumbra_keys::{ +use penumbra_sdk_keys::{ keys::{Diversifier, FullViewingKey, IncomingViewingKey, OutgoingViewingKey}, symmetric::{OutgoingCipherKey, OvkWrappedKey, PayloadKey, PayloadKind}, Address, AddressView, }; -use penumbra_proto::penumbra::core::component::shielded_pool::v1 as pb; +use penumbra_sdk_proto::penumbra::core::component::shielded_pool::v1 as pb; use rand::{CryptoRng, Rng}; use serde::{Deserialize, Serialize}; use thiserror; @@ -19,10 +19,10 @@ use thiserror; mod r1cs; pub use r1cs::NoteVar; -pub use penumbra_tct::StateCommitment; +pub use penumbra_sdk_tct::StateCommitment; -use penumbra_asset::{asset, balance, Value, ValueView}; -use penumbra_num::Amount; +use penumbra_sdk_asset::{asset, balance, Value, ValueView}; +use penumbra_sdk_num::Amount; use crate::{NotePayload, Rseed}; @@ -579,7 +579,7 @@ mod tests { use rand_core::OsRng; use super::*; - use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; #[test] fn note_encryption_and_decryption() { diff --git a/crates/core/component/shielded-pool/src/note/r1cs.rs b/crates/core/component/shielded-pool/src/note/r1cs.rs index de3096fd98..0059e7a2ab 100644 --- a/crates/core/component/shielded-pool/src/note/r1cs.rs +++ b/crates/core/component/shielded-pool/src/note/r1cs.rs @@ -5,9 +5,9 @@ use decaf377::{ r1cs::{ElementVar, FqVar}, Fq, }; -use penumbra_asset::ValueVar; -use penumbra_keys::address::AddressVar; -use penumbra_tct::r1cs::StateCommitmentVar; +use penumbra_sdk_asset::ValueVar; +use penumbra_sdk_keys::address::AddressVar; +use penumbra_sdk_tct::r1cs::StateCommitmentVar; use crate::Note; diff --git a/crates/core/component/shielded-pool/src/note_payload.rs b/crates/core/component/shielded-pool/src/note_payload.rs index f5c6321161..e713f35c1b 100644 --- a/crates/core/component/shielded-pool/src/note_payload.rs +++ b/crates/core/component/shielded-pool/src/note_payload.rs @@ -1,8 +1,8 @@ use anyhow::{Context, Error}; -use penumbra_keys::keys::FullViewingKey; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_keys::keys::FullViewingKey; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::{note, Note, NoteCiphertext}; diff --git a/crates/core/component/shielded-pool/src/nullifier_derivation.rs b/crates/core/component/shielded-pool/src/nullifier_derivation.rs index d691416d8d..2d1aac3c45 100644 --- a/crates/core/component/shielded-pool/src/nullifier_derivation.rs +++ b/crates/core/component/shielded-pool/src/nullifier_derivation.rs @@ -12,16 +12,16 @@ use ark_groth16::{ }; use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystemRef}; use ark_snark::SNARK; -use penumbra_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; -use penumbra_tct as tct; +use penumbra_sdk_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_tct as tct; use rand::{CryptoRng, Rng}; use tct::StateCommitment; use crate::{Note, Rseed}; -use penumbra_asset::Value; -use penumbra_keys::keys::{Bip44Path, NullifierKey, NullifierKeyVar, SeedPhrase, SpendKey}; -use penumbra_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; -use penumbra_sct::{Nullifier, NullifierVar}; +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::keys::{Bip44Path, NullifierKey, NullifierKeyVar, SeedPhrase, SpendKey}; +use penumbra_sdk_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_sct::{Nullifier, NullifierVar}; /// The public input for a ['NullifierDerivationProof']. #[derive(Clone, Debug)] @@ -232,10 +232,10 @@ impl TryFrom for NullifierDerivationProof { #[cfg(test)] mod tests { use super::*; - use penumbra_asset::{asset, Value}; - use penumbra_keys::keys::{SeedPhrase, SpendKey}; - use penumbra_num::Amount; - use penumbra_sct::Nullifier; + use penumbra_sdk_asset::{asset, Value}; + use penumbra_sdk_keys::keys::{SeedPhrase, SpendKey}; + use penumbra_sdk_num::Amount; + use penumbra_sdk_sct::Nullifier; use proptest::prelude::*; use crate::Note; diff --git a/crates/core/component/shielded-pool/src/output/action.rs b/crates/core/component/shielded-pool/src/output/action.rs index b98d0026a9..b52f224085 100644 --- a/crates/core/component/shielded-pool/src/output/action.rs +++ b/crates/core/component/shielded-pool/src/output/action.rs @@ -1,13 +1,13 @@ use std::convert::{TryFrom, TryInto}; use anyhow::{Context, Error}; -use penumbra_asset::balance; -use penumbra_keys::symmetric::{OvkWrappedKey, WrappedMemoKey}; -use penumbra_proto::{ +use penumbra_sdk_asset::balance; +use penumbra_sdk_keys::symmetric::{OvkWrappedKey, WrappedMemoKey}; +use penumbra_sdk_proto::{ core::component::shielded_pool::v1 as pb, penumbra::core::component::shielded_pool::v1 as pbc, DomainType, }; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::{NotePayload, OutputProof}; diff --git a/crates/core/component/shielded-pool/src/output/plan.rs b/crates/core/component/shielded-pool/src/output/plan.rs index 5bc9a6abb2..8aa3025fca 100644 --- a/crates/core/component/shielded-pool/src/output/plan.rs +++ b/crates/core/component/shielded-pool/src/output/plan.rs @@ -1,12 +1,12 @@ use decaf377::{Fq, Fr}; use decaf377_ka as ka; -use penumbra_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_keys::{ +use penumbra_sdk_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_keys::{ keys::{IncomingViewingKey, OutgoingViewingKey}, symmetric::WrappedMemoKey, Address, PayloadKey, }; -use penumbra_proto::{core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::component::shielded_pool::v1 as pb, DomainType}; use rand_core::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; @@ -80,7 +80,7 @@ impl OutputPlan { OutputProof::prove( self.proof_blinding_r, self.proof_blinding_s, - &penumbra_proof_params::OUTPUT_PROOF_PROVING_KEY, + &penumbra_sdk_proof_params::OUTPUT_PROOF_PROVING_KEY, OutputProofPublic { balance_commitment, note_commitment, @@ -174,16 +174,16 @@ mod test { use crate::output::OutputProofPublic; use super::OutputPlan; - use penumbra_asset::Value; - use penumbra_keys::{ + use penumbra_sdk_asset::Value; + use penumbra_sdk_keys::{ keys::{Bip44Path, SeedPhrase, SpendKey}, PayloadKey, }; - use penumbra_proof_params::OUTPUT_PROOF_VERIFICATION_KEY; + use penumbra_sdk_proof_params::OUTPUT_PROOF_VERIFICATION_KEY; use rand_core::OsRng; #[test] - /// Check that a valid output proof passes the `penumbra_crypto` integrity checks successfully. + /// Check that a valid output proof passes the `penumbra_sdk_crypto` integrity checks successfully. /// This test serves to anchor how an `OutputPlan` prepares its `OutputProof`, in particular /// the balance and note commitments. fn check_output_proof_verification() { diff --git a/crates/core/component/shielded-pool/src/output/proof.rs b/crates/core/component/shielded-pool/src/output/proof.rs index 323bf124f2..550286a9bc 100644 --- a/crates/core/component/shielded-pool/src/output/proof.rs +++ b/crates/core/component/shielded-pool/src/output/proof.rs @@ -14,17 +14,17 @@ use ark_groth16::{Groth16, PreparedVerifyingKey, Proof, ProvingKey}; use ark_r1cs_std::prelude::*; use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystemRef}; use ark_snark::SNARK; -use penumbra_keys::{keys::Diversifier, Address}; -use penumbra_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; -use penumbra_tct::r1cs::StateCommitmentVar; +use penumbra_sdk_keys::{keys::Diversifier, Address}; +use penumbra_sdk_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_tct::r1cs::StateCommitmentVar; use crate::{note, Note, Rseed}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ balance, balance::{commitment::BalanceCommitmentVar, BalanceVar}, Value, }; -use penumbra_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; /// The public input for an [`OutputProof`]. #[derive(Clone, Debug)] @@ -46,7 +46,7 @@ pub struct OutputProofPrivate { #[cfg(test)] fn check_satisfaction(public: &OutputProofPublic, private: &OutputProofPrivate) -> Result<()> { - use penumbra_asset::Balance; + use penumbra_sdk_asset::Balance; if private.note.diversified_generator() == decaf377::Element::default() { anyhow::bail!("diversified generator is identity"); @@ -264,9 +264,9 @@ impl TryFrom for OutputProof { mod tests { use super::*; use decaf377::{Fq, Fr}; - use penumbra_asset::{asset, Balance, Value}; - use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; - use penumbra_num::Amount; + use penumbra_sdk_asset::{asset, Balance, Value}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; + use penumbra_sdk_num::Amount; use proptest::prelude::*; use crate::{note, Note}; diff --git a/crates/core/component/shielded-pool/src/output/view.rs b/crates/core/component/shielded-pool/src/output/view.rs index adcd1e4b1f..5321e7a561 100644 --- a/crates/core/component/shielded-pool/src/output/view.rs +++ b/crates/core/component/shielded-pool/src/output/view.rs @@ -1,5 +1,5 @@ -use penumbra_keys::PayloadKey; -use penumbra_proto::{core::component::shielded_pool::v1 as pbt, DomainType}; +use penumbra_sdk_keys::PayloadKey; +use penumbra_sdk_proto::{core::component::shielded_pool::v1 as pbt, DomainType}; use serde::{Deserialize, Serialize}; use crate::NoteView; diff --git a/crates/core/component/shielded-pool/src/params.rs b/crates/core/component/shielded-pool/src/params.rs index 6658420fcc..4b13c623c8 100644 --- a/crates/core/component/shielded-pool/src/params.rs +++ b/crates/core/component/shielded-pool/src/params.rs @@ -1,6 +1,6 @@ -use penumbra_proto::penumbra::core::component::shielded_pool::v1 as pb; +use penumbra_sdk_proto::penumbra::core::component::shielded_pool::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; use crate::fmd; diff --git a/crates/core/component/shielded-pool/src/rseed.rs b/crates/core/component/shielded-pool/src/rseed.rs index 78e75f970b..db3b2c307c 100644 --- a/crates/core/component/shielded-pool/src/rseed.rs +++ b/crates/core/component/shielded-pool/src/rseed.rs @@ -1,6 +1,6 @@ use decaf377::{Fq, Fr}; use decaf377_ka as ka; -use penumbra_keys::prf; +use penumbra_sdk_keys::prf; use rand::{CryptoRng, RngCore}; /// The rseed is a uniformly random 32-byte sequence included in the note plaintext. diff --git a/crates/core/component/shielded-pool/src/spend/action.rs b/crates/core/component/shielded-pool/src/spend/action.rs index 83517d6748..5fb78fe902 100644 --- a/crates/core/component/shielded-pool/src/spend/action.rs +++ b/crates/core/component/shielded-pool/src/spend/action.rs @@ -2,10 +2,10 @@ use std::convert::{TryFrom, TryInto}; use anyhow::{Context, Error}; use decaf377_rdsa::{Signature, SpendAuth, VerificationKey}; -use penumbra_asset::balance; -use penumbra_proto::{core::component::shielded_pool::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::balance; +use penumbra_sdk_proto::{core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::SpendProof; diff --git a/crates/core/component/shielded-pool/src/spend/plan.rs b/crates/core/component/shielded-pool/src/spend/plan.rs index 1602badd0b..f017e7f510 100644 --- a/crates/core/component/shielded-pool/src/spend/plan.rs +++ b/crates/core/component/shielded-pool/src/spend/plan.rs @@ -1,10 +1,10 @@ use decaf377::{Fq, Fr}; use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_keys::{keys::AddressIndex, FullViewingKey}; -use penumbra_proto::{core::component::shielded_pool::v1 as pb, DomainType}; -use penumbra_sct::Nullifier; -use penumbra_tct as tct; +use penumbra_sdk_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_keys::{keys::AddressIndex, FullViewingKey}; +use penumbra_sdk_proto::{core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_tct as tct; use rand_core::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; @@ -121,7 +121,7 @@ impl SpendPlan { SpendProof::prove( self.proof_blinding_r, self.proof_blinding_s, - &penumbra_proof_params::SPEND_PROOF_PROVING_KEY, + &penumbra_sdk_proof_params::SPEND_PROOF_PROVING_KEY, public, private, ) diff --git a/crates/core/component/shielded-pool/src/spend/proof.rs b/crates/core/component/shielded-pool/src/spend/proof.rs index 936f03f329..5575b8736e 100644 --- a/crates/core/component/shielded-pool/src/spend/proof.rs +++ b/crates/core/component/shielded-pool/src/spend/proof.rs @@ -19,22 +19,22 @@ use ark_r1cs_std::prelude::AllocVar; use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystemRef}; use ark_snark::SNARK; use decaf377_rdsa::{SpendAuth, VerificationKey}; -use penumbra_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; -use penumbra_tct as tct; -use penumbra_tct::r1cs::StateCommitmentVar; +use penumbra_sdk_proto::{penumbra::core::component::shielded_pool::v1 as pb, DomainType}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_tct::r1cs::StateCommitmentVar; use crate::{note, Note, Rseed}; -use penumbra_asset::{ +use penumbra_sdk_asset::{ balance::commitment::BalanceCommitmentVar, balance::{self, Commitment}, Value, }; -use penumbra_keys::keys::{ +use penumbra_sdk_keys::keys::{ AuthorizationKeyVar, Bip44Path, IncomingViewingKeyVar, NullifierKey, NullifierKeyVar, RandomizedVerificationKey, SeedPhrase, SpendAuthRandomizerVar, SpendKey, }; -use penumbra_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; -use penumbra_sct::{Nullifier, NullifierVar}; +use penumbra_sdk_proof_params::{DummyWitness, VerifyingKeyExt, GROTH16_PROOF_LENGTH_BYTES}; +use penumbra_sdk_sct::{Nullifier, NullifierVar}; use tap::Tap; /// The public input for a [`SpendProof`]. @@ -69,7 +69,7 @@ pub struct SpendProofPrivate { #[cfg(test)] fn check_satisfaction(public: &SpendProofPublic, private: &SpendProofPrivate) -> Result<()> { - use penumbra_keys::keys::FullViewingKey; + use penumbra_sdk_keys::keys::FullViewingKey; let note_commitment = private.note.commit(); if note_commitment != private.state_commitment_proof.commitment() { @@ -387,20 +387,20 @@ mod tests { use super::*; use ark_r1cs_std::prelude::Boolean; use decaf377::{Fq, Fr}; - use penumbra_asset::{asset, Value}; - use penumbra_keys::{ + use penumbra_sdk_asset::{asset, Value}; + use penumbra_sdk_keys::{ keys::{Bip44Path, SeedPhrase, SpendKey}, Address, }; - use penumbra_num::Amount; - use penumbra_proof_params::generate_prepared_test_parameters; - use penumbra_sct::Nullifier; - use penumbra_tct::StateCommitment; + use penumbra_sdk_num::Amount; + use penumbra_sdk_proof_params::generate_prepared_test_parameters; + use penumbra_sdk_sct::Nullifier; + use penumbra_sdk_tct::StateCommitment; use proptest::prelude::*; use crate::Note; use decaf377_rdsa::{SpendAuth, VerificationKey}; - use penumbra_tct as tct; + use penumbra_sdk_tct as tct; use rand_core::OsRng; fn fr_strategy() -> BoxedStrategy { diff --git a/crates/core/component/shielded-pool/src/spend/view.rs b/crates/core/component/shielded-pool/src/spend/view.rs index 01ecf1cdb4..d0309b9aff 100644 --- a/crates/core/component/shielded-pool/src/spend/view.rs +++ b/crates/core/component/shielded-pool/src/spend/view.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{core::component::shielded_pool::v1 as pbt, DomainType}; +use penumbra_sdk_proto::{core::component::shielded_pool::v1 as pbt, DomainType}; use serde::{Deserialize, Serialize}; use crate::{NoteView, Spend}; diff --git a/crates/core/component/shielded-pool/src/state_key.rs b/crates/core/component/shielded-pool/src/state_key.rs index 4c79c4cda7..d20f4ee5eb 100644 --- a/crates/core/component/shielded-pool/src/state_key.rs +++ b/crates/core/component/shielded-pool/src/state_key.rs @@ -1,5 +1,5 @@ pub mod denom_metadata_by_asset { - use penumbra_asset::asset; + use penumbra_sdk_asset::asset; use std::string::String; pub fn prefix() -> &'static str { diff --git a/crates/core/component/stake/src/changes.rs b/crates/core/component/stake/src/changes.rs index 446d1fe854..d8b57d9ef7 100644 --- a/crates/core/component/stake/src/changes.rs +++ b/crates/core/component/stake/src/changes.rs @@ -1,6 +1,6 @@ use crate::{Delegate, Undelegate}; use anyhow::Result; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// Data structure used to track queued delegation changes that have been diff --git a/crates/core/component/stake/src/component/action_handler/delegate.rs b/crates/core/component/stake/src/component/action_handler/delegate.rs index 5b01bc9963..5acb78ef86 100644 --- a/crates/core/component/stake/src/component/action_handler/delegate.rs +++ b/crates/core/component/stake/src/component/action_handler/delegate.rs @@ -2,9 +2,9 @@ use anyhow::{ensure, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use cnidarium_component::ActionHandler; -use penumbra_num::Amount; -use penumbra_proto::{DomainType, StateWriteProto}; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{DomainType, StateWriteProto}; +use penumbra_sdk_sct::component::clock::EpochRead; use crate::{ component::validator_handler::ValidatorDataRead, event, validator::State::*, Delegate, diff --git a/crates/core/component/stake/src/component/action_handler/undelegate.rs b/crates/core/component/stake/src/component/action_handler/undelegate.rs index da3947ee01..5961112a88 100644 --- a/crates/core/component/stake/src/component/action_handler/undelegate.rs +++ b/crates/core/component/stake/src/component/action_handler/undelegate.rs @@ -1,9 +1,9 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_proto::{DomainType as _, StateWriteProto}; -use penumbra_sct::component::clock::EpochRead; -use penumbra_shielded_pool::component::AssetRegistry; +use penumbra_sdk_proto::{DomainType as _, StateWriteProto}; +use penumbra_sdk_sct::component::clock::EpochRead; +use penumbra_sdk_shielded_pool::component::AssetRegistry; use crate::{ component::action_handler::ActionHandler, diff --git a/crates/core/component/stake/src/component/action_handler/undelegate_claim.rs b/crates/core/component/stake/src/component/action_handler/undelegate_claim.rs index 0692dc6120..3ed500f842 100644 --- a/crates/core/component/stake/src/component/action_handler/undelegate_claim.rs +++ b/crates/core/component/stake/src/component/action_handler/undelegate_claim.rs @@ -1,8 +1,8 @@ use anyhow::{ensure, Result}; use async_trait::async_trait; use cnidarium::StateWrite; -use penumbra_proof_params::CONVERT_PROOF_VERIFICATION_KEY; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_proof_params::CONVERT_PROOF_VERIFICATION_KEY; +use penumbra_sdk_sct::component::clock::EpochRead; use crate::component::validator_handler::ValidatorDataRead; use crate::component::SlashingData; diff --git a/crates/core/component/stake/src/component/action_handler/validator_definition.rs b/crates/core/component/stake/src/component/action_handler/validator_definition.rs index fde0291007..5482ead796 100644 --- a/crates/core/component/stake/src/component/action_handler/validator_definition.rs +++ b/crates/core/component/stake/src/component/action_handler/validator_definition.rs @@ -10,7 +10,7 @@ use anyhow::{ensure, Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use decaf377_rdsa::VerificationKey; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::DomainType; #[async_trait] impl ActionHandler for validator::Definition { diff --git a/crates/core/component/stake/src/component/epoch_handler.rs b/crates/core/component/stake/src/component/epoch_handler.rs index a4be223c4a..6b58bf65a5 100644 --- a/crates/core/component/stake/src/component/epoch_handler.rs +++ b/crates/core/component/stake/src/component/epoch_handler.rs @@ -17,10 +17,10 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use cnidarium::StateWrite; use futures::{StreamExt, TryStreamExt}; -use penumbra_distributions::component::StateReadExt as _; -use penumbra_num::{fixpoint::U128x128, Amount}; -use penumbra_proto::{StateReadProto, StateWriteProto}; -use penumbra_sct::{component::clock::EpochRead, epoch::Epoch}; +use penumbra_sdk_distributions::component::StateReadExt as _; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_proto::{StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::{component::clock::EpochRead, epoch::Epoch}; use std::collections::{BTreeMap, BTreeSet}; use tendermint::{validator::Update, PublicKey}; use tokio::task::JoinSet; diff --git a/crates/core/component/stake/src/component/metrics.rs b/crates/core/component/stake/src/component/metrics.rs index 7939be0f6d..d45538d5f5 100644 --- a/crates/core/component/stake/src/component/metrics.rs +++ b/crates/core/component/stake/src/component/metrics.rs @@ -22,4 +22,4 @@ pub fn register_metrics() { ); } -pub const MISSED_BLOCKS: &str = "penumbra_stake_missed_blocks"; +pub const MISSED_BLOCKS: &str = "penumbra_sdk_stake_missed_blocks"; diff --git a/crates/core/component/stake/src/component/rpc.rs b/crates/core/component/stake/src/component/rpc.rs index ad7a27ad87..0c0edf2f44 100644 --- a/crates/core/component/stake/src/component/rpc.rs +++ b/crates/core/component/stake/src/component/rpc.rs @@ -2,7 +2,7 @@ use std::pin::Pin; use cnidarium::Storage; use futures::StreamExt; -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::stake::v1::{ query_service_server::QueryService, CurrentValidatorRateRequest, CurrentValidatorRateResponse, GetValidatorInfoRequest, GetValidatorInfoResponse, diff --git a/crates/core/component/stake/src/component/stake.rs b/crates/core/component/stake/src/component/stake.rs index 98b8bf8139..73be8dddcd 100644 --- a/crates/core/component/stake/src/component/stake.rs +++ b/crates/core/component/stake/src/component/stake.rs @@ -14,9 +14,9 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use cnidarium_component::Component; use futures::{StreamExt, TryStreamExt}; -use penumbra_num::Amount; -use penumbra_proto::{DomainType, StateReadProto, StateWriteProto}; -use penumbra_sct::component::clock::EpochRead; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_sct::component::clock::EpochRead; use std::pin::Pin; use std::str::FromStr; use std::{collections::BTreeMap, sync::Arc}; @@ -42,7 +42,7 @@ impl Staking {} impl Component for Staking { type AppState = ( crate::genesis::Content, - penumbra_shielded_pool::genesis::Content, + penumbra_sdk_shielded_pool::genesis::Content, ); #[instrument(name = "staking", skip(state, app_state))] diff --git a/crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs b/crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs index b3b9999165..7653aaef47 100644 --- a/crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs +++ b/crates/core/component/stake/src/component/validator_handler/uptime_tracker.rs @@ -17,8 +17,8 @@ use { async_trait::async_trait, cnidarium::StateWrite, futures::StreamExt as _, - penumbra_proto::{DomainType, StateWriteProto}, - penumbra_sct::component::clock::EpochRead, + penumbra_sdk_proto::{DomainType, StateWriteProto}, + penumbra_sdk_sct::component::clock::EpochRead, std::collections::BTreeMap, tap::Tap, tendermint::abci::types::CommitInfo, diff --git a/crates/core/component/stake/src/component/validator_handler/validator_manager.rs b/crates/core/component/stake/src/component/validator_handler/validator_manager.rs index 2064291966..8f2b6ca112 100644 --- a/crates/core/component/stake/src/component/validator_handler/validator_manager.rs +++ b/crates/core/component/stake/src/component/validator_handler/validator_manager.rs @@ -22,14 +22,14 @@ use { anyhow::{ensure, Result}, async_trait::async_trait, cnidarium::StateWrite, - penumbra_asset::asset, - penumbra_num::Amount, - penumbra_proto::{DomainType as _, StateWriteProto}, - penumbra_sct::component::{ + penumbra_sdk_asset::asset, + penumbra_sdk_num::Amount, + penumbra_sdk_proto::{DomainType as _, StateWriteProto}, + penumbra_sdk_sct::component::{ clock::{EpochManager, EpochRead}, StateReadExt as _, }, - penumbra_shielded_pool::component::AssetRegistry, + penumbra_sdk_shielded_pool::component::AssetRegistry, std::collections::BTreeMap, tendermint::abci::types::Misbehavior, tracing::{instrument, Instrument}, diff --git a/crates/core/component/stake/src/component/validator_handler/validator_store.rs b/crates/core/component/stake/src/component/validator_handler/validator_store.rs index b3e7508ce1..845724fe80 100644 --- a/crates/core/component/stake/src/component/validator_handler/validator_store.rs +++ b/crates/core/component/stake/src/component/validator_handler/validator_store.rs @@ -10,8 +10,8 @@ use anyhow::Result; use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::{Future, FutureExt}; -use penumbra_num::Amount; -use penumbra_proto::{state::future::DomainFuture, DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{state::future::DomainFuture, DomainType, StateReadProto, StateWriteProto}; use std::pin::Pin; use tendermint::PublicKey; use tracing::instrument; diff --git a/crates/core/component/stake/src/current_consensus_keys.rs b/crates/core/component/stake/src/current_consensus_keys.rs index 08ae346383..89af13738a 100644 --- a/crates/core/component/stake/src/current_consensus_keys.rs +++ b/crates/core/component/stake/src/current_consensus_keys.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use tendermint::PublicKey; diff --git a/crates/core/component/stake/src/delegate.rs b/crates/core/component/stake/src/delegate.rs index ce43a41437..4e127ec718 100644 --- a/crates/core/component/stake/src/delegate.rs +++ b/crates/core/component/stake/src/delegate.rs @@ -1,7 +1,7 @@ -use penumbra_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::{DelegationToken, IdentityKey}; diff --git a/crates/core/component/stake/src/delegation_token.rs b/crates/core/component/stake/src/delegation_token.rs index 9a92358736..171ec9accd 100644 --- a/crates/core/component/stake/src/delegation_token.rs +++ b/crates/core/component/stake/src/delegation_token.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use regex::Regex; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; use super::IdentityKey; diff --git a/crates/core/component/stake/src/event.rs b/crates/core/component/stake/src/event.rs index cb0d184af4..327b0f9b97 100644 --- a/crates/core/component/stake/src/event.rs +++ b/crates/core/component/stake/src/event.rs @@ -4,8 +4,8 @@ use crate::{ Delegate, IdentityKey, Penalty, Undelegate, }; use anyhow::{anyhow, Context as _}; -use penumbra_num::Amount; -use penumbra_proto::{core::component::stake::v1 as pb, DomainType, Name as _}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, DomainType, Name as _}; use tendermint::abci::types::Misbehavior; #[derive(Clone, Debug)] diff --git a/crates/core/component/stake/src/funding_stream.rs b/crates/core/component/stake/src/funding_stream.rs index 67a63c4dd8..711f37497c 100644 --- a/crates/core/component/stake/src/funding_stream.rs +++ b/crates/core/component/stake/src/funding_stream.rs @@ -1,7 +1,7 @@ use crate::BPS_SQUARED_SCALING_FACTOR; -use penumbra_keys::Address; -use penumbra_num::{fixpoint::U128x128, Amount}; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// A destination for a portion of a validator's commission of staking rewards. diff --git a/crates/core/component/stake/src/genesis.rs b/crates/core/component/stake/src/genesis.rs index cbbf68419f..337d524f41 100644 --- a/crates/core/component/stake/src/genesis.rs +++ b/crates/core/component/stake/src/genesis.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::params::StakeParameters; diff --git a/crates/core/component/stake/src/governance_key.rs b/crates/core/component/stake/src/governance_key.rs index 6ed38bd4ff..99a5f23c16 100644 --- a/crates/core/component/stake/src/governance_key.rs +++ b/crates/core/component/stake/src/governance_key.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{ +use penumbra_sdk_proto::{ // TODO: why is the governance key part of this crate? core::keys::v1 as pb, serializers::bech32str::{self, validator_governance_key::BECH32_PREFIX}, diff --git a/crates/core/component/stake/src/identity_key.rs b/crates/core/component/stake/src/identity_key.rs index 98c85eb986..0ec89e392a 100644 --- a/crates/core/component/stake/src/identity_key.rs +++ b/crates/core/component/stake/src/identity_key.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::stake::v1::CurrentValidatorRateRequest, // TODO: why is this not in the keys crate? core::keys::v1 as pb, diff --git a/crates/core/component/stake/src/lib.rs b/crates/core/component/stake/src/lib.rs index ccaab1c2be..08d8e0c52a 100644 --- a/crates/core/component/stake/src/lib.rs +++ b/crates/core/component/stake/src/lib.rs @@ -29,7 +29,7 @@ pub mod component; #[cfg(feature = "component")] pub use component::{StateReadExt, StateWriteExt}; -pub static BPS_SQUARED_SCALING_FACTOR: once_cell::sync::Lazy = +pub static BPS_SQUARED_SCALING_FACTOR: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| 1_0000_0000u128.into()); pub use self::delegate::Delegate; diff --git a/crates/core/component/stake/src/params.rs b/crates/core/component/stake/src/params.rs index 2737c5ab08..2fd1e0c2a5 100644 --- a/crates/core/component/stake/src/params.rs +++ b/crates/core/component/stake/src/params.rs @@ -1,6 +1,6 @@ -use penumbra_num::Amount; -use penumbra_proto::core::component::stake::v1 as pb; -use penumbra_proto::DomainType; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::stake::v1 as pb; +use penumbra_sdk_proto::DomainType; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/crates/core/component/stake/src/penalty.rs b/crates/core/component/stake/src/penalty.rs index 6896b71ed2..80447e4c4d 100644 --- a/crates/core/component/stake/src/penalty.rs +++ b/crates/core/component/stake/src/penalty.rs @@ -1,10 +1,10 @@ use ark_ff::ToConstraintField; use decaf377::Fq; -use penumbra_proto::{penumbra::core::component::stake::v1 as pbs, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pbs, DomainType}; use serde::{Deserialize, Serialize}; -use penumbra_asset::{asset, Balance, Value, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::{fixpoint::U128x128, Amount}; +use penumbra_sdk_asset::{asset, Balance, Value, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::{fixpoint::U128x128, Amount}; /// Tracks slashing penalties applied to a validator in some epoch. /// diff --git a/crates/core/component/stake/src/rate.rs b/crates/core/component/stake/src/rate.rs index 435b24c5e0..c59144ac51 100644 --- a/crates/core/component/stake/src/rate.rs +++ b/crates/core/component/stake/src/rate.rs @@ -1,10 +1,10 @@ //! Staking reward and delegation token exchange rates. -use penumbra_num::fixpoint::U128x128; -use penumbra_num::Amount; -use penumbra_proto::core::component::stake::v1::CurrentValidatorRateResponse; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; -use penumbra_sct::epoch::Epoch; +use penumbra_sdk_num::fixpoint::U128x128; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::core::component::stake::v1::CurrentValidatorRateResponse; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_sct::epoch::Epoch; use serde::{Deserialize, Serialize}; use crate::{validator::State, FundingStream, IdentityKey}; diff --git a/crates/core/component/stake/src/unbonding_token.rs b/crates/core/component/stake/src/unbonding_token.rs index c6921d9e33..27fd7a4add 100644 --- a/crates/core/component/stake/src/unbonding_token.rs +++ b/crates/core/component/stake/src/unbonding_token.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use regex::Regex; -use penumbra_asset::asset; +use penumbra_sdk_asset::asset; use crate::IdentityKey; diff --git a/crates/core/component/stake/src/undelegate.rs b/crates/core/component/stake/src/undelegate.rs index 908e8614cc..1a9cc9f719 100644 --- a/crates/core/component/stake/src/undelegate.rs +++ b/crates/core/component/stake/src/undelegate.rs @@ -1,8 +1,8 @@ -use penumbra_asset::{Balance, Value}; -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; -use penumbra_sct::epoch::Epoch; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_sct::epoch::Epoch; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::{DelegationToken, IdentityKey, UnbondingToken}; diff --git a/crates/core/component/stake/src/undelegate_claim/action.rs b/crates/core/component/stake/src/undelegate_claim/action.rs index a27cd5c488..498607d49c 100644 --- a/crates/core/component/stake/src/undelegate_claim/action.rs +++ b/crates/core/component/stake/src/undelegate_claim/action.rs @@ -1,6 +1,6 @@ -use penumbra_asset::balance; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_asset::balance; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::{IdentityKey, Penalty, UndelegateClaimProof}; diff --git a/crates/core/component/stake/src/undelegate_claim/plan.rs b/crates/core/component/stake/src/undelegate_claim/plan.rs index 6d0f5bbe6c..b4d89df857 100644 --- a/crates/core/component/stake/src/undelegate_claim/plan.rs +++ b/crates/core/component/stake/src/undelegate_claim/plan.rs @@ -1,8 +1,8 @@ use decaf377::{Fq, Fr}; -use penumbra_asset::{asset, balance, Balance}; -use penumbra_num::Amount; -use penumbra_proof_params::CONVERT_PROOF_PROVING_KEY; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_asset::{asset, balance, Balance}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_params::CONVERT_PROOF_PROVING_KEY; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; diff --git a/crates/core/component/stake/src/undelegate_claim/proof.rs b/crates/core/component/stake/src/undelegate_claim/proof.rs index 5d42c242ab..20f8c3eb75 100644 --- a/crates/core/component/stake/src/undelegate_claim/proof.rs +++ b/crates/core/component/stake/src/undelegate_claim/proof.rs @@ -2,13 +2,13 @@ use decaf377::Bls12_377; use ark_groth16::{PreparedVerifyingKey, ProvingKey}; use base64::prelude::*; -use penumbra_proto::{core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::component::stake::v1 as pb, DomainType}; use decaf377::{Fq, Fr}; -use penumbra_asset::{asset, balance, STAKING_TOKEN_ASSET_ID}; -use penumbra_num::Amount; -use penumbra_proof_params::VerifyingKeyExt; -use penumbra_shielded_pool::{ConvertProof, ConvertProofPrivate, ConvertProofPublic}; +use penumbra_sdk_asset::{asset, balance, STAKING_TOKEN_ASSET_ID}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_params::VerifyingKeyExt; +use penumbra_sdk_shielded_pool::{ConvertProof, ConvertProofPrivate, ConvertProofPublic}; use crate::Penalty; @@ -101,14 +101,14 @@ mod tests { use super::*; use decaf377::{Fq, Fr}; use decaf377_rdsa as rdsa; - use penumbra_num::Amount; - use penumbra_proof_params::generate_prepared_test_parameters; + use penumbra_sdk_num::Amount; + use penumbra_sdk_proof_params::generate_prepared_test_parameters; use proptest::prelude::*; use rand_core::OsRng; use rdsa::VerificationKey; use crate::{IdentityKey, Penalty, UnbondingToken}; - use penumbra_shielded_pool::ConvertCircuit; + use penumbra_sdk_shielded_pool::ConvertCircuit; fn fr_strategy() -> BoxedStrategy { any::<[u8; 32]>() diff --git a/crates/core/component/stake/src/uptime.rs b/crates/core/component/stake/src/uptime.rs index 2326f07953..4e6ed5ce2a 100644 --- a/crates/core/component/stake/src/uptime.rs +++ b/crates/core/component/stake/src/uptime.rs @@ -1,6 +1,6 @@ use bitvec::prelude::*; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// Records information on a validator's uptime. diff --git a/crates/core/component/stake/src/validator.rs b/crates/core/component/stake/src/validator.rs index 734506aa5a..9c7612a73b 100644 --- a/crates/core/component/stake/src/validator.rs +++ b/crates/core/component/stake/src/validator.rs @@ -1,7 +1,7 @@ //! Penumbra validators and related structures. -use penumbra_keys::Address; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use serde_unit_struct::{Deserialize_unit_struct, Serialize_unit_struct}; use serde_with::{serde_as, DisplayFromStr}; diff --git a/crates/core/component/stake/src/validator/bonding.rs b/crates/core/component/stake/src/validator/bonding.rs index b810b7b28e..390432c1aa 100644 --- a/crates/core/component/stake/src/validator/bonding.rs +++ b/crates/core/component/stake/src/validator/bonding.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Serialize, Deserialize)] diff --git a/crates/core/component/stake/src/validator/definition.rs b/crates/core/component/stake/src/validator/definition.rs index f3cf5fc89d..88e28674c0 100644 --- a/crates/core/component/stake/src/validator/definition.rs +++ b/crates/core/component/stake/src/validator/definition.rs @@ -1,6 +1,6 @@ use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use serde::{Deserialize, Serialize}; use crate::validator::Validator; diff --git a/crates/core/component/stake/src/validator/info.rs b/crates/core/component/stake/src/validator/info.rs index 28e9dc9a00..597a5a6445 100644 --- a/crates/core/component/stake/src/validator/info.rs +++ b/crates/core/component/stake/src/validator/info.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::stake::v1::ValidatorInfoResponse, penumbra::core::component::stake::v1 as pb, DomainType, }; diff --git a/crates/core/component/stake/src/validator/state.rs b/crates/core/component/stake/src/validator/state.rs index cd3ceb0ebe..2ebc73bdb5 100644 --- a/crates/core/component/stake/src/validator/state.rs +++ b/crates/core/component/stake/src/validator/state.rs @@ -1,5 +1,5 @@ use anyhow::anyhow; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// The state of a validator in the validator state machine. diff --git a/crates/core/component/stake/src/validator/status.rs b/crates/core/component/stake/src/validator/status.rs index 4ec6cf8ea5..5ea4cef456 100644 --- a/crates/core/component/stake/src/validator/status.rs +++ b/crates/core/component/stake/src/validator/status.rs @@ -1,5 +1,5 @@ -use penumbra_num::Amount; -use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::{validator::BondingState, validator::State, IdentityKey}; diff --git a/crates/core/keys/src/address.rs b/crates/core/keys/src/address.rs index 85939a858f..9249884cb1 100644 --- a/crates/core/keys/src/address.rs +++ b/crates/core/keys/src/address.rs @@ -10,7 +10,7 @@ use anyhow::Context; use ark_serialize::CanonicalDeserialize; use decaf377::Fq; use f4jumble::{f4jumble, f4jumble_inv}; -use penumbra_proto::{penumbra::core::keys::v1 as pb, serializers::bech32str, DomainType}; +use penumbra_sdk_proto::{penumbra::core::keys::v1 as pb, serializers::bech32str, DomainType}; use rand::{CryptoRng, Rng}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -471,7 +471,7 @@ mod tests { let addr = Address::from_str(&bech32m_addr).expect("can decode valid address"); - use penumbra_proto::Message; + use penumbra_sdk_proto::Message; let proto_addr = dest.encode_to_vec(); let proto_addr_bech32m = pb::Address { diff --git a/crates/core/keys/src/address/view.rs b/crates/core/keys/src/address/view.rs index 932d80368a..9a2ef4e296 100644 --- a/crates/core/keys/src/address/view.rs +++ b/crates/core/keys/src/address/view.rs @@ -2,7 +2,7 @@ use std::cmp::Ordering; use serde::{Deserialize, Serialize}; -use penumbra_proto::{penumbra::core::keys::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::keys::v1 as pb, DomainType}; use crate::keys::{AddressIndex, WalletId}; diff --git a/crates/core/keys/src/keys/diversifier.rs b/crates/core/keys/src/keys/diversifier.rs index 99fb27b8b9..8777a0d8ce 100644 --- a/crates/core/keys/src/keys/diversifier.rs +++ b/crates/core/keys/src/keys/diversifier.rs @@ -7,7 +7,7 @@ use aes::Aes128; use anyhow::Context; use derivative::Derivative; -use penumbra_proto::{penumbra::core::keys::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::keys::v1 as pb, DomainType}; use rand::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; @@ -26,7 +26,7 @@ impl Diversifier { /// Generate the diversified basepoint associated to this diversifier. pub fn diversified_generator(&self) -> decaf377::Element { let hash = blake2b_simd::Params::new() - .personal(b"Penumbra_Divrsfy") + .personal(b"penumbra_sdk_Divrsfy") .hash(&self.0); decaf377::Element::encode_to_curve(&Fq::from_le_bytes_mod_order(hash.as_bytes())) diff --git a/crates/core/keys/src/keys/fvk.rs b/crates/core/keys/src/keys/fvk.rs index 44239700bf..9ffe0da2f2 100644 --- a/crates/core/keys/src/keys/fvk.rs +++ b/crates/core/keys/src/keys/fvk.rs @@ -6,7 +6,7 @@ use poseidon377::hash_2; use rand_core::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; -use penumbra_proto::{penumbra::core::keys::v1 as pb, serializers::bech32str, DomainType}; +use penumbra_sdk_proto::{penumbra::core::keys::v1 as pb, serializers::bech32str, DomainType}; use crate::keys::wallet_id::WalletId; use crate::{ diff --git a/crates/core/keys/src/keys/spend.rs b/crates/core/keys/src/keys/spend.rs index 311afece56..f5190e90fe 100644 --- a/crates/core/keys/src/keys/spend.rs +++ b/crates/core/keys/src/keys/spend.rs @@ -3,7 +3,7 @@ use std::convert::TryFrom; use hmac::Hmac; use pbkdf2::pbkdf2; -use penumbra_proto::{penumbra::core::keys::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::keys::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use super::{ @@ -173,7 +173,7 @@ impl TryFrom<&[u8]> for SpendKeyBytes { impl std::fmt::Display for SpendKey { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - use penumbra_proto::serializers::bech32str; + use penumbra_sdk_proto::serializers::bech32str; let proto = pb::SpendKey::from(self.clone()); f.write_str(&bech32str::encode( &proto.inner, @@ -187,7 +187,7 @@ impl std::str::FromStr for SpendKey { type Err = anyhow::Error; fn from_str(s: &str) -> Result { - use penumbra_proto::serializers::bech32str; + use penumbra_sdk_proto::serializers::bech32str; pb::SpendKey { inner: bech32str::decode(s, bech32str::spend_key::BECH32_PREFIX, bech32str::Bech32m)?, } diff --git a/crates/core/keys/src/keys/wallet_id.rs b/crates/core/keys/src/keys/wallet_id.rs index f67e03b263..a13de9f04e 100644 --- a/crates/core/keys/src/keys/wallet_id.rs +++ b/crates/core/keys/src/keys/wallet_id.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; -use penumbra_proto::core::keys::v1; -use penumbra_proto::{penumbra::core::keys::v1 as pb, serializers::bech32str, DomainType}; +use penumbra_sdk_proto::core::keys::v1; +use penumbra_sdk_proto::{penumbra::core::keys::v1 as pb, serializers::bech32str, DomainType}; /// The hash of a full viewing key, used as an account identifier. #[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] diff --git a/crates/core/keys/src/symmetric.rs b/crates/core/keys/src/symmetric.rs index e16e726f74..d6549eeded 100644 --- a/crates/core/keys/src/symmetric.rs +++ b/crates/core/keys/src/symmetric.rs @@ -5,9 +5,9 @@ use chacha20poly1305::{ ChaCha20Poly1305, Key, Nonce, }; use decaf377_ka as ka; -use penumbra_asset::balance; -use penumbra_proto::core::keys::v1::{self as pb}; -use penumbra_tct::StateCommitment; +use penumbra_sdk_asset::balance; +use penumbra_sdk_proto::core::keys::v1::{self as pb}; +use penumbra_sdk_tct::StateCommitment; use rand::{CryptoRng, RngCore}; pub const PAYLOAD_KEY_LEN_BYTES: usize = 32; @@ -47,7 +47,7 @@ impl PayloadKey { /// Use Blake2b-256 to derive a `PayloadKey`. pub fn derive(shared_secret: &ka::SharedSecret, epk: &ka::Public) -> Self { let mut kdf_params = blake2b_simd::Params::new(); - kdf_params.personal(b"Penumbra_Payload"); + kdf_params.personal(b"penumbra_sdk_Payload"); kdf_params.hash_length(32); let mut kdf = kdf_params.to_state(); kdf.update(&shared_secret.0); @@ -96,7 +96,7 @@ impl PayloadKey { let cm_bytes: [u8; 32] = cm.into(); let mut kdf_params = blake2b_simd::Params::new(); - kdf_params.personal(b"Penumbra_Payswap"); + kdf_params.personal(b"penumbra_sdk_Payswap"); kdf_params.hash_length(32); let mut kdf = kdf_params.to_state(); kdf.update(&ovk.to_bytes()); @@ -189,7 +189,7 @@ impl OutgoingCipherKey { let mut kdf_params = blake2b_simd::Params::new(); kdf_params.hash_length(32); - kdf_params.personal(b"Penumbra_OutCiph"); + kdf_params.personal(b"penumbra_sdk_OutCiph"); let mut kdf = kdf_params.to_state(); kdf.update(&ovk.to_bytes()); kdf.update(&cv_bytes); @@ -351,7 +351,7 @@ pub struct BackreferenceKey(pub Key); impl BackreferenceKey { pub fn derive(ovk: &OutgoingViewingKey) -> Self { let mut kdf_params = blake2b_simd::Params::new(); - kdf_params.personal(b"Penumbra_Backref"); + kdf_params.personal(b"penumbra_sdk_Backref"); kdf_params.hash_length(32); let mut kdf = kdf_params.to_state(); kdf.update(&ovk.to_bytes()); diff --git a/crates/core/keys/tests/test_wallet_id.rs b/crates/core/keys/tests/test_wallet_id.rs index 4931b71434..c0970c4f29 100644 --- a/crates/core/keys/tests/test_wallet_id.rs +++ b/crates/core/keys/tests/test_wallet_id.rs @@ -2,8 +2,8 @@ extern crate core; use std::str::FromStr; -use penumbra_keys::keys::{SeedPhrase, SpendKey}; -use penumbra_proto::serializers::bech32str; +use penumbra_sdk_keys::keys::{SeedPhrase, SpendKey}; +use penumbra_sdk_proto::serializers::bech32str; #[test] fn wallet_id_to_bech32() { diff --git a/crates/core/num/src/amount.rs b/crates/core/num/src/amount.rs index fbb9eb2ca6..186b19a2e8 100644 --- a/crates/core/num/src/amount.rs +++ b/crates/core/num/src/amount.rs @@ -2,7 +2,7 @@ use ark_ff::{BigInteger, PrimeField, ToConstraintField}; use ark_r1cs_std::{prelude::*, uint64::UInt64}; use ark_relations::r1cs::{ConstraintSystemRef, SynthesisError}; use decaf377::{Fq, Fr}; -use penumbra_proto::{penumbra::core::num::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::num::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use std::{fmt::Display, iter::Sum, num::NonZeroU128, ops}; @@ -545,7 +545,7 @@ impl Sum for Amount { #[cfg(test)] mod test { use crate::Amount; - use penumbra_proto::penumbra::core::num::v1 as pb; + use penumbra_sdk_proto::penumbra::core::num::v1 as pb; use rand::RngCore; use rand_core::OsRng; diff --git a/crates/core/transaction/src/action.rs b/crates/core/transaction/src/action.rs index 0ce196f431..68a5705e8f 100644 --- a/crates/core/transaction/src/action.rs +++ b/crates/core/transaction/src/action.rs @@ -1,12 +1,12 @@ use anyhow::anyhow; -use penumbra_auction::auction::dutch::actions::{ +use penumbra_sdk_auction::auction::dutch::actions::{ ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdraw, }; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use std::convert::{TryFrom, TryInto}; -use penumbra_asset::balance; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_asset::balance; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; use crate::{ActionView, IsAction, TransactionPerspective}; use serde::{Deserialize, Serialize}; @@ -16,31 +16,31 @@ use serde::{Deserialize, Serialize}; #[serde(try_from = "pb::Action", into = "pb::Action")] #[allow(clippy::large_enum_variant)] pub enum Action { - Output(penumbra_shielded_pool::Output), - Spend(penumbra_shielded_pool::Spend), - ValidatorDefinition(penumbra_stake::validator::Definition), - IbcRelay(penumbra_ibc::IbcRelay), - Swap(penumbra_dex::swap::Swap), - SwapClaim(penumbra_dex::swap_claim::SwapClaim), - ProposalSubmit(penumbra_governance::ProposalSubmit), - ProposalWithdraw(penumbra_governance::ProposalWithdraw), - DelegatorVote(penumbra_governance::DelegatorVote), - ValidatorVote(penumbra_governance::ValidatorVote), - ProposalDepositClaim(penumbra_governance::ProposalDepositClaim), + Output(penumbra_sdk_shielded_pool::Output), + Spend(penumbra_sdk_shielded_pool::Spend), + ValidatorDefinition(penumbra_sdk_stake::validator::Definition), + IbcRelay(penumbra_sdk_ibc::IbcRelay), + Swap(penumbra_sdk_dex::swap::Swap), + SwapClaim(penumbra_sdk_dex::swap_claim::SwapClaim), + ProposalSubmit(penumbra_sdk_governance::ProposalSubmit), + ProposalWithdraw(penumbra_sdk_governance::ProposalWithdraw), + DelegatorVote(penumbra_sdk_governance::DelegatorVote), + ValidatorVote(penumbra_sdk_governance::ValidatorVote), + ProposalDepositClaim(penumbra_sdk_governance::ProposalDepositClaim), - PositionOpen(penumbra_dex::lp::action::PositionOpen), - PositionClose(penumbra_dex::lp::action::PositionClose), - PositionWithdraw(penumbra_dex::lp::action::PositionWithdraw), + PositionOpen(penumbra_sdk_dex::lp::action::PositionOpen), + PositionClose(penumbra_sdk_dex::lp::action::PositionClose), + PositionWithdraw(penumbra_sdk_dex::lp::action::PositionWithdraw), - Delegate(penumbra_stake::Delegate), - Undelegate(penumbra_stake::Undelegate), - UndelegateClaim(penumbra_stake::UndelegateClaim), + Delegate(penumbra_sdk_stake::Delegate), + Undelegate(penumbra_sdk_stake::Undelegate), + UndelegateClaim(penumbra_sdk_stake::UndelegateClaim), - Ics20Withdrawal(penumbra_shielded_pool::Ics20Withdrawal), + Ics20Withdrawal(penumbra_sdk_shielded_pool::Ics20Withdrawal), - CommunityPoolSpend(penumbra_community_pool::CommunityPoolSpend), - CommunityPoolOutput(penumbra_community_pool::CommunityPoolOutput), - CommunityPoolDeposit(penumbra_community_pool::CommunityPoolDeposit), + CommunityPoolSpend(penumbra_sdk_community_pool::CommunityPoolSpend), + CommunityPoolOutput(penumbra_sdk_community_pool::CommunityPoolOutput), + CommunityPoolDeposit(penumbra_sdk_community_pool::CommunityPoolDeposit), ActionDutchAuctionSchedule(ActionDutchAuctionSchedule), ActionDutchAuctionEnd(ActionDutchAuctionEnd), diff --git a/crates/core/transaction/src/action_list.rs b/crates/core/transaction/src/action_list.rs index 8c9ce51b58..7278aa4de1 100644 --- a/crates/core/transaction/src/action_list.rs +++ b/crates/core/transaction/src/action_list.rs @@ -4,11 +4,11 @@ use std::collections::BTreeMap; use crate::plan::MemoPlan; use crate::{gas::GasCost, TransactionParameters}; use crate::{ActionPlan, TransactionPlan}; -use penumbra_asset::{asset, Balance}; -use penumbra_fee::{Fee, FeeTier, Gas, GasPrices}; -use penumbra_keys::Address; -use penumbra_num::Amount; -use penumbra_shielded_pool::{fmd, OutputPlan}; +use penumbra_sdk_asset::{asset, Balance}; +use penumbra_sdk_fee::{Fee, FeeTier, Gas, GasPrices}; +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; +use penumbra_sdk_shielded_pool::{fmd, OutputPlan}; use rand_core::{CryptoRng, RngCore}; /// A list of planned actions to be turned into a TransactionPlan. diff --git a/crates/core/transaction/src/auth_data.rs b/crates/core/transaction/src/auth_data.rs index 2897e33c98..9a6b00a856 100644 --- a/crates/core/transaction/src/auth_data.rs +++ b/crates/core/transaction/src/auth_data.rs @@ -1,7 +1,7 @@ use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; -use penumbra_txhash::EffectHash; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_txhash::EffectHash; /// Authorization data returned in response to a /// [`TransactionDescription`](crate::TransactionDescription). diff --git a/crates/core/transaction/src/detection_data.rs b/crates/core/transaction/src/detection_data.rs index b968a3e9ff..e306352f11 100644 --- a/crates/core/transaction/src/detection_data.rs +++ b/crates/core/transaction/src/detection_data.rs @@ -1,8 +1,8 @@ use anyhow::Error; use decaf377_fmd::Clue; -use penumbra_proto::core::transaction::v1 as pbt; -use penumbra_proto::DomainType; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_proto::core::transaction::v1 as pbt; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; /// Detection data used by a detection server using Fuzzy Message Detection. /// diff --git a/crates/core/transaction/src/gas.rs b/crates/core/transaction/src/gas.rs index 34b4ea035b..a2559ae5e1 100644 --- a/crates/core/transaction/src/gas.rs +++ b/crates/core/transaction/src/gas.rs @@ -1,16 +1,16 @@ -use penumbra_auction::auction::dutch::actions::{ +use penumbra_sdk_auction::auction::dutch::actions::{ ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdraw, }; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_dex::{PositionClose, PositionOpen, PositionWithdraw, Swap, SwapClaim}; -use penumbra_fee::Gas; -use penumbra_ibc::IbcRelay; -use penumbra_shielded_pool::{Ics20Withdrawal, Output, Spend}; -use penumbra_stake::{ +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_dex::{PositionClose, PositionOpen, PositionWithdraw, Swap, SwapClaim}; +use penumbra_sdk_fee::Gas; +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_shielded_pool::{Ics20Withdrawal, Output, Spend}; +use penumbra_sdk_stake::{ validator::Definition as ValidatorDefinition, Delegate, Undelegate, UndelegateClaim, }; -use penumbra_governance::{ +use penumbra_sdk_governance::{ DelegatorVote, ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, }; @@ -19,7 +19,7 @@ use crate::{ Action, Transaction, }; -use penumbra_proto::DomainType; +use penumbra_sdk_proto::DomainType; const NULLIFIER_SIZE: u64 = 2 + 32; const NOTEPAYLOAD_SIZE: u64 = 32 + 32 + 176; diff --git a/crates/core/transaction/src/is_action.rs b/crates/core/transaction/src/is_action.rs index 8784d0987c..b985f56e0a 100644 --- a/crates/core/transaction/src/is_action.rs +++ b/crates/core/transaction/src/is_action.rs @@ -1,12 +1,12 @@ use ark_ff::Zero; use decaf377::Fr; -use penumbra_asset::{balance, Value}; -use penumbra_auction::auction::dutch::actions::{ +use penumbra_sdk_asset::{balance, Value}; +use penumbra_sdk_auction::auction::dutch::actions::{ view::{ActionDutchAuctionScheduleView, ActionDutchAuctionWithdrawView}, ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdraw, }; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_dex::{ +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_dex::{ lp::{ action::{PositionClose, PositionOpen, PositionWithdraw}, position, LpNft, @@ -14,13 +14,13 @@ use penumbra_dex::{ swap::{Swap, SwapCiphertext, SwapView}, swap_claim::{SwapClaim, SwapClaimView}, }; -use penumbra_governance::{ +use penumbra_sdk_governance::{ DelegatorVote, DelegatorVoteView, ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, VotingReceiptToken, }; -use penumbra_ibc::IbcRelay; -use penumbra_shielded_pool::{Ics20Withdrawal, Note, Output, OutputView, Spend, SpendView}; -use penumbra_stake::{Delegate, Undelegate, UndelegateClaim}; +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_shielded_pool::{Ics20Withdrawal, Note, Output, OutputView, Spend, SpendView}; +use penumbra_sdk_stake::{Delegate, Undelegate, UndelegateClaim}; use crate::{Action, ActionView, TransactionPerspective}; diff --git a/crates/core/transaction/src/lib.rs b/crates/core/transaction/src/lib.rs index 71debd5f09..f4b8fce69a 100644 --- a/crates/core/transaction/src/lib.rs +++ b/crates/core/transaction/src/lib.rs @@ -39,7 +39,7 @@ pub use detection_data::DetectionData; pub use error::Error; pub use is_action::IsAction; pub use parameters::TransactionParameters; -pub use penumbra_txhash as txhash; +pub use penumbra_sdk_txhash as txhash; pub use plan::{ActionPlan, TransactionPlan}; pub use transaction::{Transaction, TransactionBody}; pub use view::{ActionView, MemoPlaintextView, MemoView, TransactionPerspective, TransactionView}; diff --git a/crates/core/transaction/src/memo.rs b/crates/core/transaction/src/memo.rs index aee628c8fa..f1c29632e6 100644 --- a/crates/core/transaction/src/memo.rs +++ b/crates/core/transaction/src/memo.rs @@ -6,16 +6,16 @@ use std::{ use anyhow::anyhow; use decaf377_ka as ka; -use penumbra_asset::balance; -use penumbra_keys::{ +use penumbra_sdk_asset::balance; +use penumbra_sdk_keys::{ address::ADDRESS_LEN_BYTES, keys::OutgoingViewingKey, symmetric::{OvkWrappedKey, PayloadKey, PayloadKind, WrappedMemoKey}, Address, }; -use penumbra_proto::{core::transaction::v1 as pbt, DomainType}; -use penumbra_shielded_pool::{note, Note}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_proto::{core::transaction::v1 as pbt, DomainType}; +use penumbra_sdk_shielded_pool::{note, Note}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; pub const MEMO_CIPHERTEXT_LEN_BYTES: usize = 528; @@ -264,8 +264,8 @@ mod tests { use super::*; use decaf377::Fr; - use penumbra_asset::{asset, Value}; - use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; + use penumbra_sdk_asset::{asset, Value}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; use proptest::prelude::*; diff --git a/crates/core/transaction/src/parameters.rs b/crates/core/transaction/src/parameters.rs index 1e3811cd56..291a4d8895 100644 --- a/crates/core/transaction/src/parameters.rs +++ b/crates/core/transaction/src/parameters.rs @@ -1,8 +1,8 @@ use anyhow::Error; -use penumbra_fee::Fee; -use penumbra_proto::core::transaction::v1 as pbt; -use penumbra_proto::DomainType; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_fee::Fee; +use penumbra_sdk_proto::core::transaction::v1 as pbt; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; /// Parameters determining when the transaction should be accepted to the chain. #[derive(Clone, Debug, Default)] diff --git a/crates/core/transaction/src/plan.rs b/crates/core/transaction/src/plan.rs index 7040d40da2..17280905b6 100644 --- a/crates/core/transaction/src/plan.rs +++ b/crates/core/transaction/src/plan.rs @@ -3,22 +3,22 @@ use anyhow::Result; use decaf377_fmd::Precision; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_dex::{ +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_dex::{ lp::action::{PositionClose, PositionOpen}, lp::plan::PositionWithdrawPlan, swap::SwapPlan, swap_claim::SwapClaimPlan, }; -use penumbra_governance::{ +use penumbra_sdk_governance::{ DelegatorVotePlan, ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, }; -use penumbra_ibc::IbcRelay; -use penumbra_keys::{Address, FullViewingKey, PayloadKey}; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; -use penumbra_shielded_pool::{Ics20Withdrawal, OutputPlan, SpendPlan}; -use penumbra_stake::{Delegate, Undelegate, UndelegateClaimPlan}; -use penumbra_txhash::{EffectHash, EffectingData}; +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_keys::{Address, FullViewingKey, PayloadKey}; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_shielded_pool::{Ics20Withdrawal, OutputPlan, SpendPlan}; +use penumbra_sdk_stake::{Delegate, Undelegate, UndelegateClaimPlan}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; use rand::{CryptoRng, Rng}; use serde::{Deserialize, Serialize}; @@ -173,7 +173,7 @@ impl TransactionPlan { pub fn validator_definitions( &self, - ) -> impl Iterator { + ) -> impl Iterator { self.actions.iter().filter_map(|action| { if let ActionPlan::ValidatorDefinition(d) = action { Some(d) @@ -436,17 +436,17 @@ impl TryFrom for TransactionPlan { #[cfg(test)] mod tests { - use penumbra_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; - use penumbra_dex::{swap::SwapPlaintext, swap::SwapPlan, TradingPair}; - use penumbra_fee::Fee; - use penumbra_keys::{ + use penumbra_sdk_asset::{asset, Value, STAKING_TOKEN_ASSET_ID}; + use penumbra_sdk_dex::{swap::SwapPlaintext, swap::SwapPlan, TradingPair}; + use penumbra_sdk_fee::Fee; + use penumbra_sdk_keys::{ keys::{Bip44Path, SeedPhrase, SpendKey}, Address, }; - use penumbra_shielded_pool::Note; - use penumbra_shielded_pool::{OutputPlan, SpendPlan}; - use penumbra_tct as tct; - use penumbra_txhash::EffectingData as _; + use penumbra_sdk_shielded_pool::Note; + use penumbra_sdk_shielded_pool::{OutputPlan, SpendPlan}; + use penumbra_sdk_tct as tct; + use penumbra_sdk_txhash::EffectingData as _; use rand_core::OsRng; use crate::{ diff --git a/crates/core/transaction/src/plan/action.rs b/crates/core/transaction/src/plan/action.rs index 6f1edace55..8ef121ce0d 100644 --- a/crates/core/transaction/src/plan/action.rs +++ b/crates/core/transaction/src/plan/action.rs @@ -3,14 +3,14 @@ use crate::WitnessData; use anyhow::{anyhow, Context, Result}; use ark_ff::Zero; use decaf377::Fr; -use penumbra_asset::Balance; -use penumbra_auction::auction::dutch::actions::ActionDutchAuctionEnd; -use penumbra_auction::auction::dutch::actions::ActionDutchAuctionSchedule; -use penumbra_auction::auction::dutch::actions::ActionDutchAuctionWithdrawPlan; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_txhash::{EffectHash, EffectingData}; - -use penumbra_dex::{ +use penumbra_sdk_asset::Balance; +use penumbra_sdk_auction::auction::dutch::actions::ActionDutchAuctionEnd; +use penumbra_sdk_auction::auction::dutch::actions::ActionDutchAuctionSchedule; +use penumbra_sdk_auction::auction::dutch::actions::ActionDutchAuctionWithdrawPlan; +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_txhash::{EffectHash, EffectingData}; + +use penumbra_sdk_dex::{ lp::{ action::{PositionClose, PositionOpen}, plan::PositionWithdrawPlan, @@ -18,16 +18,16 @@ use penumbra_dex::{ swap::SwapPlan, swap_claim::SwapClaimPlan, }; -use penumbra_governance::{ +use penumbra_sdk_governance::{ delegator_vote::DelegatorVotePlan, ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, }; -use penumbra_ibc::IbcRelay; -use penumbra_keys::{symmetric::PayloadKey, FullViewingKey}; -use penumbra_proto::{core::transaction::v1 as pb_t, DomainType}; -use penumbra_shielded_pool::{Ics20Withdrawal, OutputPlan, SpendPlan}; -use penumbra_stake::{Delegate, Undelegate, UndelegateClaimPlan}; +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_keys::{symmetric::PayloadKey, FullViewingKey}; +use penumbra_sdk_proto::{core::transaction::v1 as pb_t, DomainType}; +use penumbra_sdk_shielded_pool::{Ics20Withdrawal, OutputPlan, SpendPlan}; +use penumbra_sdk_stake::{Delegate, Undelegate, UndelegateClaimPlan}; use serde::{Deserialize, Serialize}; /// A declaration of a planned [`Action`], for use in transaction creation. @@ -50,7 +50,7 @@ pub enum ActionPlan { /// because we don't yet use flow encryption. Undelegate(Undelegate), UndelegateClaim(UndelegateClaimPlan), - ValidatorDefinition(penumbra_stake::validator::Definition), + ValidatorDefinition(penumbra_sdk_stake::validator::Definition), /// Describes a proposed swap. Swap(SwapPlan), /// Describes a swap claim. @@ -337,8 +337,8 @@ impl From for ActionPlan { } } -impl From for ActionPlan { - fn from(inner: penumbra_stake::validator::Definition) -> ActionPlan { +impl From for ActionPlan { + fn from(inner: penumbra_sdk_stake::validator::Definition) -> ActionPlan { ActionPlan::ValidatorDefinition(inner) } } @@ -498,7 +498,7 @@ impl From for pb_t::ActionPlan { }, ActionPlan::PositionWithdraw(inner) => pb_t::ActionPlan { action: Some(pb_t::action_plan::Action::PositionWithdraw(Into::< - penumbra_proto::core::component::dex::v1::PositionWithdrawPlan, + penumbra_sdk_proto::core::component::dex::v1::PositionWithdrawPlan, >::into( inner ))), diff --git a/crates/core/transaction/src/plan/auth.rs b/crates/core/transaction/src/plan/auth.rs index bd32bc0ced..831d34f075 100644 --- a/crates/core/transaction/src/plan/auth.rs +++ b/crates/core/transaction/src/plan/auth.rs @@ -1,7 +1,7 @@ use anyhow::Result; use rand::{CryptoRng, RngCore}; -use penumbra_keys::keys::SpendKey; +use penumbra_sdk_keys::keys::SpendKey; use crate::{AuthorizationData, TransactionPlan}; diff --git a/crates/core/transaction/src/plan/build.rs b/crates/core/transaction/src/plan/build.rs index 0b687b017f..1eb831a162 100644 --- a/crates/core/transaction/src/plan/build.rs +++ b/crates/core/transaction/src/plan/build.rs @@ -2,8 +2,8 @@ use anyhow::Result; use ark_ff::Zero; use decaf377::Fr; use decaf377_rdsa as rdsa; -use penumbra_keys::FullViewingKey; -use penumbra_txhash::AuthorizingData; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_txhash::AuthorizingData; use super::TransactionPlan; use crate::ActionPlan; @@ -191,10 +191,10 @@ impl TransactionPlan { } /// Returns a [`WitnessData`], which may be used to build this transaction. - pub fn witness_data(&self, sct: &penumbra_tct::Tree) -> Result { + pub fn witness_data(&self, sct: &penumbra_sdk_tct::Tree) -> Result { let anchor = sct.root(); - let witness_note = |spend: &penumbra_shielded_pool::SpendPlan| { + let witness_note = |spend: &penumbra_sdk_shielded_pool::SpendPlan| { let commitment = spend.note.commit(); sct.witness(commitment) .ok_or_else(|| anyhow::anyhow!("commitment should exist in tree")) diff --git a/crates/core/transaction/src/plan/clue.rs b/crates/core/transaction/src/plan/clue.rs index 66e648da95..faa6febb52 100644 --- a/crates/core/transaction/src/plan/clue.rs +++ b/crates/core/transaction/src/plan/clue.rs @@ -1,6 +1,6 @@ use decaf377_fmd::{Clue, Precision}; -use penumbra_keys::Address; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; use rand::{CryptoRng, RngCore}; diff --git a/crates/core/transaction/src/plan/detection_data.rs b/crates/core/transaction/src/plan/detection_data.rs index 7ea26e3881..8a4a18b069 100644 --- a/crates/core/transaction/src/plan/detection_data.rs +++ b/crates/core/transaction/src/plan/detection_data.rs @@ -1,7 +1,7 @@ use crate::DetectionData; use super::CluePlan; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Default, Serialize, Deserialize)] diff --git a/crates/core/transaction/src/plan/memo.rs b/crates/core/transaction/src/plan/memo.rs index 84ff9cf190..b0107996be 100644 --- a/crates/core/transaction/src/plan/memo.rs +++ b/crates/core/transaction/src/plan/memo.rs @@ -1,6 +1,6 @@ use anyhow::Context; -use penumbra_keys::{symmetric::PayloadKey, Address}; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_keys::{symmetric::PayloadKey, Address}; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; use rand::{CryptoRng, RngCore}; diff --git a/crates/core/transaction/src/plan/spend.rs b/crates/core/transaction/src/plan/spend.rs index f5565df95f..a43d6fd41b 100644 --- a/crates/core/transaction/src/plan/spend.rs +++ b/crates/core/transaction/src/plan/spend.rs @@ -1,2 +1,2 @@ -// use penumbra_tct::Tree; -// use {super::*, penumbra_proto::DomainType, penumbra_shielded_pool::SpendPlan}; +// use penumbra_sdk_tct::Tree; +// use {super::*, penumbra_sdk_proto::DomainType, penumbra_sdk_shielded_pool::SpendPlan}; diff --git a/crates/core/transaction/src/transaction.rs b/crates/core/transaction/src/transaction.rs index 39a7113248..1307a1a428 100644 --- a/crates/core/transaction/src/transaction.rs +++ b/crates/core/transaction/src/transaction.rs @@ -7,25 +7,25 @@ use anyhow::{Context, Error}; use ark_ff::Zero; use decaf377::Fr; use decaf377_rdsa::{Binding, Signature, VerificationKey, VerificationKeyBytes}; -use penumbra_asset::Balance; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_dex::{ +use penumbra_sdk_asset::Balance; +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_dex::{ lp::action::{PositionClose, PositionOpen}, swap::Swap, }; -use penumbra_governance::{DelegatorVote, ProposalSubmit, ProposalWithdraw, ValidatorVote}; -use penumbra_ibc::IbcRelay; -use penumbra_keys::{AddressView, FullViewingKey, PayloadKey}; -use penumbra_proto::{ +use penumbra_sdk_governance::{DelegatorVote, ProposalSubmit, ProposalWithdraw, ValidatorVote}; +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_keys::{AddressView, FullViewingKey, PayloadKey}; +use penumbra_sdk_proto::{ core::transaction::v1::{self as pbt}, DomainType, Message, }; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{Note, Output, Spend}; -use penumbra_stake::{Delegate, Undelegate, UndelegateClaim}; -use penumbra_tct as tct; -use penumbra_tct::StateCommitment; -use penumbra_txhash::{ +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{Note, Output, Spend}; +use penumbra_sdk_stake::{Delegate, Undelegate, UndelegateClaim}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_tct::StateCommitment; +use penumbra_sdk_txhash::{ AuthHash, AuthorizingData, EffectHash, EffectingData, TransactionContext, TransactionId, }; use serde::{Deserialize, Serialize}; @@ -437,7 +437,7 @@ impl Transaction { pub fn validator_definitions( &self, - ) -> impl Iterator { + ) -> impl Iterator { self.actions().filter_map(|action| { if let Action::ValidatorDefinition(d) = action { Some(d) diff --git a/crates/core/transaction/src/view.rs b/crates/core/transaction/src/view.rs index e4cd0f800c..5e0540e1bb 100644 --- a/crates/core/transaction/src/view.rs +++ b/crates/core/transaction/src/view.rs @@ -1,17 +1,17 @@ use anyhow::Context; use decaf377_rdsa::{Binding, Signature}; -use penumbra_asset::{Balance, Value}; -use penumbra_dex::{swap::SwapView, swap_claim::SwapClaimView}; -use penumbra_keys::AddressView; -use penumbra_proto::{core::transaction::v1 as pbt, DomainType}; -use penumbra_shielded_pool::{OutputView, SpendView}; +use penumbra_sdk_asset::{Balance, Value}; +use penumbra_sdk_dex::{swap::SwapView, swap_claim::SwapClaimView}; +use penumbra_sdk_keys::AddressView; +use penumbra_sdk_proto::{core::transaction::v1 as pbt, DomainType}; +use penumbra_sdk_shielded_pool::{OutputView, SpendView}; use serde::{Deserialize, Serialize}; pub mod action_view; mod transaction_perspective; pub use action_view::ActionView; -use penumbra_tct as tct; +use penumbra_sdk_tct as tct; pub use transaction_perspective::TransactionPerspective; use crate::{ @@ -435,32 +435,32 @@ mod test { use decaf377::Fr; use decaf377::{Element, Fq}; use decaf377_rdsa::{Domain, VerificationKey}; - use penumbra_asset::{ + use penumbra_sdk_asset::{ asset::{self, Cache, Id}, balance::Commitment, STAKING_TOKEN_ASSET_ID, }; - use penumbra_dex::swap::proof::SwapProof; - use penumbra_dex::swap::{SwapCiphertext, SwapPayload}; - use penumbra_dex::Swap; - use penumbra_dex::{ + use penumbra_sdk_dex::swap::proof::SwapProof; + use penumbra_sdk_dex::swap::{SwapCiphertext, SwapPayload}; + use penumbra_sdk_dex::Swap; + use penumbra_sdk_dex::{ swap::{SwapPlaintext, SwapPlan}, TradingPair, }; - use penumbra_fee::Fee; - use penumbra_keys::keys::Bip44Path; - use penumbra_keys::keys::{SeedPhrase, SpendKey}; - use penumbra_keys::{ + use penumbra_sdk_fee::Fee; + use penumbra_sdk_keys::keys::Bip44Path; + use penumbra_sdk_keys::keys::{SeedPhrase, SpendKey}; + use penumbra_sdk_keys::{ symmetric::{OvkWrappedKey, WrappedMemoKey}, test_keys, Address, FullViewingKey, PayloadKey, }; - use penumbra_num::Amount; - use penumbra_proof_params::GROTH16_PROOF_LENGTH_BYTES; - use penumbra_sct::Nullifier; - use penumbra_shielded_pool::Rseed; - use penumbra_shielded_pool::{output, spend, Note, NoteView, OutputPlan, SpendPlan}; - use penumbra_tct::structure::Hash; - use penumbra_tct::StateCommitment; + use penumbra_sdk_num::Amount; + use penumbra_sdk_proof_params::GROTH16_PROOF_LENGTH_BYTES; + use penumbra_sdk_sct::Nullifier; + use penumbra_sdk_shielded_pool::Rseed; + use penumbra_sdk_shielded_pool::{output, spend, Note, NoteView, OutputPlan, SpendPlan}; + use penumbra_sdk_tct::structure::Hash; + use penumbra_sdk_tct::StateCommitment; use rand_core::OsRng; use std::ops::Deref; @@ -488,7 +488,7 @@ mod test { #[cfg(test)] fn dummy_proof_spend() -> spend::SpendProof { spend::SpendProof::try_from( - penumbra_proto::penumbra::core::component::shielded_pool::v1::ZkSpendProof { + penumbra_sdk_proto::penumbra::core::component::shielded_pool::v1::ZkSpendProof { inner: vec![0u8; GROTH16_PROOF_LENGTH_BYTES], }, ) @@ -498,7 +498,7 @@ mod test { #[cfg(test)] fn dummy_proof_output() -> output::OutputProof { output::OutputProof::try_from( - penumbra_proto::penumbra::core::component::shielded_pool::v1::ZkOutputProof { + penumbra_sdk_proto::penumbra::core::component::shielded_pool::v1::ZkOutputProof { inner: vec![0u8; GROTH16_PROOF_LENGTH_BYTES], }, ) @@ -508,7 +508,7 @@ mod test { #[cfg(test)] fn dummy_proof_swap() -> SwapProof { SwapProof::try_from( - penumbra_proto::penumbra::core::component::dex::v1::ZkSwapProof { + penumbra_sdk_proto::penumbra::core::component::dex::v1::ZkSwapProof { inner: vec![0u8; GROTH16_PROOF_LENGTH_BYTES], }, ) @@ -517,7 +517,7 @@ mod test { #[cfg(test)] fn dummy_spend() -> spend::Spend { - use penumbra_shielded_pool::EncryptedBackref; + use penumbra_sdk_shielded_pool::EncryptedBackref; spend::Spend { body: spend::Body { @@ -535,13 +535,13 @@ mod test { fn dummy_output() -> output::Output { output::Output { body: output::Body { - note_payload: penumbra_shielded_pool::NotePayload { - note_commitment: penumbra_shielded_pool::note::StateCommitment(Fq::default()), + note_payload: penumbra_sdk_shielded_pool::NotePayload { + note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment(Fq::default()), ephemeral_key: [0u8; 32] .as_slice() .try_into() .expect("can create dummy ephemeral key"), - encrypted_note: penumbra_shielded_pool::NoteCiphertext([0u8; 176]), + encrypted_note: penumbra_sdk_shielded_pool::NoteCiphertext([0u8; 176]), }, balance_commitment: dummy_commitment(), ovk_wrapped_key: OvkWrappedKey([0u8; 48]), @@ -581,7 +581,7 @@ mod test { #[cfg(test)] fn dummy_swap() -> Swap { - use penumbra_dex::swap::Body; + use penumbra_sdk_dex::swap::Body; let seed_phrase = SeedPhrase::generate(OsRng); let sk_recipient = SpendKey::from_seed_phrase_bip44(seed_phrase, &Bip44Path::new(0)); @@ -662,7 +662,7 @@ mod test { match action { ActionPlan::Output(x) => Some(ActionView::Output( - penumbra_shielded_pool::OutputView::Visible { + penumbra_sdk_shielded_pool::OutputView::Visible { output: dummy_output(), note: convert_note(cache, fvk, &x.output_note()), payload_key: PayloadKey::from([0u8; 32]), @@ -768,7 +768,7 @@ mod test { }; let transaction_view = TransactionView { - anchor: penumbra_tct::Root(Hash::zero()), + anchor: penumbra_sdk_tct::Root(Hash::zero()), binding_sig: Signature::from([0u8; 64]), body_view: TransactionBodyView { action_views: plan @@ -864,7 +864,7 @@ mod test { }; let transaction_view = TransactionView { - anchor: penumbra_tct::Root(Hash::zero()), + anchor: penumbra_sdk_tct::Root(Hash::zero()), binding_sig: Signature::from([0u8; 64]), body_view: TransactionBodyView { action_views: plan diff --git a/crates/core/transaction/src/view/action_view.rs b/crates/core/transaction/src/view/action_view.rs index 4ed7ecb537..938ffd5249 100644 --- a/crates/core/transaction/src/view/action_view.rs +++ b/crates/core/transaction/src/view/action_view.rs @@ -1,23 +1,23 @@ -use penumbra_auction::auction::dutch::{ +use penumbra_sdk_auction::auction::dutch::{ actions::view::{ActionDutchAuctionScheduleView, ActionDutchAuctionWithdrawView}, ActionDutchAuctionEnd, }; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_dex::{ +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_dex::{ lp::action::{PositionClose, PositionOpen, PositionWithdraw}, swap::SwapView, swap_claim::SwapClaimView, }; -use penumbra_governance::{ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote}; -use penumbra_ibc::IbcRelay; -use penumbra_proto::{core::transaction::v1 as pbt, DomainType}; -use penumbra_shielded_pool::Ics20Withdrawal; -use penumbra_stake::{Delegate, Undelegate, UndelegateClaim}; +use penumbra_sdk_governance::{ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote}; +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_proto::{core::transaction::v1 as pbt, DomainType}; +use penumbra_sdk_shielded_pool::Ics20Withdrawal; +use penumbra_sdk_stake::{Delegate, Undelegate, UndelegateClaim}; use serde::{Deserialize, Serialize}; -pub use penumbra_governance::DelegatorVoteView; -pub use penumbra_shielded_pool::OutputView; -pub use penumbra_shielded_pool::SpendView; +pub use penumbra_sdk_governance::DelegatorVoteView; +pub use penumbra_sdk_shielded_pool::OutputView; +pub use penumbra_sdk_shielded_pool::SpendView; use crate::Action; @@ -32,7 +32,7 @@ pub enum ActionView { SwapClaim(SwapClaimView), DelegatorVote(DelegatorVoteView), // Action types with transparent contents - ValidatorDefinition(penumbra_stake::validator::Definition), + ValidatorDefinition(penumbra_sdk_stake::validator::Definition), IbcRelay(IbcRelay), ProposalSubmit(ProposalSubmit), ProposalWithdraw(ProposalWithdraw), diff --git a/crates/core/transaction/src/view/transaction_perspective.rs b/crates/core/transaction/src/view/transaction_perspective.rs index a81ab0b865..df41b3204f 100644 --- a/crates/core/transaction/src/view/transaction_perspective.rs +++ b/crates/core/transaction/src/view/transaction_perspective.rs @@ -1,14 +1,14 @@ use anyhow::anyhow; use pbjson_types::Any; -use penumbra_asset::{asset, EstimatedPrice, Value, ValueView}; -use penumbra_dex::BatchSwapOutputData; -use penumbra_keys::{Address, AddressView, PayloadKey}; -use penumbra_proto::core::transaction::v1::{ +use penumbra_sdk_asset::{asset, EstimatedPrice, Value, ValueView}; +use penumbra_sdk_dex::BatchSwapOutputData; +use penumbra_sdk_keys::{Address, AddressView, PayloadKey}; +use penumbra_sdk_proto::core::transaction::v1::{ self as pb, NullifierWithNote, PayloadKeyWithCommitment, }; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{note, Note, NoteView}; -use penumbra_txhash::TransactionId; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{note, Note, NoteView}; +use penumbra_sdk_txhash::TransactionId; use std::collections::BTreeMap; @@ -214,7 +214,7 @@ impl TryFrom for TransactionPerspective { for denom in msg.denoms { denoms.insert( denom - .penumbra_asset_id + .penumbra_sdk_asset_id .clone() .ok_or_else(|| anyhow!("missing penumbra asset ID in denom"))? .try_into()?, diff --git a/crates/core/transaction/src/witness_data.rs b/crates/core/transaction/src/witness_data.rs index 557e34d64e..f5d7f40ce1 100644 --- a/crates/core/transaction/src/witness_data.rs +++ b/crates/core/transaction/src/witness_data.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; -use penumbra_proto::{core::transaction::v1 as pb, DomainType}; -use penumbra_shielded_pool::note; -use penumbra_tct as tct; +use penumbra_sdk_proto::{core::transaction::v1 as pb, DomainType}; +use penumbra_sdk_shielded_pool::note; +use penumbra_sdk_tct as tct; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs b/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs index 969d1c55ef..4172659c49 100644 --- a/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs +++ b/crates/core/transaction/tests/generate_transaction_signing_test_vectors.rs @@ -8,8 +8,8 @@ use ibc_types::core::{ commitment::MerkleProof, }; use ibc_types::timestamp::Timestamp; -use penumbra_asset::asset::{Id, Metadata}; -use penumbra_auction::auction::{ +use penumbra_sdk_asset::asset::{Id, Metadata}; +use penumbra_sdk_auction::auction::{ dutch::{ actions::{ ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdrawPlan, @@ -18,8 +18,8 @@ use penumbra_auction::auction::{ }, AuctionId, }; -use penumbra_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; -use penumbra_dex::{ +use penumbra_sdk_community_pool::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend}; +use penumbra_sdk_dex::{ lp::{ plan::PositionWithdrawPlan, position::{Position, State as PositionState}, @@ -29,25 +29,25 @@ use penumbra_dex::{ swap_claim::SwapClaimPlan, BatchSwapOutputData, PositionClose, PositionOpen, TradingPair, }; -use penumbra_fee::Fee; -use penumbra_governance::{ +use penumbra_sdk_fee::Fee; +use penumbra_sdk_governance::{ proposal_state::{Outcome as ProposalOutcome, Withdrawn}, DelegatorVotePlan, Proposal, ProposalDepositClaim, ProposalPayload, ProposalSubmit, ProposalWithdraw, ValidatorVote, ValidatorVoteBody, ValidatorVoteReason, Vote, }; -use penumbra_ibc::IbcRelay; -use penumbra_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; -use penumbra_keys::test_keys::SEED_PHRASE; -use penumbra_keys::{Address, FullViewingKey}; -use penumbra_num::Amount; -use penumbra_proto::DomainType; -use penumbra_sct::epoch::Epoch; -use penumbra_shielded_pool::{Ics20Withdrawal, Note, OutputPlan, Rseed, SpendPlan}; -use penumbra_stake::{ +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; +use penumbra_sdk_keys::test_keys::SEED_PHRASE; +use penumbra_sdk_keys::{Address, FullViewingKey}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_sct::epoch::Epoch; +use penumbra_sdk_shielded_pool::{Ics20Withdrawal, Note, OutputPlan, Rseed, SpendPlan}; +use penumbra_sdk_stake::{ validator, validator::Definition, Delegate, FundingStreams, GovernanceKey, IdentityKey, Penalty, Undelegate, UndelegateClaimPlan, }; -use penumbra_transaction::{ActionPlan, TransactionParameters, TransactionPlan}; +use penumbra_sdk_transaction::{ActionPlan, TransactionParameters, TransactionPlan}; use proptest::prelude::*; use proptest::strategy::ValueTree; use proptest::test_runner::{Config, TestRunner}; @@ -63,12 +63,12 @@ fn amount_strategy() -> impl Strategy { } fn asset_id_strategy() -> impl Strategy { - Just(*penumbra_asset::STAKING_TOKEN_ASSET_ID) + Just(*penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID) } -fn value_strategy() -> impl Strategy { +fn value_strategy() -> impl Strategy { (asset_id_strategy(), amount_strategy()) - .prop_map(|(asset_id, amount)| penumbra_asset::Value { amount, asset_id }) + .prop_map(|(asset_id, amount)| penumbra_sdk_asset::Value { amount, asset_id }) } fn address_strategy() -> impl Strategy { @@ -88,7 +88,7 @@ fn note_strategy(addr: Address) -> impl Strategy { } fn spend_plan_strategy(fvk: &FullViewingKey) -> impl Strategy { - let tct_strategy = any::(); + let tct_strategy = any::(); let note_strategy = note_strategy(fvk.incoming().payment_address(0u32.into()).0); (tct_strategy, note_strategy) @@ -298,7 +298,7 @@ fn swap_claim_plan_strategy() -> impl Strategy { (swap_plaintext_strategy(), batch_swap_output_data_strategy()).prop_map( |(swap_plaintext, output_data)| SwapClaimPlan { swap_plaintext, - position: penumbra_tct::Position::from(0u64), + position: penumbra_sdk_tct::Position::from(0u64), output_data, epoch_duration: 1000u64, proof_blinding_r: Fq::rand(&mut OsRng), @@ -401,10 +401,10 @@ fn delegator_vote_strategy() -> impl Strategy { |(proposal, vote, unbonded_amount, staked_note)| DelegatorVotePlan { proposal, vote, - start_position: penumbra_tct::Position::from(0u64), + start_position: penumbra_sdk_tct::Position::from(0u64), staked_note, unbonded_amount, - position: penumbra_tct::Position::from(0u64), + position: penumbra_sdk_tct::Position::from(0u64), randomizer: Fr::rand(&mut OsRng), proof_blinding_r: Fq::rand(&mut OsRng), proof_blinding_s: Fq::rand(&mut OsRng), diff --git a/crates/core/txhash/src/context.rs b/crates/core/txhash/src/context.rs index 672d003ac4..e036657a5a 100644 --- a/crates/core/txhash/src/context.rs +++ b/crates/core/txhash/src/context.rs @@ -1,5 +1,5 @@ use crate::EffectHash; -use penumbra_tct as tct; +use penumbra_sdk_tct as tct; /// Stateless verification context for a transaction. /// diff --git a/crates/core/txhash/src/effect_hash.rs b/crates/core/txhash/src/effect_hash.rs index aefc84c8aa..c775bdc0d9 100644 --- a/crates/core/txhash/src/effect_hash.rs +++ b/crates/core/txhash/src/effect_hash.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{penumbra::core::txhash::v1 as pb, DomainType, Message, Name}; +use penumbra_sdk_proto::{penumbra::core::txhash::v1 as pb, DomainType, Message, Name}; /// A hash of a transaction's _effecting data_, describing its effects on the /// chain state. diff --git a/crates/core/txhash/src/transaction_id.rs b/crates/core/txhash/src/transaction_id.rs index cc270b33ea..e06e77e436 100644 --- a/crates/core/txhash/src/transaction_id.rs +++ b/crates/core/txhash/src/transaction_id.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use penumbra_proto::{penumbra::core::txhash::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::core::txhash::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// A transaction ID (hash), the Sha256 hash used by Tendermint to identify transactions. diff --git a/crates/crypto/decaf377-frost/src/keys/dkg.rs b/crates/crypto/decaf377-frost/src/keys/dkg.rs index 1146faf8a9..2650c88be0 100644 --- a/crates/crypto/decaf377-frost/src/keys/dkg.rs +++ b/crates/crypto/decaf377-frost/src/keys/dkg.rs @@ -1,6 +1,6 @@ //! Distributed key generation without a trusted dealer. use anyhow::anyhow; -use penumbra_proto::crypto::decaf377_frost::v1 as pb; +use penumbra_sdk_proto::crypto::decaf377_frost::v1 as pb; // Copied from frost-ed25519 ("MIT or Apache-2.0") (more or less) @@ -8,7 +8,7 @@ use super::*; /// DKG Round 1 structures. pub mod round1 { - use penumbra_proto::DomainType; + use penumbra_sdk_proto::DomainType; use super::*; @@ -65,7 +65,7 @@ pub mod round1 { /// DKG Round 2 structures. pub mod round2 { - use penumbra_proto::DomainType; + use penumbra_sdk_proto::DomainType; use super::*; diff --git a/crates/crypto/decaf377-frost/src/lib.rs b/crates/crypto/decaf377-frost/src/lib.rs index d3cbcf749e..90dfcf07c6 100644 --- a/crates/crypto/decaf377-frost/src/lib.rs +++ b/crates/crypto/decaf377-frost/src/lib.rs @@ -8,7 +8,7 @@ use anyhow::anyhow; use frost_core::frost; -use penumbra_proto::crypto::decaf377_frost::v1 as pb; +use penumbra_sdk_proto::crypto::decaf377_frost::v1 as pb; use std::collections::{BTreeMap, HashMap}; /// A FROST-related error. @@ -33,7 +33,7 @@ pub type Identifier = frost::Identifier; /// Signing round 1 functionality and types. pub mod round1 { - use penumbra_proto::DomainType; + use penumbra_sdk_proto::DomainType; use crate::keys::SigningShare; @@ -138,7 +138,7 @@ impl SigningPackage { /// Signing Round 2 functionality and types. pub mod round2 { use frost_rerandomized::Randomizer; - use penumbra_proto::DomainType; + use penumbra_sdk_proto::DomainType; use super::*; diff --git a/crates/crypto/proof-setup/benches/all.rs b/crates/crypto/proof-setup/benches/all.rs index 0ef7a756ca..bd52d5590e 100644 --- a/crates/crypto/proof-setup/benches/all.rs +++ b/crates/crypto/proof-setup/benches/all.rs @@ -1,5 +1,5 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use penumbra_proof_setup::all::{ +use penumbra_sdk_proof_setup::all::{ transition, AllExtraTransitionInformation, Phase1CeremonyCRS, Phase1CeremonyContribution, Phase1RawCeremonyContribution, Phase2CeremonyCRS, Phase2CeremonyContribution, Phase2RawCeremonyContribution, diff --git a/crates/crypto/proof-setup/src/all.rs b/crates/crypto/proof-setup/src/all.rs index b3c0f9f0d9..a3e4331b29 100644 --- a/crates/crypto/proof-setup/src/all.rs +++ b/crates/crypto/proof-setup/src/all.rs @@ -19,11 +19,11 @@ use ark_groth16::ProvingKey; use ark_relations::r1cs::ConstraintMatrices; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; use decaf377::Bls12_377; -use penumbra_dex::{swap::proof::SwapCircuit, swap_claim::proof::SwapClaimCircuit}; -use penumbra_governance::DelegatorVoteCircuit; -use penumbra_proof_params::generate_constraint_matrices; -use penumbra_proto::tools::summoning::v1::{self as pb}; -use penumbra_shielded_pool::{ +use penumbra_sdk_dex::{swap::proof::SwapCircuit, swap_claim::proof::SwapClaimCircuit}; +use penumbra_sdk_governance::DelegatorVoteCircuit; +use penumbra_sdk_proof_params::generate_constraint_matrices; +use penumbra_sdk_proto::tools::summoning::v1::{self as pb}; +use penumbra_sdk_shielded_pool::{ ConvertCircuit, NullifierDerivationCircuit, OutputCircuit, SpendCircuit, }; diff --git a/crates/crypto/tct/src/block.rs b/crates/crypto/tct/src/block.rs index 96b88c05a4..ecaae19d85 100644 --- a/crates/crypto/tct/src/block.rs +++ b/crates/crypto/tct/src/block.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use decaf377::Fq; use hash_hasher::HashedMap; -use penumbra_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::error::block::*; diff --git a/crates/crypto/tct/src/commitment.rs b/crates/crypto/tct/src/commitment.rs index 8cbe477576..4d10cf3538 100644 --- a/crates/crypto/tct/src/commitment.rs +++ b/crates/crypto/tct/src/commitment.rs @@ -1,5 +1,5 @@ use decaf377::Fq; -use penumbra_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; /// A commitment to a note or swap. #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] diff --git a/crates/crypto/tct/src/epoch.rs b/crates/crypto/tct/src/epoch.rs index 53e97aeb90..7aa28b31e3 100644 --- a/crates/crypto/tct/src/epoch.rs +++ b/crates/crypto/tct/src/epoch.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use decaf377::Fq; use hash_hasher::HashedMap; -use penumbra_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::error::epoch::*; diff --git a/crates/crypto/tct/src/internal/path.rs b/crates/crypto/tct/src/internal/path.rs index 88a8cbb351..ec7ea8b1a8 100644 --- a/crates/crypto/tct/src/internal/path.rs +++ b/crates/crypto/tct/src/internal/path.rs @@ -235,7 +235,7 @@ mod test { pub struct PathDecodeError; use decaf377::Fq; -use penumbra_proto::penumbra::crypto::tct::v1 as pb; +use penumbra_sdk_proto::penumbra::crypto::tct::v1 as pb; use std::{ collections::VecDeque, ops::{Index, IndexMut}, diff --git a/crates/crypto/tct/src/internal/proof.rs b/crates/crypto/tct/src/internal/proof.rs index 369684d4a0..13f18b317d 100644 --- a/crates/crypto/tct/src/internal/proof.rs +++ b/crates/crypto/tct/src/internal/proof.rs @@ -70,7 +70,7 @@ impl VerifyError { pub struct ProofDecodeError; use decaf377::Fq; -use penumbra_proto::penumbra::crypto::tct::v1 as pb; +use penumbra_sdk_proto::penumbra::crypto::tct::v1 as pb; impl From> for pb::StateCommitmentProof where diff --git a/crates/crypto/tct/src/proof.rs b/crates/crypto/tct/src/proof.rs index a46b331c52..fe1199d86a 100644 --- a/crates/crypto/tct/src/proof.rs +++ b/crates/crypto/tct/src/proof.rs @@ -121,7 +121,7 @@ impl Proof { } } -use penumbra_proto::penumbra::crypto::tct::v1 as pb; +use penumbra_sdk_proto::penumbra::crypto::tct::v1 as pb; use rand::Rng; impl From for pb::StateCommitmentProof { @@ -138,6 +138,6 @@ impl TryFrom for Proof { } } -impl penumbra_proto::DomainType for Proof { +impl penumbra_sdk_proto::DomainType for Proof { type Proto = pb::StateCommitmentProof; } diff --git a/crates/crypto/tct/src/tree.rs b/crates/crypto/tct/src/tree.rs index 4e4f55fa22..3721486fbb 100644 --- a/crates/crypto/tct/src/tree.rs +++ b/crates/crypto/tct/src/tree.rs @@ -4,7 +4,7 @@ use std::{ }; use decaf377::Fq; -use penumbra_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; +use penumbra_sdk_proto::{penumbra::crypto::tct::v1 as pb, DomainType}; use crate::error::*; use crate::prelude::{Witness as _, *}; diff --git a/crates/custody/src/client.rs b/crates/custody/src/client.rs index 10b014a9ef..15d9ebf58b 100644 --- a/crates/custody/src/client.rs +++ b/crates/custody/src/client.rs @@ -1,7 +1,7 @@ use anyhow::Result; use futures::FutureExt; -use penumbra_proto::custody::v1::custody_service_client::CustodyServiceClient; -use penumbra_proto::custody::v1::AuthorizeResponse; +use penumbra_sdk_proto::custody::v1::custody_service_client::CustodyServiceClient; +use penumbra_sdk_proto::custody::v1::AuthorizeResponse; use std::{future::Future, pin::Pin}; use tonic::codegen::Bytes; diff --git a/crates/custody/src/encrypted.rs b/crates/custody/src/encrypted.rs index 827e510ab7..21c561c0e8 100644 --- a/crates/custody/src/encrypted.rs +++ b/crates/custody/src/encrypted.rs @@ -1,4 +1,4 @@ -use penumbra_proto::custody::v1::{self as pb, AuthorizeResponse}; +use penumbra_sdk_proto::custody::v1::{self as pb, AuthorizeResponse}; use rand_core::OsRng; use serde::{Deserialize, Serialize}; use serde_with::{formats::Uppercase, hex::Hex}; diff --git a/crates/custody/src/null_kms.rs b/crates/custody/src/null_kms.rs index 907b511418..ff1443b064 100644 --- a/crates/custody/src/null_kms.rs +++ b/crates/custody/src/null_kms.rs @@ -1,7 +1,7 @@ //! A basic software key management system that stores keys in memory but //! presents as an asynchronous signer. -use penumbra_proto::custody::v1::{self as pb}; +use penumbra_sdk_proto::custody::v1::{self as pb}; use tonic::{async_trait, Request, Response, Status}; /// A "null KMS" that has no keys and errors on any requests. diff --git a/crates/custody/src/policy.rs b/crates/custody/src/policy.rs index e2ce26d6ba..3d65b7dca7 100644 --- a/crates/custody/src/policy.rs +++ b/crates/custody/src/policy.rs @@ -2,8 +2,8 @@ use std::collections::HashSet; -use penumbra_keys::Address; -use penumbra_proto::{ +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::{ core::{ component::{ governance::v1::ValidatorVoteBody as ProtoValidatorVoteBody, @@ -13,7 +13,7 @@ use penumbra_proto::{ }, Message as _, }; -use penumbra_transaction::plan::ActionPlan; +use penumbra_sdk_transaction::plan::ActionPlan; use serde::{Deserialize, Serialize}; use crate::{ @@ -59,7 +59,7 @@ pub enum AuthPolicy { /// This policy should be combined with an `AllowList` to prevent sending /// funds outside of the relayer account. OnlyIbcRelay, - /// Require specific pre-authorizations for submitted [`TransactionPlan`](penumbra_transaction::TransactionPlan)s. + /// Require specific pre-authorizations for submitted [`TransactionPlan`](penumbra_sdk_transaction::TransactionPlan)s. PreAuthorization(PreAuthorizationPolicy), } @@ -132,7 +132,7 @@ impl PreAuthorizationPolicy { mod address_as_string { use std::str::FromStr; - use penumbra_keys::Address; + use penumbra_sdk_keys::Address; pub fn serialize( addresses: &[Address], diff --git a/crates/custody/src/pre_auth.rs b/crates/custody/src/pre_auth.rs index 8105d6cac9..ac8ed73d83 100644 --- a/crates/custody/src/pre_auth.rs +++ b/crates/custody/src/pre_auth.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{custody::v1 as pb, DomainType}; +use penumbra_sdk_proto::{custody::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; /// A pre-authorization packet. This allows a custodian to delegate (partial) diff --git a/crates/custody/src/request.rs b/crates/custody/src/request.rs index 1d5398a264..dcc6858561 100644 --- a/crates/custody/src/request.rs +++ b/crates/custody/src/request.rs @@ -1,7 +1,7 @@ -use penumbra_governance::ValidatorVoteBody; -use penumbra_proto::{custody::v1 as pb, DomainType}; -use penumbra_stake::validator::Validator; -use penumbra_transaction::TransactionPlan; +use penumbra_sdk_governance::ValidatorVoteBody; +use penumbra_sdk_proto::{custody::v1 as pb, DomainType}; +use penumbra_sdk_stake::validator::Validator; +use penumbra_sdk_transaction::TransactionPlan; use crate::PreAuthorization; diff --git a/crates/custody/src/soft_kms.rs b/crates/custody/src/soft_kms.rs index 4e49b654be..1bdae057a6 100644 --- a/crates/custody/src/soft_kms.rs +++ b/crates/custody/src/soft_kms.rs @@ -2,7 +2,7 @@ //! presents as an asynchronous signer. use decaf377_rdsa::{Signature, SpendAuth}; -use penumbra_proto::{ +use penumbra_sdk_proto::{ core::component::{ governance::v1::ValidatorVoteBody as ProtoValidatorVoteBody, stake::v1::Validator as ProtoValidator, @@ -10,7 +10,7 @@ use penumbra_proto::{ custody::v1::{self as pb, AuthorizeResponse}, Message as _, }; -use penumbra_transaction::AuthorizationData; +use penumbra_sdk_transaction::AuthorizationData; use rand_core::OsRng; use tonic::{async_trait, Request, Response, Status}; @@ -35,7 +35,7 @@ impl SoftKms { Self { config } } - /// Attempt to authorize the requested [`TransactionPlan`](penumbra_transaction::TransactionPlan). + /// Attempt to authorize the requested [`TransactionPlan`](penumbra_sdk_transaction::TransactionPlan). #[tracing::instrument(skip(self, request), name = "softhsm_sign")] pub fn sign(&self, request: &AuthorizeRequest) -> anyhow::Result { tracing::debug!(?request.plan); diff --git a/crates/custody/src/soft_kms/config.rs b/crates/custody/src/soft_kms/config.rs index 512169430e..42cf6e2e7c 100644 --- a/crates/custody/src/soft_kms/config.rs +++ b/crates/custody/src/soft_kms/config.rs @@ -1,5 +1,5 @@ use crate::policy::AuthPolicy; -use penumbra_keys::keys::SpendKey; +use penumbra_sdk_keys::keys::SpendKey; use serde::{Deserialize, Serialize}; use serde_with::DisplayFromStr; @@ -38,7 +38,7 @@ fn is_default(value: &T) -> bool { #[cfg(test)] mod tests { - use penumbra_keys::keys::{Bip44Path, SeedPhrase}; + use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase}; use crate::policy::PreAuthorizationPolicy; diff --git a/crates/custody/src/terminal.rs b/crates/custody/src/terminal.rs index 7f9e00f0f8..ac241f82cd 100644 --- a/crates/custody/src/terminal.rs +++ b/crates/custody/src/terminal.rs @@ -1,8 +1,8 @@ use anyhow::Result; -use penumbra_governance::ValidatorVoteBody; -use penumbra_proto::DomainType; -use penumbra_stake::validator::Validator; -use penumbra_transaction::TransactionPlan; +use penumbra_sdk_governance::ValidatorVoteBody; +use penumbra_sdk_proto::DomainType; +use penumbra_sdk_stake::validator::Validator; +use penumbra_sdk_transaction::TransactionPlan; use serde::de::DeserializeOwned; use tonic::async_trait; diff --git a/crates/custody/src/threshold.rs b/crates/custody/src/threshold.rs index dd5521674f..c2b0bc8453 100644 --- a/crates/custody/src/threshold.rs +++ b/crates/custody/src/threshold.rs @@ -1,11 +1,11 @@ use anyhow::{anyhow, Result}; -use penumbra_transaction::AuthorizationData; +use penumbra_sdk_transaction::AuthorizationData; use rand_core::OsRng; use serde::Serialize; use tonic::{async_trait, Request, Response, Status}; -use penumbra_keys::{keys::AddressIndex, Address, FullViewingKey}; -use penumbra_proto::{custody::v1 as pb, DomainType}; +use penumbra_sdk_keys::{keys::AddressIndex, Address, FullViewingKey}; +use penumbra_sdk_proto::{custody::v1 as pb, DomainType}; use crate::{AuthorizeRequest, AuthorizeValidatorDefinitionRequest, AuthorizeValidatorVoteRequest}; @@ -362,7 +362,7 @@ impl pb::custody_service_server::CustodySer mod test { use std::collections::HashMap; - use penumbra_transaction::TransactionPlan; + use penumbra_sdk_transaction::TransactionPlan; use tokio::sync; diff --git a/crates/custody/src/threshold/config.rs b/crates/custody/src/threshold/config.rs index fbfd1d1d3b..9ac396b4ad 100644 --- a/crates/custody/src/threshold/config.rs +++ b/crates/custody/src/threshold/config.rs @@ -2,7 +2,7 @@ use anyhow::Result; use decaf377::Fq; use decaf377_frost as frost; use ed25519_consensus::{SigningKey, VerificationKey}; -use penumbra_keys::{keys::NullifierKey, FullViewingKey}; +use penumbra_sdk_keys::{keys::NullifierKey, FullViewingKey}; use rand_core::CryptoRngCore; use serde::{Deserialize, Serialize}; use serde_with::{formats::Uppercase, hex::Hex, DisplayFromStr, TryFromInto}; diff --git a/crates/custody/src/threshold/dkg.rs b/crates/custody/src/threshold/dkg.rs index 438afa5551..2b659942f6 100644 --- a/crates/custody/src/threshold/dkg.rs +++ b/crates/custody/src/threshold/dkg.rs @@ -7,7 +7,7 @@ use std::collections::{HashMap, HashSet}; mod encryption; use ed25519_consensus::{Signature, SigningKey, VerificationKey}; use encryption::EncryptionKey; -use penumbra_proto::{custody::threshold::v1 as pb, DomainType, Message}; +use penumbra_sdk_proto::{custody::threshold::v1 as pb, DomainType, Message}; use rand_core::CryptoRngCore; use self::encryption::DecryptionKey; diff --git a/crates/custody/src/threshold/sign.rs b/crates/custody/src/threshold/sign.rs index 1ba7f80d83..fe0ac495c5 100644 --- a/crates/custody/src/threshold/sign.rs +++ b/crates/custody/src/threshold/sign.rs @@ -5,18 +5,18 @@ use std::{ use anyhow::{anyhow, Result}; use ed25519_consensus::{Signature, SigningKey, VerificationKey}; -use penumbra_keys::FullViewingKey; +use penumbra_sdk_keys::FullViewingKey; use rand_core::CryptoRngCore; use decaf377_frost as frost; use frost::round1::SigningCommitments; -use penumbra_proto::core::component::{ +use penumbra_sdk_proto::core::component::{ governance::v1::ValidatorVoteBody as ProtoValidatorVoteBody, stake::v1::Validator as ProtoValidator, }; -use penumbra_proto::{penumbra::custody::threshold::v1 as pb, DomainType, Message}; -use penumbra_transaction::AuthorizationData; -use penumbra_txhash::EffectHash; +use penumbra_sdk_proto::{penumbra::custody::threshold::v1 as pb, DomainType, Message}; +use penumbra_sdk_transaction::AuthorizationData; +use penumbra_sdk_txhash::EffectHash; use crate::terminal::SigningRequest; diff --git a/crates/misc/measure/src/main.rs b/crates/misc/measure/src/main.rs index 38211fe3d2..462f7856e6 100644 --- a/crates/misc/measure/src/main.rs +++ b/crates/misc/measure/src/main.rs @@ -7,8 +7,8 @@ use clap::Parser; use tracing::Instrument; use tracing_subscriber::EnvFilter; -use penumbra_compact_block::CompactBlock; -use penumbra_proto::{ +use penumbra_sdk_compact_block::CompactBlock; +use penumbra_sdk_proto::{ core::component::compact_block::v1::CompactBlockRequest, penumbra::{ core::component::compact_block::v1::{ @@ -39,7 +39,7 @@ pub struct Opt { #[clap( short, long, - env = "PENUMBRA_NODE_PD_URL", + env = "penumbra_sdk_NODE_PD_URL", parse(try_from_str = url::Url::parse) )] node: Url, @@ -249,7 +249,7 @@ impl Opt { let mut sp_note_count = 0; let mut sp_swap_count = 0; - use penumbra_compact_block::StatePayload; + use penumbra_sdk_compact_block::StatePayload; while let Some(block_rsp) = stream.message().await? { cb_count += 1; diff --git a/crates/misc/tct-visualize/src/bin/tct-live-edit.rs b/crates/misc/tct-visualize/src/bin/tct-live-edit.rs index d3e20a0abd..01fbf3bfa5 100644 --- a/crates/misc/tct-visualize/src/bin/tct-live-edit.rs +++ b/crates/misc/tct-visualize/src/bin/tct-live-edit.rs @@ -8,7 +8,7 @@ use include_flate::flate; use tokio::sync::watch; use tower_http::trace::TraceLayer; -use penumbra_tct::Tree; +use penumbra_sdk_tct::Tree; use penumbra_sdk_tct_visualize::live::{self, ViewExtensions}; /// Visualize the structure of the Tiered Commitment Tree. diff --git a/crates/misc/tct-visualize/src/bin/tct-visualize.rs b/crates/misc/tct-visualize/src/bin/tct-visualize.rs index 89bf86a3d0..85f2f0c9ec 100644 --- a/crates/misc/tct-visualize/src/bin/tct-visualize.rs +++ b/crates/misc/tct-visualize/src/bin/tct-visualize.rs @@ -17,7 +17,7 @@ use penumbra_sdk_tct_visualize::render; use rand::{seq::SliceRandom, Rng, RngCore, SeedableRng}; use rand_distr::Binomial; -use penumbra_tct::{self as tct, StateCommitment, Tree, Witness}; +use penumbra_sdk_tct::{self as tct, StateCommitment, Tree, Witness}; use tct::structure::Hash; /// Visualize the structure of the Tiered Commitment Tree. diff --git a/crates/misc/tct-visualize/src/live.rs b/crates/misc/tct-visualize/src/live.rs index 9ef72cbdbf..279c579691 100644 --- a/crates/misc/tct-visualize/src/live.rs +++ b/crates/misc/tct-visualize/src/live.rs @@ -15,7 +15,7 @@ pub use query::query; mod control; pub use control::control; -use penumbra_tct::Tree; +use penumbra_sdk_tct::Tree; /// Combine the [`control`], [`query`], and [`view`] endpoints into a single [`Router`]. /// diff --git a/crates/misc/tct-visualize/src/live/control.rs b/crates/misc/tct-visualize/src/live/control.rs index f7df472c49..d7f568cb2e 100644 --- a/crates/misc/tct-visualize/src/live/control.rs +++ b/crates/misc/tct-visualize/src/live/control.rs @@ -12,7 +12,7 @@ use rand::{seq::SliceRandom, Rng}; use serde_json::json; use tokio::{sync::watch, task::spawn_blocking}; -use penumbra_tct::{ +use penumbra_sdk_tct::{ builder::{block, epoch}, StateCommitment, Tree, Witness, }; diff --git a/crates/misc/tct-visualize/src/live/query.rs b/crates/misc/tct-visualize/src/live/query.rs index 06f14abb59..2241743096 100644 --- a/crates/misc/tct-visualize/src/live/query.rs +++ b/crates/misc/tct-visualize/src/live/query.rs @@ -10,7 +10,7 @@ use axum::{ use serde_json::json; use tokio::sync::watch; -use penumbra_tct::{ +use penumbra_sdk_tct::{ structure::{self, Hash}, StateCommitment, Tree, }; diff --git a/crates/misc/tct-visualize/src/live/view.rs b/crates/misc/tct-visualize/src/live/view.rs index 40606a0b7f..f3d8090a94 100644 --- a/crates/misc/tct-visualize/src/live/view.rs +++ b/crates/misc/tct-visualize/src/live/view.rs @@ -19,7 +19,7 @@ use serde_json::json; use tokio::sync::{mpsc, watch}; use tokio_stream::{wrappers::ReceiverStream, StreamExt}; -use penumbra_tct::{Forgotten, Position, Tree}; +use penumbra_sdk_tct::{Forgotten, Position, Tree}; mod resources; use resources::*; diff --git a/crates/misc/tct-visualize/src/render.rs b/crates/misc/tct-visualize/src/render.rs index 6da8336875..3a52afd7b0 100644 --- a/crates/misc/tct-visualize/src/render.rs +++ b/crates/misc/tct-visualize/src/render.rs @@ -1,6 +1,6 @@ use std::io::{self, Write}; -use penumbra_tct::{ +use penumbra_sdk_tct::{ structure::{Kind, Node, Place}, Position, Tree, }; diff --git a/crates/proto/src/gen/penumbra.core.asset.v1.rs b/crates/proto/src/gen/penumbra.core.asset.v1.rs index 737329422a..05dd5040ea 100644 --- a/crates/proto/src/gen/penumbra.core.asset.v1.rs +++ b/crates/proto/src/gen/penumbra.core.asset.v1.rs @@ -87,7 +87,7 @@ pub struct Metadata { pub symbol: ::prost::alloc::string::String, /// the asset ID on Penumbra for this denomination. #[prost(message, optional, tag = "1984")] - pub penumbra_asset_id: ::core::option::Option, + pub penumbra_sdk_asset_id: ::core::option::Option, #[prost(message, repeated, tag = "1985")] pub images: ::prost::alloc::vec::Vec, /// An optional "score" used to prioritize token lists. diff --git a/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs b/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs index e0233c0b07..d1c18db5e8 100644 --- a/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs +++ b/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs @@ -1241,7 +1241,7 @@ impl serde::Serialize for Metadata { if !self.symbol.is_empty() { len += 1; } - if self.penumbra_asset_id.is_some() { + if self.penumbra_sdk_asset_id.is_some() { len += 1; } if !self.images.is_empty() { @@ -1272,7 +1272,7 @@ impl serde::Serialize for Metadata { if !self.symbol.is_empty() { struct_ser.serialize_field("symbol", &self.symbol)?; } - if let Some(v) = self.penumbra_asset_id.as_ref() { + if let Some(v) = self.penumbra_sdk_asset_id.as_ref() { struct_ser.serialize_field("penumbraAssetId", v)?; } if !self.images.is_empty() { @@ -1303,7 +1303,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { "display", "name", "symbol", - "penumbra_asset_id", + "penumbra_sdk_asset_id", "penumbraAssetId", "images", "priority_score", @@ -1351,7 +1351,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { "display" => Ok(GeneratedField::Display), "name" => Ok(GeneratedField::Name), "symbol" => Ok(GeneratedField::Symbol), - "penumbraAssetId" | "penumbra_asset_id" => Ok(GeneratedField::PenumbraAssetId), + "penumbraAssetId" | "penumbra_sdk_asset_id" => Ok(GeneratedField::PenumbraAssetId), "images" => Ok(GeneratedField::Images), "priorityScore" | "priority_score" => Ok(GeneratedField::PriorityScore), "badges" => Ok(GeneratedField::Badges), @@ -1380,7 +1380,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { let mut display__ = None; let mut name__ = None; let mut symbol__ = None; - let mut penumbra_asset_id__ = None; + let mut penumbra_sdk_asset_id__ = None; let mut images__ = None; let mut priority_score__ = None; let mut badges__ = None; @@ -1423,10 +1423,10 @@ impl<'de> serde::Deserialize<'de> for Metadata { symbol__ = Some(map_.next_value()?); } GeneratedField::PenumbraAssetId => { - if penumbra_asset_id__.is_some() { + if penumbra_sdk_asset_id__.is_some() { return Err(serde::de::Error::duplicate_field("penumbraAssetId")); } - penumbra_asset_id__ = map_.next_value()?; + penumbra_sdk_asset_id__ = map_.next_value()?; } GeneratedField::Images => { if images__.is_some() { @@ -1460,7 +1460,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { display: display__.unwrap_or_default(), name: name__.unwrap_or_default(), symbol: symbol__.unwrap_or_default(), - penumbra_asset_id: penumbra_asset_id__, + penumbra_sdk_asset_id: penumbra_sdk_asset_id__, images: images__.unwrap_or_default(), priority_score: priority_score__.unwrap_or_default(), badges: badges__.unwrap_or_default(), diff --git a/crates/proto/src/lib.rs b/crates/proto/src/lib.rs index d48882a2c2..e43c91a31c 100644 --- a/crates/proto/src/lib.rs +++ b/crates/proto/src/lib.rs @@ -7,7 +7,7 @@ //! //! ```ascii //! ┌───────┐ ┌──────────────┐ ┌──────────────┐ -//! │encoded│ protobuf │penumbra_proto│ TryFrom/Into │ domain types │ +//! │encoded│ protobuf │penumbra_sdk_proto│ TryFrom/Into │ domain types │ //! │ bytes │<──wire ─>│ types │<─validation ─>│(other crates)│ //! └───────┘ format └──────────────┘ boundary └──────────────┘ //! ``` diff --git a/crates/proto/src/protobuf/tendermint_compat.rs b/crates/proto/src/protobuf/tendermint_compat.rs index 47111a3fff..5fbe0eab73 100644 --- a/crates/proto/src/protobuf/tendermint_compat.rs +++ b/crates/proto/src/protobuf/tendermint_compat.rs @@ -4,12 +4,12 @@ // this is not an exhaustive pass at providing compatibility between all of the types in either // library. accordingly, it is grouped by conversions needed for each RPC endpoint. -use crate::util::tendermint_proxy::v1 as penumbra_pb; +use crate::util::tendermint_proxy::v1 as penumbra_sdk_pb; use anyhow::anyhow; // === get_tx === -impl From for penumbra_pb::GetTxResponse { +impl From for penumbra_sdk_pb::GetTxResponse { fn from( tendermint_rpc::endpoint::tx::Response { hash, @@ -30,7 +30,7 @@ impl From for penumbra_pb::GetTxResponse } } -impl From for penumbra_pb::TxResult { +impl From for penumbra_sdk_pb::TxResult { fn from( tendermint::abci::types::ExecTxResult { log, @@ -52,14 +52,14 @@ impl From for penumbra_pb::TxResult { tags: events .into_iter() .flat_map(|Event { attributes, .. }: Event| { - attributes.into_iter().map(penumbra_pb::Tag::from) + attributes.into_iter().map(penumbra_sdk_pb::Tag::from) }) .collect(), } } } -impl From for penumbra_pb::Tag { +impl From for penumbra_sdk_pb::Tag { fn from(event_attr: tendermint::abci::EventAttribute) -> Self { Self { key: event_attr.key_bytes().into(), @@ -72,7 +72,7 @@ impl From for penumbra_pb::Tag { } } -// impl From for penumbra_pb::Tag { +// impl From for penumbra_sdk_pb::Tag { // fn from( // tendermint::abci::event::v0_37::EventAttribute { // key, @@ -94,7 +94,7 @@ impl From for penumbra_pb::Tag { // === broadcast_tx_async === impl From - for penumbra_pb::BroadcastTxAsyncResponse + for penumbra_sdk_pb::BroadcastTxAsyncResponse { fn from( tendermint_rpc::endpoint::broadcast::tx_async::Response { @@ -117,7 +117,7 @@ impl From // === broadcast_tx_sync === impl From - for penumbra_pb::BroadcastTxSyncResponse + for penumbra_sdk_pb::BroadcastTxSyncResponse { fn from( tendermint_rpc::endpoint::broadcast::tx_sync::Response { @@ -139,7 +139,7 @@ impl From // === get_status === -impl From for penumbra_pb::GetStatusResponse { +impl From for penumbra_sdk_pb::GetStatusResponse { fn from( tendermint_rpc::endpoint::status::Response { node_info, @@ -187,7 +187,7 @@ impl From for crate::tendermint::p2p::DefaultNodeInfo { } } -impl From for penumbra_pb::SyncInfo { +impl From for penumbra_sdk_pb::SyncInfo { fn from( tendermint_rpc::endpoint::status::SyncInfo { latest_block_hash, @@ -273,7 +273,7 @@ pub struct HeightOverflowError { source: >::Error, } -impl TryFrom for penumbra_pb::AbciQueryResponse { +impl TryFrom for penumbra_sdk_pb::AbciQueryResponse { type Error = HeightOverflowError; fn try_from( tendermint_rpc::endpoint::abci_query::AbciQuery { @@ -338,7 +338,7 @@ impl From for crate::tendermint::crypto::Pro // === get_block_by_height === -impl TryFrom for penumbra_pb::GetBlockByHeightResponse { +impl TryFrom for penumbra_sdk_pb::GetBlockByHeightResponse { type Error = anyhow::Error; fn try_from( tendermint_rpc::endpoint::block::Response { diff --git a/crates/test/mock-client/src/lib.rs b/crates/test/mock-client/src/lib.rs index d8920c0a0a..2903697835 100644 --- a/crates/test/mock-client/src/lib.rs +++ b/crates/test/mock-client/src/lib.rs @@ -1,15 +1,15 @@ use anyhow::Error; use cnidarium::StateRead; -use penumbra_compact_block::{component::StateReadExt as _, CompactBlock, StatePayload}; -use penumbra_dex::{swap::SwapPlaintext, swap_claim::SwapClaimPlan}; -use penumbra_keys::{keys::SpendKey, FullViewingKey}; -use penumbra_sct::{ +use penumbra_sdk_compact_block::{component::StateReadExt as _, CompactBlock, StatePayload}; +use penumbra_sdk_dex::{swap::SwapPlaintext, swap_claim::SwapClaimPlan}; +use penumbra_sdk_keys::{keys::SpendKey, FullViewingKey}; +use penumbra_sdk_sct::{ component::{clock::EpochRead, tree::SctRead}, Nullifier, }; -use penumbra_shielded_pool::{note, Note, SpendPlan}; -use penumbra_tct as tct; -use penumbra_transaction::{AuthorizationData, Transaction, TransactionPlan, WitnessData}; +use penumbra_sdk_shielded_pool::{note, Note, SpendPlan}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_transaction::{AuthorizationData, Transaction, TransactionPlan, WitnessData}; use rand_core::OsRng; use std::collections::BTreeMap; @@ -24,7 +24,7 @@ pub struct MockClient { /// Whether a note was spent or not. pub spent_notes: BTreeMap, swaps: BTreeMap, - pub sct: penumbra_tct::Tree, + pub sct: penumbra_sdk_tct::Tree, } impl MockClient { @@ -97,7 +97,7 @@ impl MockClient { } pub fn scan_block(&mut self, block: CompactBlock) -> anyhow::Result<()> { - use penumbra_tct::Witness::*; + use penumbra_sdk_tct::Witness::*; if self.latest_height.wrapping_add(1) != block.height { anyhow::bail!( @@ -198,7 +198,7 @@ impl MockClient { Ok(()) } - pub fn latest_height_and_sct_root(&self) -> (u64, penumbra_tct::Root) { + pub fn latest_height_and_sct_root(&self) -> (u64, penumbra_sdk_tct::Root) { (self.latest_height, self.sct.root()) } @@ -210,7 +210,7 @@ impl MockClient { self.swaps.get(commitment).cloned() } - pub fn position(&self, commitment: note::StateCommitment) -> Option { + pub fn position(&self, commitment: note::StateCommitment) -> Option { self.sct.witness(commitment).map(|proof| proof.position()) } @@ -228,7 +228,7 @@ impl MockClient { pub fn witness_commitment( &self, commitment: note::StateCommitment, - ) -> Option { + ) -> Option { self.sct.witness(commitment) } @@ -270,7 +270,7 @@ impl MockClient { pub fn notes_by_asset( &self, - asset_id: penumbra_asset::asset::Id, + asset_id: penumbra_sdk_asset::asset::Id, ) -> impl Iterator + '_ { self.notes .values() @@ -283,7 +283,7 @@ impl MockClient { pub fn spendable_notes_by_asset( &self, - asset_id: penumbra_asset::asset::Id, + asset_id: penumbra_sdk_asset::asset::Id, ) -> impl Iterator + '_ { self.notes .values() diff --git a/crates/test/mock-tendermint-proxy/src/proxy.rs b/crates/test/mock-tendermint-proxy/src/proxy.rs index 0a4d9a8a66..0b4a3ceb56 100644 --- a/crates/test/mock-tendermint-proxy/src/proxy.rs +++ b/crates/test/mock-tendermint-proxy/src/proxy.rs @@ -1,5 +1,5 @@ use { - penumbra_proto::{ + penumbra_sdk_proto::{ tendermint::p2p::DefaultNodeInfo, util::tendermint_proxy::v1::{ tendermint_proxy_service_server::TendermintProxyService, AbciQueryRequest, @@ -25,7 +25,7 @@ use { /// A tendermint proxy service for use in tests. /// /// This type implements [`TendermintProxyService`], but can be configured to report the blocks -/// generated by a [`penumbra_mock_consensus::TestNode`]. +/// generated by a [`penumbra_sdk_mock_consensus::TestNode`]. #[derive(Default)] pub struct TestNodeProxy { inner: Arc, @@ -44,7 +44,7 @@ impl TestNodeProxy { } /// Returns a boxed function that will add [`Blocks`] to this proxy. - pub fn on_block_callback(&self) -> penumbra_mock_consensus::OnBlockFn { + pub fn on_block_callback(&self) -> penumbra_sdk_mock_consensus::OnBlockFn { // Create a new reference to the shared map of blocks we've seen. let Self { inner } = self; let inner = Arc::clone(inner); @@ -218,7 +218,7 @@ impl TendermintProxyService for TestNodeProxy { // the response uses the penumbra type but internally we use the tendermint type let proto_block = block .clone() - .map(penumbra_proto::tendermint::types::Block::try_from) + .map(penumbra_sdk_proto::tendermint::types::Block::try_from) .transpose() .or_else(|e| { tracing::warn!(?height, error = ?e, "proxy: error fetching blocks"); @@ -226,9 +226,9 @@ impl TendermintProxyService for TestNodeProxy { })?; Ok(GetBlockByHeightResponse { - block_id: block.map(|b| penumbra_proto::tendermint::types::BlockId { + block_id: block.map(|b| penumbra_sdk_proto::tendermint::types::BlockId { hash: b.header.hash().into(), - part_set_header: Some(penumbra_proto::tendermint::types::PartSetHeader { + part_set_header: Some(penumbra_sdk_proto::tendermint::types::PartSetHeader { total: 0, hash: vec![], }), diff --git a/crates/test/mock-tendermint-proxy/src/stub.rs b/crates/test/mock-tendermint-proxy/src/stub.rs index 188d42a4b5..6e3ea88481 100644 --- a/crates/test/mock-tendermint-proxy/src/stub.rs +++ b/crates/test/mock-tendermint-proxy/src/stub.rs @@ -1,5 +1,5 @@ use { - penumbra_proto::util::tendermint_proxy::v1::{ + penumbra_sdk_proto::util::tendermint_proxy::v1::{ tendermint_proxy_service_server::TendermintProxyService, AbciQueryRequest, AbciQueryResponse, BroadcastTxAsyncRequest, BroadcastTxAsyncResponse, BroadcastTxSyncRequest, BroadcastTxSyncResponse, GetBlockByHeightRequest, diff --git a/crates/test/tct-property-test/src/lib.rs b/crates/test/tct-property-test/src/lib.rs index 50aee18cfa..88caa56541 100644 --- a/crates/test/tct-property-test/src/lib.rs +++ b/crates/test/tct-property-test/src/lib.rs @@ -1,4 +1,4 @@ -//! This is an empty crate that exists solely to contain property tests for the `penumbra_tct` +//! This is an empty crate that exists solely to contain property tests for the `penumbra_sdk_tct` //! package, so we can isolate expensive tests and run them with different optimizations. // Requires nightly. #![cfg_attr(docsrs, feature(doc_auto_cfg))] diff --git a/crates/test/tct-property-test/tests/serialize.rs b/crates/test/tct-property-test/tests/serialize.rs index 26cda7ea5d..f06def5198 100644 --- a/crates/test/tct-property-test/tests/serialize.rs +++ b/crates/test/tct-property-test/tests/serialize.rs @@ -5,7 +5,7 @@ use std::fmt::{Debug, Display}; use proptest::{arbitrary::*, prelude::*}; -use penumbra_tct::{storage::InMemory, validate, StateCommitment, Tree, Witness}; +use penumbra_sdk_tct::{storage::InMemory, validate, StateCommitment, Tree, Witness}; const MAX_USED_COMMITMENTS: usize = 3; const MAX_TIER_ACTIONS: usize = 10; diff --git a/crates/test/tct-property-test/tests/simulate/mod.rs b/crates/test/tct-property-test/tests/simulate/mod.rs index a3c966368c..38a437aba8 100644 --- a/crates/test/tct-property-test/tests/simulate/mod.rs +++ b/crates/test/tct-property-test/tests/simulate/mod.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use proptest_derive::Arbitrary; -use penumbra_tct::{self as real, spec, Commitment, Witness}; +use penumbra_sdk_tct::{self as real, spec, Commitment, Witness}; /// Simulate an action being run on both a specification and a real implementation simultaneously. pub trait Simulate { diff --git a/crates/test/tct-property-test/tests/spec.rs b/crates/test/tct-property-test/tests/spec.rs index a850650256..6eddbca4a9 100644 --- a/crates/test/tct-property-test/tests/spec.rs +++ b/crates/test/tct-property-test/tests/spec.rs @@ -1,6 +1,6 @@ // use proptest::{arbitrary::*, prelude::*}; -// use penumbra_tct::Commitment; +// use penumbra_sdk_tct::Commitment; // mod simulate; // use simulate::{Params, Simulate}; diff --git a/crates/test/tct-property-test/tests/witness.rs b/crates/test/tct-property-test/tests/witness.rs index 139dd1be82..bae9731ea9 100644 --- a/crates/test/tct-property-test/tests/witness.rs +++ b/crates/test/tct-property-test/tests/witness.rs @@ -5,7 +5,7 @@ use std::collections::HashSet; use proptest::{arbitrary::*, prelude::*}; -use penumbra_tct::{validate, StateCommitment, Tree, Witness}; +use penumbra_sdk_tct::{validate, StateCommitment, Tree, Witness}; const MAX_USED_COMMITMENTS: usize = 3; const MAX_TIER_ACTIONS: usize = 10; diff --git a/crates/test/tracing-subscriber/src/lib.rs b/crates/test/tracing-subscriber/src/lib.rs index 8b067e0ba3..c7693f7492 100644 --- a/crates/test/tracing-subscriber/src/lib.rs +++ b/crates/test/tracing-subscriber/src/lib.rs @@ -12,7 +12,7 @@ use { // NB: this is marked as "dead code" but it is used by integration tests. #[allow(dead_code)] pub fn set_tracing_subscriber() -> DefaultGuard { - let filter = "info,penumbra_app=trace,penumbra_mock_consensus=trace"; + let filter = "info,penumbra_sdk_app=trace,penumbra_sdk_mock_consensus=trace"; let filter = EnvFilter::try_from_default_env() .or_else(|_| EnvFilter::try_new(filter)) .expect("should have a valid filter directive"); diff --git a/crates/util/tendermint-proxy/src/tendermint_proxy.rs b/crates/util/tendermint-proxy/src/tendermint_proxy.rs index 7c902f9314..bf5120528c 100644 --- a/crates/util/tendermint-proxy/src/tendermint_proxy.rs +++ b/crates/util/tendermint-proxy/src/tendermint_proxy.rs @@ -1,5 +1,5 @@ use crate::TendermintProxy; -use penumbra_proto::{ +use penumbra_sdk_proto::{ util::tendermint_proxy::v1::{ tendermint_proxy_service_server::TendermintProxyService, AbciQueryRequest, AbciQueryResponse, BroadcastTxAsyncRequest, BroadcastTxAsyncResponse, @@ -8,7 +8,7 @@ use penumbra_proto::{ }, DomainType, }; -use penumbra_transaction::Transaction; +use penumbra_sdk_transaction::Transaction; use tap::TapFallible; use tendermint::{abci::Code, block::Height}; use tendermint_rpc::{Client, HttpClient}; diff --git a/crates/view/src/client.rs b/crates/view/src/client.rs index be7edbccd8..bb1854e4aa 100644 --- a/crates/view/src/client.rs +++ b/crates/view/src/client.rs @@ -3,30 +3,30 @@ use std::{collections::BTreeMap, future::Future, pin::Pin}; use anyhow::Result; use futures::{FutureExt, Stream, StreamExt, TryStreamExt}; use pbjson_types::Any; -use penumbra_auction::auction::AuctionId; +use penumbra_sdk_auction::auction::AuctionId; use tonic::{codegen::Bytes, Streaming}; use tracing::instrument; -use penumbra_app::params::AppParameters; -use penumbra_asset::{ +use penumbra_sdk_app::params::AppParameters; +use penumbra_sdk_asset::{ asset::{self, Id, Metadata}, ValueView, }; -use penumbra_dex::{ +use penumbra_sdk_dex::{ lp::position::{self, Position}, TradingPair, }; -use penumbra_fee::GasPrices; -use penumbra_keys::{keys::AddressIndex, Address}; -use penumbra_num::Amount; -use penumbra_proto::view::v1::{ +use penumbra_sdk_fee::GasPrices; +use penumbra_sdk_keys::{keys::AddressIndex, Address}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::view::v1::{ self as pb, view_service_client::ViewServiceClient, BalancesResponse, BroadcastTransactionResponse, WitnessRequest, }; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{fmd, note}; -use penumbra_stake::IdentityKey; -use penumbra_transaction::{ +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{fmd, note}; +use penumbra_sdk_stake::IdentityKey; +use penumbra_sdk_transaction::{ txhash::TransactionId, AuthorizationData, Transaction, TransactionPlan, WitnessData, }; @@ -135,7 +135,7 @@ pub trait ViewClient { /// Queries for a specific swap by commitment, returning immediately if it is not found. fn swap_by_commitment( &mut self, - swap_commitment: penumbra_tct::StateCommitment, + swap_commitment: penumbra_sdk_tct::StateCommitment, ) -> Pin> + Send + 'static>>; /// Queries for a specific nullifier's status, returning immediately if it is not found. @@ -559,7 +559,7 @@ where fn swap_by_commitment( &mut self, - swap_commitment: penumbra_tct::StateCommitment, + swap_commitment: penumbra_sdk_tct::StateCommitment, ) -> Pin> + Send + 'static>> { let mut self2 = self.clone(); async move { diff --git a/crates/view/src/lib.rs b/crates/view/src/lib.rs index 69b0014ad4..b6a4263cf1 100644 --- a/crates/view/src/lib.rs +++ b/crates/view/src/lib.rs @@ -5,7 +5,7 @@ //! documentation of [`ViewClient`] and a [`ViewServer`] for more information. //! //! This crate also provides a [`Planner`]. This is a planner for -//! [`TransactionPlan`][penumbra_transaction::TransactionPlan]. +//! [`TransactionPlan`][penumbra_sdk_transaction::TransactionPlan]. //! //! Finally, this crate provides a [`Storage`] type for managing persistent sqlite storage. diff --git a/crates/view/src/metrics.rs b/crates/view/src/metrics.rs index 668c4d13b5..aff73c3131 100644 --- a/crates/view/src/metrics.rs +++ b/crates/view/src/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; diff --git a/crates/view/src/note_record.rs b/crates/view/src/note_record.rs index 0d09ad7765..23612127e5 100644 --- a/crates/view/src/note_record.rs +++ b/crates/view/src/note_record.rs @@ -1,9 +1,9 @@ -use penumbra_asset::Value; -use penumbra_keys::{keys::AddressIndex, Address, AddressView}; -use penumbra_proto::{view::v1 as pb, DomainType}; -use penumbra_sct::{CommitmentSource, Nullifier}; -use penumbra_shielded_pool::{note, Note, Rseed}; -use penumbra_tct::Position; +use penumbra_sdk_asset::Value; +use penumbra_sdk_keys::{keys::AddressIndex, Address, AddressView}; +use penumbra_sdk_proto::{view::v1 as pb, DomainType}; +use penumbra_sdk_sct::{CommitmentSource, Nullifier}; +use penumbra_sdk_shielded_pool::{note, Note, Rseed}; +use penumbra_sdk_tct::Position; use r2d2_sqlite::rusqlite::Row; use serde::{Deserialize, Serialize}; diff --git a/crates/view/src/planner.rs b/crates/view/src/planner.rs index 156e885b4b..a0c3f95dd6 100644 --- a/crates/view/src/planner.rs +++ b/crates/view/src/planner.rs @@ -5,22 +5,22 @@ use std::{ }; use anyhow::{Context, Result}; -use penumbra_sct::epoch::Epoch; +use penumbra_sdk_sct::epoch::Epoch; use rand::{CryptoRng, RngCore}; use rand_core::OsRng; use tracing::instrument; use crate::{SpendableNoteRecord, ViewClient}; use anyhow::anyhow; -use penumbra_asset::{asset, Value}; -use penumbra_auction::auction::dutch::DutchAuctionDescription; -use penumbra_auction::auction::dutch::{actions::ActionDutchAuctionWithdrawPlan, DutchAuction}; -use penumbra_auction::auction::{ +use penumbra_sdk_asset::{asset, Value}; +use penumbra_sdk_auction::auction::dutch::DutchAuctionDescription; +use penumbra_sdk_auction::auction::dutch::{actions::ActionDutchAuctionWithdrawPlan, DutchAuction}; +use penumbra_sdk_auction::auction::{ dutch::actions::{ActionDutchAuctionEnd, ActionDutchAuctionSchedule}, AuctionId, }; -use penumbra_community_pool::CommunityPoolDeposit; -use penumbra_dex::{ +use penumbra_sdk_community_pool::CommunityPoolDeposit; +use penumbra_sdk_dex::{ lp::action::{PositionClose, PositionOpen}, lp::plan::PositionWithdrawPlan, lp::position::{self, Position}, @@ -30,19 +30,19 @@ use penumbra_dex::{ swap_claim::SwapClaimPlan, TradingPair, }; -use penumbra_fee::{Fee, FeeTier, GasPrices}; -use penumbra_governance::{ +use penumbra_sdk_fee::{Fee, FeeTier, GasPrices}; +use penumbra_sdk_governance::{ proposal_state, DelegatorVotePlan, Proposal, ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, Vote, }; -use penumbra_ibc::IbcRelay; -use penumbra_keys::{keys::AddressIndex, Address}; -use penumbra_num::Amount; -use penumbra_proto::view::v1::{NotesForVotingRequest, NotesRequest}; -use penumbra_shielded_pool::{Ics20Withdrawal, Note, OutputPlan, SpendPlan}; -use penumbra_stake::{rate::RateData, validator, IdentityKey, UndelegateClaimPlan}; -use penumbra_tct as tct; -use penumbra_transaction::{ +use penumbra_sdk_ibc::IbcRelay; +use penumbra_sdk_keys::{keys::AddressIndex, Address}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::view::v1::{NotesForVotingRequest, NotesRequest}; +use penumbra_sdk_shielded_pool::{Ics20Withdrawal, Note, OutputPlan, SpendPlan}; +use penumbra_sdk_stake::{rate::RateData, validator, IdentityKey, UndelegateClaimPlan}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::{ActionPlan, MemoPlan, TransactionPlan}, ActionList, TransactionParameters, diff --git a/crates/view/src/service.rs b/crates/view/src/service.rs index 8e3c8ce26c..c9319e21a8 100644 --- a/crates/view/src/service.rs +++ b/crates/view/src/service.rs @@ -9,7 +9,7 @@ use async_stream::try_stream; use camino::Utf8Path; use decaf377::Fq; use futures::stream::{self, StreamExt, TryStreamExt}; -use penumbra_auction::auction::dutch::actions::view::{ +use penumbra_sdk_auction::auction::dutch::actions::view::{ ActionDutchAuctionScheduleView, ActionDutchAuctionWithdrawView, }; use rand::Rng; @@ -21,8 +21,8 @@ use tonic::{async_trait, transport::Channel, Request, Response, Status}; use tracing::{instrument, Instrument}; use url::Url; -use penumbra_asset::{asset, asset::Metadata, Value}; -use penumbra_dex::{ +use penumbra_sdk_asset::{asset, asset::Metadata, Value}; +use penumbra_sdk_dex::{ lp::{ position::{self, Position}, Reserves, @@ -30,14 +30,14 @@ use penumbra_dex::{ swap_claim::SwapClaimPlan, TradingPair, }; -use penumbra_fee::Fee; -use penumbra_keys::{ +use penumbra_sdk_fee::Fee; +use penumbra_sdk_keys::{ keys::WalletId, keys::{AddressIndex, FullViewingKey}, Address, AddressView, }; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ util::tendermint_proxy::v1::{ tendermint_proxy_service_client::TendermintProxyServiceClient, BroadcastTxSyncRequest, GetStatusRequest, GetStatusResponse, SyncInfo, @@ -54,9 +54,9 @@ use penumbra_proto::{ }, DomainType, }; -use penumbra_stake::rate::RateData; -use penumbra_tct::{Proof, StateCommitment}; -use penumbra_transaction::{ +use penumbra_sdk_stake::rate::RateData; +use penumbra_sdk_tct::{Proof, StateCommitment}; +use penumbra_sdk_transaction::{ AuthorizationData, Transaction, TransactionPerspective, TransactionPlan, WitnessData, }; @@ -84,7 +84,7 @@ pub struct ViewServer { // rather than a Tokio Mutex because it should be uncontended. error_slot: Arc>>, // A copy of the SCT used by the worker task. - state_commitment_tree: Arc>, + state_commitment_tree: Arc>, // The Url for the pd gRPC endpoint on remote node. node: Url, /// Used to watch for changes to the sync height. @@ -237,9 +237,9 @@ impl ViewServer { transaction .actions() .filter_map(|action| match action { - penumbra_transaction::Action::Spend(spend) => Some(spend.body.nullifier), + penumbra_sdk_transaction::Action::Spend(spend) => Some(spend.body.nullifier), /* - penumbra_transaction::Action::SwapClaim(swap_claim) => { + penumbra_sdk_transaction::Action::SwapClaim(swap_claim) => { Some(swap_claim.body.nullifier) } */ @@ -409,8 +409,8 @@ impl ViewService for ViewServer { &self, request: tonic::Request, ) -> Result, tonic::Status> { - use penumbra_proto::core::component::auction::v1 as pb_auction; - use penumbra_proto::core::component::auction::v1::query_service_client::QueryServiceClient as AuctionQueryServiceClient; + use penumbra_sdk_proto::core::component::auction::v1 as pb_auction; + use penumbra_sdk_proto::core::component::auction::v1::query_service_client::QueryServiceClient as AuctionQueryServiceClient; let parameters = request.into_inner(); let query_latest_state = parameters.query_latest_state; @@ -911,7 +911,7 @@ impl ViewService for ViewServer { // Next, extend the TxP with the openings of commitments known to our view server // but not included in the transaction body, for instance spent notes or swap claim outputs. for action in tx.actions() { - use penumbra_transaction::Action; + use penumbra_sdk_transaction::Action; match action { Action::Spend(spend) => { let nullifier = spend.body.nullifier; @@ -961,8 +961,8 @@ impl ViewService for ViewServer { let mut address_views = BTreeMap::new(); let mut asset_ids = BTreeSet::new(); for action_view in min_view.action_views() { - use penumbra_dex::{swap::SwapView, swap_claim::SwapClaimView}; - use penumbra_transaction::view::action_view::{ + use penumbra_sdk_dex::{swap::SwapView, swap_claim::SwapClaimView}; + use penumbra_sdk_transaction::view::action_view::{ ActionView, DelegatorVoteView, OutputView, SpendView, }; match action_view { diff --git a/crates/view/src/status.rs b/crates/view/src/status.rs index 8c50cc57d8..47349401ef 100644 --- a/crates/view/src/status.rs +++ b/crates/view/src/status.rs @@ -1,4 +1,4 @@ -use penumbra_proto::{view::v1 as pb, DomainType}; +use penumbra_sdk_proto::{view::v1 as pb, DomainType}; #[derive(Clone, Copy, Debug)] pub struct StatusStreamResponse { diff --git a/crates/view/src/storage.rs b/crates/view/src/storage.rs index 330b47c7a9..0d88e650da 100644 --- a/crates/view/src/storage.rs +++ b/crates/view/src/storage.rs @@ -5,7 +5,7 @@ use camino::Utf8Path; use decaf377::Fq; use once_cell::sync::Lazy; use parking_lot::Mutex; -use penumbra_auction::auction::AuctionId; +use penumbra_sdk_auction::auction::AuctionId; use r2d2_sqlite::{ rusqlite::{OpenFlags, OptionalExtension}, SqliteConnectionManager, @@ -19,26 +19,26 @@ use tokio::{ use tracing::{error_span, Instrument}; use url::Url; -use penumbra_app::params::AppParameters; -use penumbra_asset::{asset, asset::Id, asset::Metadata, Value}; -use penumbra_dex::{ +use penumbra_sdk_app::params::AppParameters; +use penumbra_sdk_asset::{asset, asset::Id, asset::Metadata, Value}; +use penumbra_sdk_dex::{ lp::position::{self, Position, State}, TradingPair, }; -use penumbra_fee::GasPrices; -use penumbra_keys::{keys::AddressIndex, Address, FullViewingKey}; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_fee::GasPrices; +use penumbra_sdk_keys::{keys::AddressIndex, Address, FullViewingKey}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ core::app::v1::{ query_service_client::QueryServiceClient as AppQueryServiceClient, AppParametersRequest, }, DomainType, }; -use penumbra_sct::{CommitmentSource, Nullifier}; -use penumbra_shielded_pool::{fmd, note, Note, Rseed}; -use penumbra_stake::{DelegationToken, IdentityKey}; -use penumbra_tct as tct; -use penumbra_transaction::Transaction; +use penumbra_sdk_sct::{CommitmentSource, Nullifier}; +use penumbra_sdk_shielded_pool::{fmd, note, Note, Rseed}; +use penumbra_sdk_stake::{DelegationToken, IdentityKey}; +use penumbra_sdk_tct as tct; +use penumbra_sdk_transaction::Transaction; use sct::TreeStore; use tct::StateCommitment; @@ -878,7 +878,7 @@ impl Storage { &self, include_spent: bool, asset_id: Option, - address_index: Option, + address_index: Option, amount_to_spend: Option, ) -> anyhow::Result> { // If set, return spent notes as well as unspent notes. @@ -986,7 +986,7 @@ impl Storage { pub async fn notes_for_voting( &self, - address_index: Option, + address_index: Option, votable_at_height: u64, ) -> anyhow::Result> { // If set, only return notes with the specified address index. diff --git a/crates/view/src/storage/sct.rs b/crates/view/src/storage/sct.rs index a3e9bdce86..686e809ae4 100644 --- a/crates/view/src/storage/sct.rs +++ b/crates/view/src/storage/sct.rs @@ -5,7 +5,7 @@ use genawaiter::{rc::gen, yield_}; use r2d2_sqlite::rusqlite::Transaction; use core::fmt::Debug; -use penumbra_tct::{ +use penumbra_sdk_tct::{ storage::{Read, StoredPosition, Write}, structure::Hash, Forgotten, Position, StateCommitment, @@ -291,7 +291,7 @@ impl Write for TreeStore<'_, '_> { mod test { use super::*; - use penumbra_tct::{StateCommitment, Witness}; + use penumbra_sdk_tct::{StateCommitment, Witness}; #[test] fn tree_store_spot_check() { @@ -304,11 +304,11 @@ mod test { let mut store = TreeStore(&mut tx); // Check that the currently stored tree is the empty tree: - let deserialized = penumbra_tct::Tree::from_reader(&mut store).unwrap(); - assert_eq!(deserialized, penumbra_tct::Tree::new()); + let deserialized = penumbra_sdk_tct::Tree::from_reader(&mut store).unwrap(); + assert_eq!(deserialized, penumbra_sdk_tct::Tree::new()); // Make some kind of tree: - let mut tree = penumbra_tct::Tree::new(); + let mut tree = penumbra_sdk_tct::Tree::new(); tree.insert(Witness::Keep, StateCommitment::try_from([0; 32]).unwrap()) .unwrap(); tree.end_block().unwrap(); @@ -322,7 +322,7 @@ mod test { tree.to_writer(&mut store).unwrap(); // Read the tree back from the database: - let deserialized = penumbra_tct::Tree::from_reader(&mut store).unwrap(); + let deserialized = penumbra_sdk_tct::Tree::from_reader(&mut store).unwrap(); assert_eq!(tree, deserialized); } diff --git a/crates/view/src/swap_record.rs b/crates/view/src/swap_record.rs index 4622c73a13..febf956e04 100644 --- a/crates/view/src/swap_record.rs +++ b/crates/view/src/swap_record.rs @@ -1,7 +1,7 @@ -use penumbra_dex::{swap::SwapPlaintext, BatchSwapOutputData}; -use penumbra_proto::{view::v1 as pb, DomainType}; -use penumbra_sct::{CommitmentSource, Nullifier}; -use penumbra_tct as tct; +use penumbra_sdk_dex::{swap::SwapPlaintext, BatchSwapOutputData}; +use penumbra_sdk_proto::{view::v1 as pb, DomainType}; +use penumbra_sdk_sct::{CommitmentSource, Nullifier}; +use penumbra_sdk_tct as tct; use r2d2_sqlite::rusqlite::Row; use serde::{Deserialize, Serialize}; diff --git a/crates/view/src/sync.rs b/crates/view/src/sync.rs index 772422b9aa..fd4468cd59 100644 --- a/crates/view/src/sync.rs +++ b/crates/view/src/sync.rs @@ -1,12 +1,12 @@ use std::collections::BTreeMap; -use penumbra_compact_block::{CompactBlock, StatePayload}; -use penumbra_dex::swap::{SwapPayload, SwapPlaintext}; -use penumbra_fee::GasPrices; -use penumbra_keys::FullViewingKey; -use penumbra_sct::Nullifier; -use penumbra_shielded_pool::{fmd, Note, NotePayload}; -use penumbra_tct::{self as tct, StateCommitment}; +use penumbra_sdk_compact_block::{CompactBlock, StatePayload}; +use penumbra_sdk_dex::swap::{SwapPayload, SwapPlaintext}; +use penumbra_sdk_fee::GasPrices; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_sct::Nullifier; +use penumbra_sdk_shielded_pool::{fmd, Note, NotePayload}; +use penumbra_sdk_tct::{self as tct, StateCommitment}; use tracing::Instrument; use crate::{SpendableNoteRecord, Storage, SwapRecord}; diff --git a/crates/view/src/transaction_info.rs b/crates/view/src/transaction_info.rs index 24faf63bd1..0a1ba5727f 100644 --- a/crates/view/src/transaction_info.rs +++ b/crates/view/src/transaction_info.rs @@ -1,4 +1,4 @@ -use penumbra_transaction::{ +use penumbra_sdk_transaction::{ txhash::TransactionId, Transaction, TransactionPerspective, TransactionView, }; diff --git a/crates/view/src/worker.rs b/crates/view/src/worker.rs index ddc92bc8a8..103ce77cb5 100644 --- a/crates/view/src/worker.rs +++ b/crates/view/src/worker.rs @@ -5,11 +5,11 @@ use std::{ }; use anyhow::Context; -use penumbra_auction::auction::AuctionNft; -use penumbra_compact_block::CompactBlock; -use penumbra_dex::lp::{position, LpNft}; -use penumbra_keys::FullViewingKey; -use penumbra_proto::core::{ +use penumbra_sdk_auction::auction::AuctionNft; +use penumbra_sdk_compact_block::CompactBlock; +use penumbra_sdk_dex::lp::{position, LpNft}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proto::core::{ app::v1::{ query_service_client::QueryServiceClient as AppQueryServiceClient, TransactionsByHeightRequest, @@ -25,8 +25,8 @@ use penumbra_proto::core::{ }, }, }; -use penumbra_sct::{CommitmentSource, Nullifier}; -use penumbra_transaction::Transaction; +use penumbra_sdk_sct::{CommitmentSource, Nullifier}; +use penumbra_sdk_transaction::Transaction; use tap::Tap; use tokio::sync::{watch, RwLock}; use tonic::transport::Channel; @@ -42,7 +42,7 @@ const MAX_CB_SIZE_BYTES: usize = 12 * 1024 * 1024; pub struct Worker { storage: Storage, - sct: Arc>, + sct: Arc>, fvk: FullViewingKey, // TODO: notifications (see TODOs on ViewService) error_slot: Arc>>, sync_height_tx: watch::Sender, @@ -64,7 +64,7 @@ impl Worker { ) -> Result< ( Self, - Arc>, + Arc>, Arc>>, watch::Receiver, ), @@ -263,7 +263,7 @@ impl Worker { for transaction in &transactions { for action in transaction.actions() { match action { - penumbra_transaction::Action::PositionOpen(position_open) => { + penumbra_sdk_transaction::Action::PositionOpen(position_open) => { let position_id = position_open.position.id(); // Record every possible permutation. @@ -290,7 +290,7 @@ impl Worker { .record_position(position_open.position.clone()) .await?; } - penumbra_transaction::Action::PositionClose(position_close) => { + penumbra_sdk_transaction::Action::PositionClose(position_close) => { let position_id = position_close.position_id; // Update the position record @@ -298,7 +298,7 @@ impl Worker { .update_position(position_id, position::State::Closed) .await?; } - penumbra_transaction::Action::PositionWithdraw(position_withdraw) => { + penumbra_sdk_transaction::Action::PositionWithdraw(position_withdraw) => { let position_id = position_withdraw.position_id; // Record the LPNFT for the current sequence number. @@ -312,7 +312,7 @@ impl Worker { // Update the position record self.storage.update_position(position_id, state).await?; } - penumbra_transaction::Action::ActionDutchAuctionSchedule( + penumbra_sdk_transaction::Action::ActionDutchAuctionSchedule( schedule_da, ) => { let auction_id = schedule_da.description.id(); @@ -328,7 +328,7 @@ impl Worker { ) .await?; } - penumbra_transaction::Action::ActionDutchAuctionEnd(end_da) => { + penumbra_sdk_transaction::Action::ActionDutchAuctionEnd(end_da) => { let auction_id = end_da.auction_id; let auction_nft_closed = AuctionNft::new(auction_id, 1); let nft_metadata_closed = auction_nft_closed.metadata.clone(); @@ -339,7 +339,7 @@ impl Worker { .record_auction_with_state(end_da.auction_id, 1) .await?; } - penumbra_transaction::Action::ActionDutchAuctionWithdraw( + penumbra_sdk_transaction::Action::ActionDutchAuctionWithdraw( withdraw_da, ) => { let auction_id = withdraw_da.auction_id; @@ -483,16 +483,16 @@ async fn fetch_transactions( async fn sct_divergence_check( channel: Channel, height: u64, - actual_root: penumbra_tct::Root, + actual_root: penumbra_sdk_tct::Root, ) -> anyhow::Result<()> { - use penumbra_proto::{cnidarium::v1::query_service_client::QueryServiceClient, DomainType}; - use penumbra_sct::state_key as sct_state_key; + use penumbra_sdk_proto::{cnidarium::v1::query_service_client::QueryServiceClient, DomainType}; + use penumbra_sdk_sct::state_key as sct_state_key; let mut client = QueryServiceClient::new(channel); tracing::info!(?height, "fetching anchor @ height"); let value = client - .key_value(penumbra_proto::cnidarium::v1::KeyValueRequest { + .key_value(penumbra_sdk_proto::cnidarium::v1::KeyValueRequest { key: sct_state_key::tree::anchor_by_height(height), proof: false, ..Default::default() @@ -502,7 +502,7 @@ async fn sct_divergence_check( .value .context("sct state not found")?; - let expected_root = penumbra_tct::Root::decode(value.value.as_slice())?; + let expected_root = penumbra_sdk_tct::Root::decode(value.value.as_slice())?; if actual_root == expected_root { tracing::info!(?height, ?actual_root, ?expected_root, "sct roots match"); diff --git a/crates/wallet/src/build.rs b/crates/wallet/src/build.rs index 24577816d7..ef8132b01a 100644 --- a/crates/wallet/src/build.rs +++ b/crates/wallet/src/build.rs @@ -1,9 +1,9 @@ use anyhow::Result; -use penumbra_custody::{AuthorizeRequest, CustodyClient}; -use penumbra_keys::FullViewingKey; -use penumbra_transaction::{AuthorizationData, Transaction, TransactionPlan}; -use penumbra_view::ViewClient; +use penumbra_sdk_custody::{AuthorizeRequest, CustodyClient}; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_transaction::{AuthorizationData, Transaction, TransactionPlan}; +use penumbra_sdk_view::ViewClient; pub async fn build_transaction( fvk: &FullViewingKey, diff --git a/crates/wallet/src/plan.rs b/crates/wallet/src/plan.rs index c79df99513..69d62ba134 100644 --- a/crates/wallet/src/plan.rs +++ b/crates/wallet/src/plan.rs @@ -5,12 +5,12 @@ use decaf377::Fq; use rand_core::{CryptoRng, RngCore}; use tracing::instrument; -use penumbra_dex::swap_claim::SwapClaimPlan; -use penumbra_keys::keys::AddressIndex; -use penumbra_proto::view::v1::NotesRequest; -use penumbra_transaction::{TransactionParameters, TransactionPlan}; -pub use penumbra_view::Planner; -use penumbra_view::{SpendableNoteRecord, ViewClient}; +use penumbra_sdk_dex::swap_claim::SwapClaimPlan; +use penumbra_sdk_keys::keys::AddressIndex; +use penumbra_sdk_proto::view::v1::NotesRequest; +use penumbra_sdk_transaction::{TransactionParameters, TransactionPlan}; +pub use penumbra_sdk_view::Planner; +use penumbra_sdk_view::{SpendableNoteRecord, ViewClient}; pub const SWEEP_COUNT: usize = 8; diff --git a/tools/parameter-setup/src/main.rs b/tools/parameter-setup/src/main.rs index 4e17c0ca40..aa9eefdbfd 100644 --- a/tools/parameter-setup/src/main.rs +++ b/tools/parameter-setup/src/main.rs @@ -8,16 +8,16 @@ use std::{ use ark_groth16::{ProvingKey, VerifyingKey}; use ark_serialize::CanonicalSerialize; use decaf377::Bls12_377; -use penumbra_dex::{swap::proof::SwapCircuit, swap_claim::proof::SwapClaimCircuit}; -use penumbra_governance::DelegatorVoteCircuit; -use penumbra_proof_params::{ +use penumbra_sdk_dex::{swap::proof::SwapCircuit, swap_claim::proof::SwapClaimCircuit}; +use penumbra_sdk_governance::DelegatorVoteCircuit; +use penumbra_sdk_proof_params::{ generate_constraint_matrices, DummyWitness, ProvingKeyExt, VerifyingKeyExt, }; -use penumbra_proof_setup::single::{ +use penumbra_sdk_proof_setup::single::{ circuit_degree, combine, log::Hashable, transition, Phase1CRSElements, Phase1Contribution, Phase2Contribution, }; -use penumbra_shielded_pool::{ +use penumbra_sdk_shielded_pool::{ ConvertCircuit, NullifierDerivationCircuit, OutputCircuit, SpendCircuit, }; use rand_core::OsRng; diff --git a/tools/proto-compiler/src/main.rs b/tools/proto-compiler/src/main.rs index a6b29dba5e..bd47d9c029 100644 --- a/tools/proto-compiler/src/main.rs +++ b/tools/proto-compiler/src/main.rs @@ -4,7 +4,7 @@ fn main() -> anyhow::Result<()> { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); println!("root: {}", root.display()); - // We build the proto files for the main penumbra_proto crate + // We build the proto files for the main penumbra_sdk_proto crate // and for the cnidarium crate separately, because the // cnidarium crate is supposed to be independent of the // rest of the Penumbra codebase and its proto structures. diff --git a/tools/summonerd/src/main.rs b/tools/summonerd/src/main.rs index 8d819ffa1d..1055e262da 100644 --- a/tools/summonerd/src/main.rs +++ b/tools/summonerd/src/main.rs @@ -18,13 +18,13 @@ use clap::Parser; use coordinator::Coordinator; use decaf377::Bls12_377; use metrics_tracing_context::MetricsLayer; -use penumbra_keys::FullViewingKey; -use penumbra_proof_params::{ProvingKeyExt, VerifyingKeyExt}; -use penumbra_proof_setup::all::combine; -use penumbra_proof_setup::all::transition; -use penumbra_proto::tools::summoning::v1::ceremony_coordinator_service_server::CeremonyCoordinatorServiceServer; -use penumbra_proto::tools::summoning::v1::CeremonyCrs; -use penumbra_proto::Message; +use penumbra_sdk_keys::FullViewingKey; +use penumbra_sdk_proof_params::{ProvingKeyExt, VerifyingKeyExt}; +use penumbra_sdk_proof_setup::all::combine; +use penumbra_sdk_proof_setup::all::transition; +use penumbra_sdk_proto::tools::summoning::v1::ceremony_coordinator_service_server::CeremonyCoordinatorServiceServer; +use penumbra_sdk_proto::tools::summoning::v1::CeremonyCrs; +use penumbra_sdk_proto::Message; use std::fs; use std::fs::File; use std::io; @@ -46,7 +46,7 @@ use crate::phase::PhaseMarker; use crate::queue::ParticipantQueue; use crate::web::web_app; use crate::{penumbra_knower::PenumbraKnower, server::CoordinatorService}; -use penumbra_proof_setup::all::{Phase1CeremonyCRS, Phase1RawCeremonyCRS}; +use penumbra_sdk_proof_setup::all::{Phase1CeremonyCRS, Phase1RawCeremonyCRS}; /// 100 MIB fn max_message_size(phase: PhaseMarker) -> usize { diff --git a/tools/summonerd/src/participant.rs b/tools/summonerd/src/participant.rs index f0b0035505..fbd9be806b 100644 --- a/tools/summonerd/src/participant.rs +++ b/tools/summonerd/src/participant.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; -use penumbra_keys::Address; -use penumbra_num::Amount; -use penumbra_proto::{ +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proto::{ penumbra::tools::summoning::v1::{ self as pb, participate_request::Msg as RequestMsg, diff --git a/tools/summonerd/src/penumbra_knower.rs b/tools/summonerd/src/penumbra_knower.rs index 00b74b637c..fd6625f7b0 100644 --- a/tools/summonerd/src/penumbra_knower.rs +++ b/tools/summonerd/src/penumbra_knower.rs @@ -1,9 +1,9 @@ use anyhow::Result; use camino::Utf8Path; -use penumbra_asset::STAKING_TOKEN_ASSET_ID; -use penumbra_keys::{Address, FullViewingKey}; -use penumbra_num::Amount; -use penumbra_view::{Storage, ViewServer}; +use penumbra_sdk_asset::STAKING_TOKEN_ASSET_ID; +use penumbra_sdk_keys::{Address, FullViewingKey}; +use penumbra_sdk_num::Amount; +use penumbra_sdk_view::{Storage, ViewServer}; use url::Url; /// Knows things about a running penumbra system, requires internet connectivity diff --git a/tools/summonerd/src/phase.rs b/tools/summonerd/src/phase.rs index 7ff636a229..623ac1cfed 100644 --- a/tools/summonerd/src/phase.rs +++ b/tools/summonerd/src/phase.rs @@ -1,11 +1,11 @@ use anyhow::Result; use async_trait::async_trait; -use penumbra_keys::Address; -use penumbra_proof_setup::all::{ +use penumbra_sdk_keys::Address; +use penumbra_sdk_proof_setup::all::{ Phase1CeremonyCRS, Phase1CeremonyContribution, Phase1RawCeremonyContribution, Phase2CeremonyCRS, Phase2CeremonyContribution, Phase2RawCeremonyContribution, }; -use penumbra_proto::tools::summoning::v1::{ +use penumbra_sdk_proto::tools::summoning::v1::{ participate_request::Contribution as PBContribution, CeremonyCrs, }; diff --git a/tools/summonerd/src/queue.rs b/tools/summonerd/src/queue.rs index 10aaa313f1..ef27dd8b19 100644 --- a/tools/summonerd/src/queue.rs +++ b/tools/summonerd/src/queue.rs @@ -1,8 +1,8 @@ use anyhow::Result; use std::{collections::HashSet, sync::Arc}; -use penumbra_keys::Address; -use penumbra_num::Amount; +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; use tokio::sync::RwLock; use crate::participant::Participant; diff --git a/tools/summonerd/src/server.rs b/tools/summonerd/src/server.rs index f1b892cda9..1f54fda854 100644 --- a/tools/summonerd/src/server.rs +++ b/tools/summonerd/src/server.rs @@ -1,5 +1,5 @@ -use penumbra_keys::Address; -use penumbra_proto::penumbra::tools::summoning::v1::{ +use penumbra_sdk_keys::Address; +use penumbra_sdk_proto::penumbra::tools::summoning::v1::{ self as pb, ceremony_coordinator_service_server as server, participate_request::{Identify, Msg}, }; diff --git a/tools/summonerd/src/storage.rs b/tools/summonerd/src/storage.rs index 0ca82c1d53..ba35f450b4 100644 --- a/tools/summonerd/src/storage.rs +++ b/tools/summonerd/src/storage.rs @@ -2,9 +2,9 @@ use std::time::{SystemTime, UNIX_EPOCH}; use anyhow::Result; use camino::Utf8Path; -use penumbra_keys::Address; -use penumbra_num::Amount; -use penumbra_proof_setup::{ +use penumbra_sdk_keys::Address; +use penumbra_sdk_num::Amount; +use penumbra_sdk_proof_setup::{ all::{ AllExtraTransitionInformation, Phase1CeremonyCRS, Phase1CeremonyContribution, Phase1RawCeremonyCRS, Phase1RawCeremonyContribution, Phase2CeremonyCRS, @@ -12,7 +12,7 @@ use penumbra_proof_setup::{ }, single::log::Hashable, }; -use penumbra_proto::{ +use penumbra_sdk_proto::{ penumbra::tools::summoning::v1::{ self as pb, participate_request::Contribution as PBContribution, }, diff --git a/tools/summonerd/src/web.rs b/tools/summonerd/src/web.rs index c2a142f9ed..644c6852b1 100644 --- a/tools/summonerd/src/web.rs +++ b/tools/summonerd/src/web.rs @@ -6,7 +6,7 @@ use axum::{ routing::get, Router, }; -use penumbra_keys::Address; +use penumbra_sdk_keys::Address; use std::sync::Arc; use crate::{config::Config, PhaseMarker}; From 2070ae0607567dbc810bfa0e0d9fd2a9dbb74d7e Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 10:29:52 -0500 Subject: [PATCH 03/19] penumbra(cargo): remove redundant package keys --- Cargo.toml | 52 +++++++++++++++++++------------------- crates/core/app/Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ed8d76d61c..fa7144beea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,7 +136,7 @@ chacha20poly1305 = { version = "0.9.0" } chrono = { default-features = false, version = "0.4" } clap = { version = "3.2" } cnidarium = { version = "0.81", default-features = false} -cnidarium-component = { default-features = false, path = "crates/cnidarium-component", package = "cnidarium-component" } +cnidarium-component = { default-features = false, path = "crates/cnidarium-component" } cometindex = { path = "crates/util/cometindex" } criterion = { version = "0.4" } decaf377 = { default-features = false, version = "0.10.1" } @@ -170,32 +170,32 @@ parking_lot = { version = "0.12.1" } pbjson = { version = "0.7.0" } pbjson-types = { version = "0.7.0" } penumbra-sdk-app = { default-features = false, path = "crates/core/app" } -penumbra-sdk-asset = { default-features = false, path = "crates/core/asset", package = "penumbra-sdk-asset" } -penumbra-sdk-community-pool = { default-features = false, path = "crates/core/component/community-pool", package = "penumbra-sdk-community-pool" } -penumbra-sdk-compact-block = { default-features = false, path = "crates/core/component/compact-block", package = "penumbra-sdk-compact-block" } -penumbra-sdk-custody = { path = "crates/custody", package = "penumbra-sdk-custody" } -penumbra-sdk-auction = { default-features = false, path = "crates/core/component/auction", package = "penumbra-sdk-auction" } -penumbra-sdk-dex = { default-features = false, path = "crates/core/component/dex", package = "penumbra-sdk-dex" } -penumbra-sdk-distributions = { default-features = false, path = "crates/core/component/distributions", package = "penumbra-sdk-distributions" } -penumbra-sdk-fee = { default-features = false, path = "crates/core/component/fee", package = "penumbra-sdk-fee" } -penumbra-sdk-funding = { default-features = false, path = "crates/core/component/funding", package = "penumbra-sdk-funding" } -penumbra-sdk-governance = { default-features = false, path = "crates/core/component/governance", package = "penumbra-sdk-governance" } -penumbra-sdk-ibc = { default-features = false, path = "crates/core/component/ibc", package = "penumbra-sdk-ibc" } -penumbra-sdk-keys = { default-features = false, path = "crates/core/keys", package = "penumbra-sdk-keys" } -penumbra-sdk-mock-client = { path = "crates/test/mock-client", package = "penumbra-sdk-mock-client" } -penumbra-sdk-mock-consensus = { path = "crates/test/mock-consensus", package = "penumbra-sdk-mock-consensus" } -penumbra-sdk-mock-tendermint-proxy = { path = "crates/test/mock-tendermint-proxy", package = "penumbra-sdk-mock-tendermint-proxy" } -penumbra-sdk-num = { default-features = false, path = "crates/core/num", package = "penumbra-sdk-num" } -penumbra-sdk-proof-params = { default-features = false, path = "crates/crypto/proof-params", package = "penumbra-sdk-proof-params" } -penumbra-sdk-proof-setup = { path = "crates/crypto/proof-setup", package = "penumbra-sdk-proof-setup" } -penumbra-sdk-proto = { default-features = false, path = "crates/proto", package = "penumbra-sdk-proto" } -penumbra-sdk-sct = { default-features = false, path = "crates/core/component/sct", package = "penumbra-sdk-sct" } -penumbra-sdk-shielded-pool = { default-features = false, path = "crates/core/component/shielded-pool", package = "penumbra-sdk-shielded-pool" } -penumbra-sdk-stake = { default-features = false, path = "crates/core/component/stake", package = "penumbra-sdk-stake" } -penumbra-sdk-tct = { default-features = false, path = "crates/crypto/tct", package = "penumbra-sdk-tct" } +penumbra-sdk-asset = { default-features = false, path = "crates/core/asset" } +penumbra-sdk-community-pool = { default-features = false, path = "crates/core/component/community-pool" } +penumbra-sdk-compact-block = { default-features = false, path = "crates/core/component/compact-block" } +penumbra-sdk-custody = { path = "crates/custody" } +penumbra-sdk-auction = { default-features = false, path = "crates/core/component/auction" } +penumbra-sdk-dex = { default-features = false, path = "crates/core/component/dex" } +penumbra-sdk-distributions = { default-features = false, path = "crates/core/component/distributions" } +penumbra-sdk-fee = { default-features = false, path = "crates/core/component/fee" } +penumbra-sdk-funding = { default-features = false, path = "crates/core/component/funding" } +penumbra-sdk-governance = { default-features = false, path = "crates/core/component/governance" } +penumbra-sdk-ibc = { default-features = false, path = "crates/core/component/ibc" } +penumbra-sdk-keys = { default-features = false, path = "crates/core/keys" } +penumbra-sdk-mock-client = { path = "crates/test/mock-client" } +penumbra-sdk-mock-consensus = { path = "crates/test/mock-consensus" } +penumbra-sdk-mock-tendermint-proxy = { path = "crates/test/mock-tendermint-proxy" } +penumbra-sdk-num = { default-features = false, path = "crates/core/num" } +penumbra-sdk-proof-params = { default-features = false, path = "crates/crypto/proof-params" } +penumbra-sdk-proof-setup = { path = "crates/crypto/proof-setup" } +penumbra-sdk-proto = { default-features = false, path = "crates/proto" } +penumbra-sdk-sct = { default-features = false, path = "crates/core/component/sct" } +penumbra-sdk-shielded-pool = { default-features = false, path = "crates/core/component/shielded-pool" } +penumbra-sdk-stake = { default-features = false, path = "crates/core/component/stake" } +penumbra-sdk-tct = { default-features = false, path = "crates/crypto/tct" } penumbra-sdk-test-subscriber = { path = "crates/test/tracing-subscriber" } -penumbra-sdk-transaction = { default-features = false, path = "crates/core/transaction", package = "penumbra-sdk-transaction" } -penumbra-sdk-txhash = { default-features = false, path = "crates/core/txhash", package = "penumbra-sdk-txhash" } +penumbra-sdk-transaction = { default-features = false, path = "crates/core/transaction" } +penumbra-sdk-txhash = { default-features = false, path = "crates/core/txhash" } penumbra-sdk-view = { path = "crates/view" } penumbra-sdk-wallet = { path = "crates/wallet" } pin-project = { version = "1.0.12" } diff --git a/crates/core/app/Cargo.toml b/crates/core/app/Cargo.toml index a357e714c4..f6d39dfe99 100644 --- a/crates/core/app/Cargo.toml +++ b/crates/core/app/Cargo.toml @@ -76,7 +76,7 @@ penumbra-sdk-shielded-pool = { workspace = true, default-features = fa penumbra-sdk-stake = { workspace = true, default-features = false } penumbra-sdk-tct = { workspace = true, default-features = true } penumbra-sdk-test-subscriber = { workspace = true } -penumbra-sdk-tower-trace = { path = "../../util/tower-trace", package = "penumbra-sdk-tower-trace" } +penumbra-sdk-tower-trace = { path = "../../util/tower-trace" } penumbra-sdk-transaction = { workspace = true, features = ["parallel"], default-features = true } penumbra-sdk-txhash = { workspace = true, default-features = true } prost = { workspace = true } From fdafd9a7e17dd6fb5e9fd7f3427263c5c816c5cd Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 10:55:03 -0500 Subject: [PATCH 04/19] penumbra: `fmt` --- crates/bench/benches/spend.rs | 4 ++- .../bin/pcli/src/command/query/governance.rs | 7 +++--- crates/bin/pcli/src/command/tx.rs | 8 ++++-- .../bin/pcli/src/command/tx/auction/dutch.rs | 4 ++- crates/bin/pcli/src/terminal.rs | 4 ++- crates/bin/pcli/src/transaction_view_ext.rs | 8 ++++-- crates/bin/pcli/tests/proof.rs | 4 ++- .../bin/pclientd/tests/network_integration.rs | 13 +++++----- crates/bin/pd/src/cli.rs | 12 +++++++-- crates/bin/pd/src/main.rs | 25 ++++++++++--------- crates/bin/pd/src/network/generate.rs | 6 +++-- ..._can_define_and_delegate_to_a_validator.rs | 4 ++- .../app_can_disable_community_pool_spends.rs | 9 ++++--- .../app_can_undelegate_from_a_validator.rs | 4 ++- .../core/app/tests/common/ibc_tests/node.rs | 5 +++- crates/core/app/tests/common/mod.rs | 4 ++- .../app/tests/common/test_node_builder_ext.rs | 5 +++- crates/core/asset/src/asset.rs | 9 +++++-- .../core/component/dex/src/component/rpc.rs | 8 +++--- .../core/component/fee/src/component/rpc.rs | 4 ++- .../funding/src/component/metrics.rs | 3 ++- .../validator_handler/validator_store.rs | 4 ++- crates/core/transaction/src/view.rs | 4 ++- .../core/transaction/src/view/action_view.rs | 4 ++- .../proto/src/protobuf/tendermint_compat.rs | 8 ++++-- crates/test/mock-client/src/lib.rs | 5 +++- crates/view/src/worker.rs | 4 ++- 27 files changed, 122 insertions(+), 57 deletions(-) diff --git a/crates/bench/benches/spend.rs b/crates/bench/benches/spend.rs index 70f8f9fc9b..bbb77b70e9 100644 --- a/crates/bench/benches/spend.rs +++ b/crates/bench/benches/spend.rs @@ -9,7 +9,9 @@ use penumbra_sdk_asset::Value; use penumbra_sdk_keys::keys::{Bip44Path, SeedPhrase, SpendKey}; use penumbra_sdk_proof_params::{DummyWitness, SPEND_PROOF_PROVING_KEY}; use penumbra_sdk_sct::Nullifier; -use penumbra_sdk_shielded_pool::{Note, SpendCircuit, SpendProof, SpendProofPrivate, SpendProofPublic}; +use penumbra_sdk_shielded_pool::{ + Note, SpendCircuit, SpendProof, SpendProofPrivate, SpendProofPublic, +}; use penumbra_sdk_tct as tct; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/crates/bin/pcli/src/command/query/governance.rs b/crates/bin/pcli/src/command/query/governance.rs index 93a0decb65..6fb05a7209 100644 --- a/crates/bin/pcli/src/command/query/governance.rs +++ b/crates/bin/pcli/src/command/query/governance.rs @@ -188,10 +188,9 @@ impl GovernanceCmd { .tally .expect("tally must be set for vote response") .try_into()?; - Ok::<(IdentityKey, penumbra_sdk_governance::Tally), anyhow::Error>(( - identity_key, - tally, - )) + Ok::<(IdentityKey, penumbra_sdk_governance::Tally), anyhow::Error>( + (identity_key, tally), + ) }) // TODO: double iterator here is suboptimal but trying to collect // `Result>` was annoying diff --git a/crates/bin/pcli/src/command/tx.rs b/crates/bin/pcli/src/command/tx.rs index 0a4cccd2c9..90cc0e1661 100644 --- a/crates/bin/pcli/src/command/tx.rs +++ b/crates/bin/pcli/src/command/tx.rs @@ -29,7 +29,9 @@ use liquidity_position::PositionCmd; use penumbra_sdk_asset::{asset, asset::Metadata, Value, STAKING_TOKEN_ASSET_ID}; use penumbra_sdk_dex::{lp::position, swap_claim::SwapClaimPlan}; use penumbra_sdk_fee::FeeTier; -use penumbra_sdk_governance::{proposal::ProposalToml, proposal_state::State as ProposalState, Vote}; +use penumbra_sdk_governance::{ + proposal::ProposalToml, proposal_state::State as ProposalState, Vote, +}; use penumbra_sdk_keys::{keys::AddressIndex, Address}; use penumbra_sdk_num::Amount; use penumbra_sdk_proto::{ @@ -64,7 +66,9 @@ use penumbra_sdk_proto::{ }; use penumbra_sdk_shielded_pool::Ics20Withdrawal; use penumbra_sdk_stake::rate::RateData; -use penumbra_sdk_stake::{DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan}; +use penumbra_sdk_stake::{ + DelegationToken, IdentityKey, Penalty, UnbondingToken, UndelegateClaimPlan, +}; use penumbra_sdk_transaction::{gas::swap_claim_gas_cost, Transaction}; use penumbra_sdk_view::{SpendableNoteRecord, ViewClient}; use penumbra_sdk_wallet::plan::{self, Planner}; diff --git a/crates/bin/pcli/src/command/tx/auction/dutch.rs b/crates/bin/pcli/src/command/tx/auction/dutch.rs index 66a2964a78..4d2f0bb9af 100644 --- a/crates/bin/pcli/src/command/tx/auction/dutch.rs +++ b/crates/bin/pcli/src/command/tx/auction/dutch.rs @@ -8,7 +8,9 @@ use clap::Subcommand; use comfy_table::presets; use dialoguer::Confirm; use penumbra_sdk_asset::{asset::Cache, Value}; -use penumbra_sdk_auction::auction::{dutch::DutchAuction, dutch::DutchAuctionDescription, AuctionId}; +use penumbra_sdk_auction::auction::{ + dutch::DutchAuction, dutch::DutchAuctionDescription, AuctionId, +}; use penumbra_sdk_keys::keys::AddressIndex; use penumbra_sdk_num::Amount; use penumbra_sdk_proto::{view::v1::GasPricesRequest, DomainType}; diff --git a/crates/bin/pcli/src/terminal.rs b/crates/bin/pcli/src/terminal.rs index 461906da3a..69dea541d0 100644 --- a/crates/bin/pcli/src/terminal.rs +++ b/crates/bin/pcli/src/terminal.rs @@ -94,7 +94,9 @@ fn pretty_print_transaction_plan( output::Output { body: output::Body { note_payload: penumbra_sdk_shielded_pool::NotePayload { - note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment(Fq::default()), + note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment( + Fq::default(), + ), ephemeral_key: [0u8; 32] .as_slice() .try_into() diff --git a/crates/bin/pcli/src/transaction_view_ext.rs b/crates/bin/pcli/src/transaction_view_ext.rs index ee059727e3..a1b925a2e9 100644 --- a/crates/bin/pcli/src/transaction_view_ext.rs +++ b/crates/bin/pcli/src/transaction_view_ext.rs @@ -377,7 +377,9 @@ impl TransactionViewExt for TransactionView { penumbra_sdk_transaction::ActionView::PositionWithdraw(_) => { ["Withdraw Liquitity Position", ""] } - penumbra_sdk_transaction::ActionView::ProposalDepositClaim(proposal_deposit_claim) => { + penumbra_sdk_transaction::ActionView::ProposalDepositClaim( + proposal_deposit_claim, + ) => { action = format!( "Claim Deposit for Governance Proposal #{}", proposal_deposit_claim.proposal @@ -415,7 +417,9 @@ impl TransactionViewExt for TransactionView { } penumbra_sdk_transaction::ActionView::Delegate(_) => ["Delegation", ""], penumbra_sdk_transaction::ActionView::Undelegate(_) => ["Undelegation", ""], - penumbra_sdk_transaction::ActionView::UndelegateClaim(_) => ["Undelegation Claim", ""], + penumbra_sdk_transaction::ActionView::UndelegateClaim(_) => { + ["Undelegation Claim", ""] + } penumbra_sdk_transaction::ActionView::ActionDutchAuctionSchedule(x) => { let description = &x.action.description; diff --git a/crates/bin/pcli/tests/proof.rs b/crates/bin/pcli/tests/proof.rs index 936a66c9a1..513d617f63 100644 --- a/crates/bin/pcli/tests/proof.rs +++ b/crates/bin/pcli/tests/proof.rs @@ -31,7 +31,9 @@ use penumbra_sdk_shielded_pool::{ NullifierDerivationProof, NullifierDerivationProofPrivate, NullifierDerivationProofPublic, OutputProof, SpendProof, SpendProofPrivate, SpendProofPublic, }; -use penumbra_sdk_stake::undelegate_claim::{UndelegateClaimProofPrivate, UndelegateClaimProofPublic}; +use penumbra_sdk_stake::undelegate_claim::{ + UndelegateClaimProofPrivate, UndelegateClaimProofPublic, +}; use penumbra_sdk_stake::{IdentityKey, Penalty, UnbondingToken, UndelegateClaimProof}; use penumbra_sdk_tct as tct; use rand_core::OsRng; diff --git a/crates/bin/pclientd/tests/network_integration.rs b/crates/bin/pclientd/tests/network_integration.rs index 0ca9116f74..c4a783096c 100644 --- a/crates/bin/pclientd/tests/network_integration.rs +++ b/crates/bin/pclientd/tests/network_integration.rs @@ -314,12 +314,13 @@ async fn swap_claim_flow() -> anyhow::Result<()> { .ok_or_else(|| anyhow::anyhow!("TransactionPlannerResponse missing plan"))?; // Hold on to the swap plaintext to be able to claim. - let swap_plaintext = TryInto::::try_into(plan.clone())? - .swap_plans() - .next() - .expect("swap plan must be present") - .swap_plaintext - .clone(); + let swap_plaintext = + TryInto::::try_into(plan.clone())? + .swap_plans() + .next() + .expect("swap plan must be present") + .swap_plaintext + .clone(); // 5.2. Get authorization data for the transaction from pclientd (signing). let auth_data = custody_client diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index f406e82b83..641117a245 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -236,10 +236,18 @@ pub enum NetworkCommand { #[clap(long, env = "penumbra_sdk_PD_TM_EXTERNAL_ADDR")] external_address: Option, /// When generating Tendermint config, use this socket to bind the Tendermint RPC service. - #[clap(long, env = "penumbra_sdk_PD_TM_RPC_BIND", default_value = "0.0.0.0:26657")] + #[clap( + long, + env = "penumbra_sdk_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", default_value = "0.0.0.0:26656")] + #[clap( + long, + env = "penumbra_sdk_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)] diff --git a/crates/bin/pd/src/main.rs b/crates/bin/pd/src/main.rs index c812ca435a..c856d2ddb1 100644 --- a/crates/bin/pd/src/main.rs +++ b/crates/bin/pd/src/main.rs @@ -133,18 +133,19 @@ async fn main() -> anyhow::Result<()> { let tm_proxy = penumbra_sdk_tendermint_proxy::TendermintProxy::new(cometbft_addr); - let grpc_routes = penumbra_sdk_app::rpc::routes(&storage, tm_proxy, enable_expensive_rpc)? - .into_axum_router() - .layer( - ServiceBuilder::new().layer(TraceLayer::new_for_grpc().make_span_with( - |req: &http::Request<_>| match remote_addr(req) { - Some(remote_addr) => { - tracing::error_span!("grpc", ?remote_addr) - } - None => tracing::error_span!("grpc"), - }, - )), - ); + let grpc_routes = + penumbra_sdk_app::rpc::routes(&storage, tm_proxy, enable_expensive_rpc)? + .into_axum_router() + .layer( + ServiceBuilder::new().layer(TraceLayer::new_for_grpc().make_span_with( + |req: &http::Request<_>| match remote_addr(req) { + Some(remote_addr) => { + tracing::error_span!("grpc", ?remote_addr) + } + None => tracing::error_span!("grpc"), + }, + )), + ); // Create Axum routes for the frontend app. let frontend = pd::zipserve::router("/app/", pd::MINIFRONT_ARCHIVE_BYTES); diff --git a/crates/bin/pd/src/network/generate.rs b/crates/bin/pd/src/network/generate.rs index a21e73937e..0c92549dec 100644 --- a/crates/bin/pd/src/network/generate.rs +++ b/crates/bin/pd/src/network/generate.rs @@ -773,7 +773,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 penumbra_sdk_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + let penumbra_sdk_app::genesis::AppState::Content(app_state) = + testnet_config.genesis.app_state else { unimplemented!("TODO: support checkpointed app state") }; @@ -803,7 +804,8 @@ mod tests { )?; assert_eq!(testnet_config.name, "test-chain-4567"); assert_eq!(testnet_config.genesis.validators.len(), 0); - let penumbra_sdk_app::genesis::AppState::Content(app_state) = testnet_config.genesis.app_state + let penumbra_sdk_app::genesis::AppState::Content(app_state) = + testnet_config.genesis.app_state else { unimplemented!("TODO: support checkpointed app state") }; diff --git a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs index efad2e947c..4aa6971582 100644 --- a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs +++ b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs @@ -82,7 +82,9 @@ async fn app_can_define_and_delegate_to_a_validator() -> anyhow::Result<()> { // Show that the existing validator is and was active. { - use penumbra_sdk_stake::{component::validator_handler::ValidatorDataRead, validator::State}; + use penumbra_sdk_stake::{ + component::validator_handler::ValidatorDataRead, validator::State, + }; let start = snapshot_start .get_validator_state(&existing_validator_id) .await?; diff --git a/crates/core/app/tests/app_can_disable_community_pool_spends.rs b/crates/core/app/tests/app_can_disable_community_pool_spends.rs index 75b8a4ccbc..9fd55f8df5 100644 --- a/crates/core/app/tests/app_can_disable_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_disable_community_pool_spends.rs @@ -123,10 +123,11 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> { }, }, community_pool_content: penumbra_sdk_community_pool::genesis::Content { - community_pool_params: penumbra_sdk_community_pool::params::CommunityPoolParameters { - // Disable community spend proposals. - community_pool_spend_proposals_enabled: false, - }, + community_pool_params: + penumbra_sdk_community_pool::params::CommunityPoolParameters { + // Disable community spend proposals. + community_pool_spend_proposals_enabled: false, + }, ..Default::default() }, ..Default::default() diff --git a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs index 716ad717d8..27b79aadad 100644 --- a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs +++ b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs @@ -14,7 +14,9 @@ use { penumbra_sdk_num::fixpoint::U128x128, penumbra_sdk_proto::DomainType, penumbra_sdk_sct::component::clock::EpochRead as _, - penumbra_sdk_stake::{component::validator_handler::ValidatorDataRead as _, UndelegateClaimPlan}, + penumbra_sdk_stake::{ + component::validator_handler::ValidatorDataRead as _, UndelegateClaimPlan, + }, penumbra_sdk_transaction::{ memo::MemoPlaintext, plan::MemoPlan, TransactionParameters, TransactionPlan, }, diff --git a/crates/core/app/tests/common/ibc_tests/node.rs b/crates/core/app/tests/common/ibc_tests/node.rs index f39d2f4dfa..7ae02619d2 100644 --- a/crates/core/app/tests/common/ibc_tests/node.rs +++ b/crates/core/app/tests/common/ibc_tests/node.rs @@ -212,7 +212,10 @@ impl TestNodeWithIBC { pub fn create_tendermint_header( &self, trusted_height: Option, - penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse{block_id: _, block}: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse, + penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse { + block_id: _, + block, + }: penumbra_sdk_proto::util::tendermint_proxy::v1::GetBlockByHeightResponse, ) -> Result { let pk = self .node diff --git a/crates/core/app/tests/common/mod.rs b/crates/core/app/tests/common/mod.rs index c2dfcc6a05..58b1e162ab 100644 --- a/crates/core/app/tests/common/mod.rs +++ b/crates/core/app/tests/common/mod.rs @@ -7,7 +7,9 @@ pub use { temp_storage_ext::TempStorageExt, test_node_builder_ext::BuilderExt, test_node_ext::TestNodeExt, validator_read_ext::ValidatorDataReadExt, }, - penumbra_sdk_test_subscriber::{set_tracing_subscriber, set_tracing_subscriber_with_env_filter}, + penumbra_sdk_test_subscriber::{ + set_tracing_subscriber, set_tracing_subscriber_with_env_filter, + }, }; /// Penumbra-specific extensions to the mock consensus builder. diff --git a/crates/core/app/tests/common/test_node_builder_ext.rs b/crates/core/app/tests/common/test_node_builder_ext.rs index 81865651f0..f2f9aa4f6b 100644 --- a/crates/core/app/tests/common/test_node_builder_ext.rs +++ b/crates/core/app/tests/common/test_node_builder_ext.rs @@ -26,7 +26,10 @@ pub trait BuilderExt: Sized { impl BuilderExt for Builder { type Error = anyhow::Error; - fn with_penumbra_sdk_auto_app_state(mut self, app_state: AppState) -> Result { + fn with_penumbra_sdk_auto_app_state( + mut self, + app_state: AppState, + ) -> Result { let Self { keyring, .. } = &self; let mut content = match app_state { AppState::Content(c) => c, diff --git a/crates/core/asset/src/asset.rs b/crates/core/asset/src/asset.rs index f40da0aa74..a672021f60 100644 --- a/crates/core/asset/src/asset.rs +++ b/crates/core/asset/src/asset.rs @@ -118,7 +118,10 @@ mod tests { penumbra_sdk_display_denom.format_value(6700001u64.into()), "6.700001" ); - assert_eq!(penumbra_sdk_display_denom.format_value(1u64.into()), "0.000001"); + assert_eq!( + penumbra_sdk_display_denom.format_value(1u64.into()), + "0.000001" + ); // with exponent 3, 1782000 formats to 1782 let mpenumbra_sdk_display_denom = REGISTRY.parse_unit("mpenumbra"); @@ -183,7 +186,9 @@ mod tests { mpenumbra_sdk_display_denom.parse_value("1782").unwrap(), 1782000u64.into() ); - assert!(mpenumbra_sdk_display_denom.parse_value("1782.0001").is_err()); + assert!(mpenumbra_sdk_display_denom + .parse_value("1782.0001") + .is_err()); let upenumbra_sdk_display_denom = REGISTRY.parse_unit("upenumbra"); assert_eq!( diff --git a/crates/core/component/dex/src/component/rpc.rs b/crates/core/component/dex/src/component/rpc.rs index 46853854c4..0bfd3df7b3 100644 --- a/crates/core/component/dex/src/component/rpc.rs +++ b/crates/core/component/dex/src/component/rpc.rs @@ -571,9 +571,11 @@ impl QueryService for Server { } }; Ok(tonic::Response::new( - s.map_ok(|p: penumbra_sdk_proto::core::component::dex::v1::Position| { - LiquidityPositionsByIdResponse { data: Some(p) } - }) + s.map_ok( + |p: penumbra_sdk_proto::core::component::dex::v1::Position| { + LiquidityPositionsByIdResponse { data: Some(p) } + }, + ) .map_err(|e: anyhow::Error| { tonic::Status::unavailable(format!( "error getting position value from storage: {e}" diff --git a/crates/core/component/fee/src/component/rpc.rs b/crates/core/component/fee/src/component/rpc.rs index f1dea0f2ff..fd9291a420 100644 --- a/crates/core/component/fee/src/component/rpc.rs +++ b/crates/core/component/fee/src/component/rpc.rs @@ -1,6 +1,8 @@ use async_trait::async_trait; use cnidarium::Storage; -use penumbra_sdk_proto::core::component::fee::v1::{self as pb, query_service_server::QueryService}; +use penumbra_sdk_proto::core::component::fee::v1::{ + self as pb, query_service_server::QueryService, +}; use super::StateReadExt; diff --git a/crates/core/component/funding/src/component/metrics.rs b/crates/core/component/funding/src/component/metrics.rs index 4cf6edc71b..8adafcc9ce 100644 --- a/crates/core/component/funding/src/component/metrics.rs +++ b/crates/core/component/funding/src/component/metrics.rs @@ -40,7 +40,8 @@ pub fn register_metrics() { ); } -pub const TOTAL_VALIDATOR_REWARDS: &str = "penumbra_sdk_funding_total_validator_rewards_staking_token"; +pub const TOTAL_VALIDATOR_REWARDS: &str = + "penumbra_sdk_funding_total_validator_rewards_staking_token"; pub const VALIDATOR_FUNDING_VS_BUDGET_DIFFERENCE: &str = "penumbra_sdk_funding_validator_vs_budget_difference_staking_token"; pub const FETCH_FUNDING_QUEUE_LATENCY: &str = diff --git a/crates/core/component/stake/src/component/validator_handler/validator_store.rs b/crates/core/component/stake/src/component/validator_handler/validator_store.rs index 845724fe80..ef1c5845d7 100644 --- a/crates/core/component/stake/src/component/validator_handler/validator_store.rs +++ b/crates/core/component/stake/src/component/validator_handler/validator_store.rs @@ -11,7 +11,9 @@ use async_trait::async_trait; use cnidarium::{StateRead, StateWrite}; use futures::{Future, FutureExt}; use penumbra_sdk_num::Amount; -use penumbra_sdk_proto::{state::future::DomainFuture, DomainType, StateReadProto, StateWriteProto}; +use penumbra_sdk_proto::{ + state::future::DomainFuture, DomainType, StateReadProto, StateWriteProto, +}; use std::pin::Pin; use tendermint::PublicKey; use tracing::instrument; diff --git a/crates/core/transaction/src/view.rs b/crates/core/transaction/src/view.rs index 5e0540e1bb..14ca9e95b6 100644 --- a/crates/core/transaction/src/view.rs +++ b/crates/core/transaction/src/view.rs @@ -536,7 +536,9 @@ mod test { output::Output { body: output::Body { note_payload: penumbra_sdk_shielded_pool::NotePayload { - note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment(Fq::default()), + note_commitment: penumbra_sdk_shielded_pool::note::StateCommitment( + Fq::default(), + ), ephemeral_key: [0u8; 32] .as_slice() .try_into() diff --git a/crates/core/transaction/src/view/action_view.rs b/crates/core/transaction/src/view/action_view.rs index 938ffd5249..d06f98d2ed 100644 --- a/crates/core/transaction/src/view/action_view.rs +++ b/crates/core/transaction/src/view/action_view.rs @@ -8,7 +8,9 @@ use penumbra_sdk_dex::{ swap::SwapView, swap_claim::SwapClaimView, }; -use penumbra_sdk_governance::{ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote}; +use penumbra_sdk_governance::{ + ProposalDepositClaim, ProposalSubmit, ProposalWithdraw, ValidatorVote, +}; use penumbra_sdk_ibc::IbcRelay; use penumbra_sdk_proto::{core::transaction::v1 as pbt, DomainType}; use penumbra_sdk_shielded_pool::Ics20Withdrawal; diff --git a/crates/proto/src/protobuf/tendermint_compat.rs b/crates/proto/src/protobuf/tendermint_compat.rs index 5fbe0eab73..e4081c5e3a 100644 --- a/crates/proto/src/protobuf/tendermint_compat.rs +++ b/crates/proto/src/protobuf/tendermint_compat.rs @@ -273,7 +273,9 @@ pub struct HeightOverflowError { source: >::Error, } -impl TryFrom for penumbra_sdk_pb::AbciQueryResponse { +impl TryFrom + for penumbra_sdk_pb::AbciQueryResponse +{ type Error = HeightOverflowError; fn try_from( tendermint_rpc::endpoint::abci_query::AbciQuery { @@ -338,7 +340,9 @@ impl From for crate::tendermint::crypto::Pro // === get_block_by_height === -impl TryFrom for penumbra_sdk_pb::GetBlockByHeightResponse { +impl TryFrom + for penumbra_sdk_pb::GetBlockByHeightResponse +{ type Error = anyhow::Error; fn try_from( tendermint_rpc::endpoint::block::Response { diff --git a/crates/test/mock-client/src/lib.rs b/crates/test/mock-client/src/lib.rs index 2903697835..a40c0a84c9 100644 --- a/crates/test/mock-client/src/lib.rs +++ b/crates/test/mock-client/src/lib.rs @@ -210,7 +210,10 @@ impl MockClient { self.swaps.get(commitment).cloned() } - pub fn position(&self, commitment: note::StateCommitment) -> Option { + pub fn position( + &self, + commitment: note::StateCommitment, + ) -> Option { self.sct.witness(commitment).map(|proof| proof.position()) } diff --git a/crates/view/src/worker.rs b/crates/view/src/worker.rs index 103ce77cb5..9126773ef0 100644 --- a/crates/view/src/worker.rs +++ b/crates/view/src/worker.rs @@ -298,7 +298,9 @@ impl Worker { .update_position(position_id, position::State::Closed) .await?; } - penumbra_sdk_transaction::Action::PositionWithdraw(position_withdraw) => { + penumbra_sdk_transaction::Action::PositionWithdraw( + position_withdraw, + ) => { let position_id = position_withdraw.position_id; // Record the LPNFT for the current sequence number. From c46592e5821f84c1870897f059abcefb88f945e1 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 10:58:08 -0500 Subject: [PATCH 05/19] penumbra: fix link --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fa7144beea..e8eb1e6d5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,7 +105,7 @@ push = false authors = ["Penumbra Labs Date: Wed, 25 Dec 2024 10:58:53 -0500 Subject: [PATCH 06/19] ci: fix wasm script --- deployments/scripts/check-wasm-compat.sh | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/deployments/scripts/check-wasm-compat.sh b/deployments/scripts/check-wasm-compat.sh index 9e87e56da6..9d21ec28b8 100755 --- a/deployments/scripts/check-wasm-compat.sh +++ b/deployments/scripts/check-wasm-compat.sh @@ -17,23 +17,23 @@ set -euo pipefail # to make sure at least all of those crates are tracked here. packages=( - penumbra-asset - penumbra-community-pool - penumbra-compact-block - penumbra-auction - penumbra-dex - penumbra-distributions - penumbra-fee - penumbra-funding - penumbra-governance - penumbra-ibc - penumbra-keys - penumbra-sct - penumbra-shielded-pool - penumbra-stake - penumbra-tct - penumbra-transaction - penumbra-txhash + penumbra-sdk-asset + penumbra-sdk-community-pool + penumbra-sdk-compact-block + penumbra-sdk-auction + penumbra-sdk-dex + penumbra-sdk-distributions + penumbra-sdk-fee + penumbra-sdk-funding + penumbra-sdk-governance + penumbra-sdk-ibc + penumbra-sdk-keys + penumbra-sdk-sct + penumbra-sdk-shielded-pool + penumbra-sdk-stake + penumbra-sdk-tct + penumbra-sdk-transaction + penumbra-sdk-txhash # N.B. we can't include those ones because they rely on `getrandom`, # but there's a `js` feature... # decaf377-fmd From 929450b967212ba8552c189408a197df28862618 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:18:02 -0500 Subject: [PATCH 07/19] penumbra: fix incorrect replaces --- crates/bin/pcli/src/command/init.rs | 2 +- crates/bin/pcli/src/opt.rs | 2 +- crates/bin/pcli/tests/network_integration.rs | 2 +- .../bin/pclientd/tests/network_integration.rs | 4 +-- crates/bin/pd/src/cli.rs | 26 +++++++++---------- crates/bin/pd/tests/network_integration.rs | 6 ++--- .../app/src/action_handler/actions/submit.rs | 4 +-- crates/core/app/src/metrics.rs | 2 +- .../app/tests/app_blocktimes_increment.rs | 4 +-- ..._can_define_and_delegate_to_a_validator.rs | 4 +-- .../app_can_deposit_into_community_pool.rs | 4 +-- .../app_can_disable_community_pool_spends.rs | 2 +- .../app_can_propose_community_pool_spends.rs | 2 +- .../app_can_spend_notes_and_detect_outputs.rs | 4 +-- ...p_can_sweep_a_collection_of_small_notes.rs | 2 +- .../app_can_undelegate_from_a_validator.rs | 4 +-- crates/core/app/tests/app_check_dex_vcb.rs | 2 +- ...ator_definitions_with_invalid_auth_sigs.rs | 4 +-- .../app_reproduce_testnet_75_vcb_close.rs | 4 +-- ...me_for_genesis_validator_missing_blocks.rs | 4 +-- ...me_for_genesis_validator_signing_blocks.rs | 4 +-- ..._uptime_for_validators_only_once_active.rs | 4 +-- .../core/app/tests/common/ibc_tests/node.rs | 4 +-- .../core/app/tests/common/temp_storage_ext.rs | 4 +-- .../app/tests/common/test_node_builder_ext.rs | 6 ++--- .../app/tests/mock_consensus_block_proving.rs | 4 +-- ...onsensus_can_define_a_genesis_validator.rs | 4 +-- ...sus_can_send_a_sequence_of_empty_blocks.rs | 4 +-- crates/core/app/tests/spend.rs | 8 +++--- crates/core/app/tests/swap_and_swap_claim.rs | 6 ++--- .../view_server_can_be_served_on_localhost.rs | 4 +-- .../auction/src/component/metrics.rs | 2 +- .../core/component/governance/src/metrics.rs | 2 +- .../component/ibc/src/component/metrics.rs | 2 +- .../shielded-pool/src/component/metrics.rs | 2 +- crates/misc/measure/src/main.rs | 2 +- crates/view/src/metrics.rs | 2 +- 37 files changed, 76 insertions(+), 76 deletions(-) diff --git a/crates/bin/pcli/src/command/init.rs b/crates/bin/pcli/src/command/init.rs index 936a2d3788..51f74167c2 100644 --- a/crates/bin/pcli/src/command/init.rs +++ b/crates/bin/pcli/src/command/init.rs @@ -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, diff --git a/crates/bin/pcli/src/opt.rs b/crates/bin/pcli/src/opt.rs index 58bb27af36..0b88d6c6fa 100644 --- a/crates/bin/pcli/src/opt.rs +++ b/crates/bin/pcli/src/opt.rs @@ -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. /// diff --git a/crates/bin/pcli/tests/network_integration.rs b/crates/bin/pcli/tests/network_integration.rs index 128a06c128..d3549415f3 100644 --- a/crates/bin/pcli/tests/network_integration.rs +++ b/crates/bin/pcli/tests/network_integration.rs @@ -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 diff --git a/crates/bin/pclientd/tests/network_integration.rs b/crates/bin/pclientd/tests/network_integration.rs index c4a783096c..3b28ae141b 100644 --- a/crates/bin/pclientd/tests/network_integration.rs +++ b/crates/bin/pclientd/tests/network_integration.rs @@ -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 @@ -34,7 +34,7 @@ use penumbra_sdk_view::ViewClient; fn generate_config() -> anyhow::Result { 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()?, diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index 641117a245..d7ac2b2a1c 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -20,7 +20,7 @@ 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, /// Bind the ABCI server to this socket. /// @@ -28,7 +28,7 @@ pub enum RootCommand { #[clap( short, long, - env = "penumbra_sdk_PD_ABCI_BIND", + env = "PENUMBRA_PD_ABCI_BIND", default_value = "127.0.0.1:26658", display_order = 400 )] @@ -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, /// If set, serve gRPC using auto-managed HTTPS with this domain name. /// @@ -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 )] @@ -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. @@ -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")] @@ -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, /// If set, also migrate the CometBFT state located in this home directory. /// If both `--home` and `--comet-home` are unset, will attempt to migrate @@ -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, /// 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, /// Public URL to advertise for this node's Tendermint P2P service. /// Setting this option will instruct other nodes on the network to connect @@ -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, }, diff --git a/crates/bin/pd/tests/network_integration.rs b/crates/bin/pd/tests/network_integration.rs index c791ad6fe0..388c19caed 100644 --- a/crates/bin/pd/tests/network_integration.rs +++ b/crates/bin/pd/tests/network_integration.rs @@ -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!( @@ -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(()) @@ -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(); diff --git a/crates/core/app/src/action_handler/actions/submit.rs b/crates/core/app/src/action_handler/actions/submit.rs index 1fce55ead0..f6abb3b636 100644 --- a/crates/core/app/src/action_handler/actions/submit.rs +++ b/crates/core/app/src/action_handler/actions/submit.rs @@ -310,8 +310,8 @@ impl AppActionHandler for ProposalSubmit { /// hashes of two arbitrary strings. static COMMUNITY_POOL_FULL_VIEWING_KEY: Lazy = 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 = diff --git a/crates/core/app/src/metrics.rs b/crates/core/app/src/metrics.rs index a3d10728b6..ebe673927b 100644 --- a/crates/core/app/src/metrics.rs +++ b/crates/core/app/src/metrics.rs @@ -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"; diff --git a/crates/core/app/tests/app_blocktimes_increment.rs b/crates/core/app/tests/app_blocktimes_increment.rs index 268926d95e..35c8d112a7 100644 --- a/crates/core/app/tests/app_blocktimes_increment.rs +++ b/crates/core/app/tests/app_blocktimes_increment.rs @@ -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 @@ -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()) diff --git a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs index 4aa6971582..6e11d0bdd7 100644 --- a/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs +++ b/crates/core/app/tests/app_can_define_and_delegate_to_a_validator.rs @@ -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( @@ -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 }?; diff --git a/crates/core/app/tests/app_can_deposit_into_community_pool.rs b/crates/core/app/tests/app_can_deposit_into_community_pool.rs index a3df8ec73a..9994fc0269 100644 --- a/crates/core/app/tests/app_can_deposit_into_community_pool.rs +++ b/crates/core/app/tests/app_can_deposit_into_community_pool.rs @@ -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 = { @@ -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"))? diff --git a/crates/core/app/tests/app_can_disable_community_pool_spends.rs b/crates/core/app/tests/app_can_disable_community_pool_spends.rs index 9fd55f8df5..7379ce71a0 100644 --- a/crates/core/app/tests/app_can_disable_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_disable_community_pool_spends.rs @@ -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 }; diff --git a/crates/core/app/tests/app_can_propose_community_pool_spends.rs b/crates/core/app/tests/app_can_propose_community_pool_spends.rs index 2bbaa0d41c..e7f0db8b69 100644 --- a/crates/core/app/tests/app_can_propose_community_pool_spends.rs +++ b/crates/core/app/tests/app_can_propose_community_pool_spends.rs @@ -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 }; diff --git a/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs b/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs index c7490c2e9c..487227f974 100644 --- a/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs +++ b/crates/core/app/tests/app_can_spend_notes_and_detect_outputs.rs @@ -28,7 +28,7 @@ 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()), @@ -36,7 +36,7 @@ async fn app_can_spend_notes_and_detect_outputs() -> 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"))? diff --git a/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs b/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs index 272ce6bd63..a32fd032aa 100644 --- a/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs +++ b/crates/core/app/tests/app_can_sweep_a_collection_of_small_notes.rs @@ -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::(); diff --git a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs index 27b79aadad..739493bd9e 100644 --- a/crates/core/app/tests/app_can_undelegate_from_a_validator.rs +++ b/crates/core/app/tests/app_can_undelegate_from_a_validator.rs @@ -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 { @@ -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 }?; diff --git a/crates/core/app/tests/app_check_dex_vcb.rs b/crates/core/app/tests/app_check_dex_vcb.rs index 32fe84b610..5eece0d73b 100644 --- a/crates/core/app/tests/app_check_dex_vcb.rs +++ b/crates/core/app/tests/app_check_dex_vcb.rs @@ -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?; diff --git a/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs b/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs index 5a21812af9..d09178db42 100644 --- a/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs +++ b/crates/core/app/tests/app_rejects_validator_definitions_with_invalid_auth_sigs.rs @@ -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 = { @@ -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 }?; diff --git a/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs b/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs index 0f20fb5b5a..2262df1a15 100644 --- a/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs +++ b/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs @@ -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()), ); @@ -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 }?; diff --git a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs index 6a299409dc..6ed014bf77 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_missing_blocks.rs @@ -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 = { @@ -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 }?; diff --git a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs index de5f637c33..ee5ef2e29f 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_genesis_validator_signing_blocks.rs @@ -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 = { @@ -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 }?; diff --git a/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs b/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs index 6ed4cc4d34..85c3806bbd 100644 --- a/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs +++ b/crates/core/app/tests/app_tracks_uptime_for_validators_only_once_active.rs @@ -33,7 +33,7 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> 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( @@ -47,7 +47,7 @@ async fn app_tracks_uptime_for_validators_only_once_active() -> 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 }?; diff --git a/crates/core/app/tests/common/ibc_tests/node.rs b/crates/core/app/tests/common/ibc_tests/node.rs index 7ae02619d2..b1fdaecced 100644 --- a/crates/core/app/tests/common/ibc_tests/node.rs +++ b/crates/core/app/tests/common/ibc_tests/node.rs @@ -78,7 +78,7 @@ impl TestNodeWithIBC { ) -> Result { let chain_id = format!("{}-{}", TestNode::<()>::CHAIN_ID, suffix); // Use the correct substores - 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::(); @@ -90,7 +90,7 @@ impl TestNodeWithIBC { .with_keys(vec![keys]) .single_validator() .with_initial_timestamp(start_time) - .with_penumbra_sdk_auto_app_state(app_state)? + .with_penumbra_auto_app_state(app_state)? .on_block(proxy.on_block_callback()) .init_chain(consensus) .await diff --git a/crates/core/app/tests/common/temp_storage_ext.rs b/crates/core/app/tests/common/temp_storage_ext.rs index be1483313a..bc93e826d8 100644 --- a/crates/core/app/tests/common/temp_storage_ext.rs +++ b/crates/core/app/tests/common/temp_storage_ext.rs @@ -10,12 +10,12 @@ pub trait TempStorageExt: Sized { async fn apply_genesis(self, genesis: AppState) -> anyhow::Result; #[allow(dead_code)] async fn apply_default_genesis(self) -> anyhow::Result; - async fn new_with_penumbra_sdk_prefixes() -> anyhow::Result; + async fn new_with_penumbra_prefixes() -> anyhow::Result; } #[async_trait] impl TempStorageExt for TempStorage { - async fn new_with_penumbra_sdk_prefixes() -> anyhow::Result { + async fn new_with_penumbra_prefixes() -> anyhow::Result { TempStorage::new_with_prefixes(SUBSTORE_PREFIXES.to_vec()).await } diff --git a/crates/core/app/tests/common/test_node_builder_ext.rs b/crates/core/app/tests/common/test_node_builder_ext.rs index f2f9aa4f6b..51eaf19247 100644 --- a/crates/core/app/tests/common/test_node_builder_ext.rs +++ b/crates/core/app/tests/common/test_node_builder_ext.rs @@ -16,17 +16,17 @@ use { /// Penumbra-specific extensions to the mock consensus builder. pub trait BuilderExt: Sized { - /// The error thrown by [`with_penumbra_sdk_auto_app_state`] + /// The error thrown by [`with_penumbra_auto_app_state`] type Error; /// Add the provided Penumbra [`AppState`] to the builder. /// /// This will inject any configured validators into the state before serializing it into bytes. - fn with_penumbra_sdk_auto_app_state(self, app_state: AppState) -> Result; + fn with_penumbra_auto_app_state(self, app_state: AppState) -> Result; } impl BuilderExt for Builder { type Error = anyhow::Error; - fn with_penumbra_sdk_auto_app_state( + fn with_penumbra_auto_app_state( mut self, app_state: AppState, ) -> Result { diff --git a/crates/core/app/tests/mock_consensus_block_proving.rs b/crates/core/app/tests/mock_consensus_block_proving.rs index 3c58973c84..831117f368 100644 --- a/crates/core/app/tests/mock_consensus_block_proving.rs +++ b/crates/core/app/tests/mock_consensus_block_proving.rs @@ -48,7 +48,7 @@ async fn verify_storage_proof_simple() -> anyhow::Result<()> { // Install a test logger, and acquire some temporary storage. let guard = set_tracing_subscriber(); - let storage = TempStorage::new_with_penumbra_sdk_prefixes().await?; + let storage = TempStorage::new_with_penumbra_prefixes().await?; let start_time = tendermint::Time::parse_from_rfc3339("2022-02-11T17:30:50.425417198Z")?; @@ -61,7 +61,7 @@ async fn verify_storage_proof_simple() -> 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)? .on_block(proxy.on_block_callback()) .init_chain(consensus) .await diff --git a/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs b/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs index a3f40e26b3..7429e93438 100644 --- a/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs +++ b/crates/core/app/tests/mock_consensus_can_define_a_genesis_validator.rs @@ -20,7 +20,7 @@ mod common; async fn mock_consensus_can_define_a_genesis_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?; let test_node = { let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), @@ -28,7 +28,7 @@ async fn mock_consensus_can_define_a_genesis_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 .tap_ok(|e| tracing::info!(hash = %e.last_app_hash_hex(), "finished init chain"))? diff --git a/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs b/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs index 12e5c904d7..ac55d3bd3e 100644 --- a/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs +++ b/crates/core/app/tests/mock_consensus_can_send_a_sequence_of_empty_blocks.rs @@ -19,7 +19,7 @@ mod common; async fn mock_consensus_can_send_a_sequence_of_empty_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?; let mut test_node = { let app_state = AppState::Content( genesis::Content::default().with_chain_id(TestNode::<()>::CHAIN_ID.to_string()), @@ -27,7 +27,7 @@ async fn mock_consensus_can_send_a_sequence_of_empty_blocks() -> 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"))? diff --git a/crates/core/app/tests/spend.rs b/crates/core/app/tests/spend.rs index 890d799e1d..bbdba236a6 100644 --- a/crates/core/app/tests/spend.rs +++ b/crates/core/app/tests/spend.rs @@ -26,7 +26,7 @@ use tendermint::abci; async fn spend_happy_path() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await? .apply_default_genesis() .await?; @@ -105,7 +105,7 @@ async fn spend_happy_path() -> anyhow::Result<()> { async fn invalid_dummy_spend() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await .unwrap() .apply_default_genesis() @@ -206,7 +206,7 @@ async fn invalid_dummy_spend() { async fn spend_duplicate_nullifier_previous_transaction() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await .expect("can start new temp storage") .apply_default_genesis() @@ -297,7 +297,7 @@ async fn spend_duplicate_nullifier_previous_transaction() { async fn spend_duplicate_nullifier_same_transaction() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await .expect("can start new temp storage") .apply_default_genesis() diff --git a/crates/core/app/tests/swap_and_swap_claim.rs b/crates/core/app/tests/swap_and_swap_claim.rs index 56e571dc59..6d24d949bb 100644 --- a/crates/core/app/tests/swap_and_swap_claim.rs +++ b/crates/core/app/tests/swap_and_swap_claim.rs @@ -30,7 +30,7 @@ use tendermint::abci; async fn swap_and_swap_claim() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await? .apply_default_genesis() .await?; @@ -144,7 +144,7 @@ async fn swap_and_swap_claim() -> anyhow::Result<()> { async fn swap_claim_duplicate_nullifier_previous_transaction() { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await .unwrap() .apply_default_genesis() @@ -270,7 +270,7 @@ async fn swap_claim_duplicate_nullifier_previous_transaction() { async fn swap_with_nonzero_fee() -> anyhow::Result<()> { let mut rng = rand_chacha::ChaChaRng::seed_from_u64(1312); - let storage = TempStorage::new_with_penumbra_sdk_prefixes() + let storage = TempStorage::new_with_penumbra_prefixes() .await? .apply_default_genesis() .await?; diff --git a/crates/core/app/tests/view_server_can_be_served_on_localhost.rs b/crates/core/app/tests/view_server_can_be_served_on_localhost.rs index afbbbd394a..501f3bd2d8 100644 --- a/crates/core/app/tests/view_server_can_be_served_on_localhost.rs +++ b/crates/core/app/tests/view_server_can_be_served_on_localhost.rs @@ -31,7 +31,7 @@ mod common; async fn view_server_can_be_served_on_localhost() -> 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?; // Instantiate a mock tendermint proxy, which we will connect to the test node. let proxy = penumbra_sdk_mock_tendermint_proxy::TestNodeProxy::new::(); @@ -44,7 +44,7 @@ async fn view_server_can_be_served_on_localhost() -> 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)? .on_block(proxy.on_block_callback()) .init_chain(consensus) .await diff --git a/crates/core/component/auction/src/component/metrics.rs b/crates/core/component/auction/src/component/metrics.rs index bf7cc1df9f..3d73682b5f 100644 --- a/crates/core/component/auction/src/component/metrics.rs +++ b/crates/core/component/auction/src/component/metrics.rs @@ -22,4 +22,4 @@ pub fn register_metrics() { // ); } -// pub const SOMETHING_TO_MEASURE: &str = "penumbra_sdk_auction_something_to_measure"; +// pub const SOMETHING_TO_MEASURE: &str = "penumbra_auction_something_to_measure"; diff --git a/crates/core/component/governance/src/metrics.rs b/crates/core/component/governance/src/metrics.rs index aff73c3131..668c4d13b5 100644 --- a/crates/core/component/governance/src/metrics.rs +++ b/crates/core/component/governance/src/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; diff --git a/crates/core/component/ibc/src/component/metrics.rs b/crates/core/component/ibc/src/component/metrics.rs index aff73c3131..668c4d13b5 100644 --- a/crates/core/component/ibc/src/component/metrics.rs +++ b/crates/core/component/ibc/src/component/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; diff --git a/crates/core/component/shielded-pool/src/component/metrics.rs b/crates/core/component/shielded-pool/src/component/metrics.rs index aff73c3131..668c4d13b5 100644 --- a/crates/core/component/shielded-pool/src/component/metrics.rs +++ b/crates/core/component/shielded-pool/src/component/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; diff --git a/crates/misc/measure/src/main.rs b/crates/misc/measure/src/main.rs index 462f7856e6..c7a24ae615 100644 --- a/crates/misc/measure/src/main.rs +++ b/crates/misc/measure/src/main.rs @@ -39,7 +39,7 @@ pub struct Opt { #[clap( short, long, - env = "penumbra_sdk_NODE_PD_URL", + env = "PENUMBRA_NODE_PD_URL", parse(try_from_str = url::Url::parse) )] node: Url, diff --git a/crates/view/src/metrics.rs b/crates/view/src/metrics.rs index aff73c3131..668c4d13b5 100644 --- a/crates/view/src/metrics.rs +++ b/crates/view/src/metrics.rs @@ -27,4 +27,4 @@ pub fn register_metrics() { } // Sample code for reference -- delete when adding the first metric -// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_sdk_pd_mempool_checktx_total"; +// pub const MEMPOOL_CHECKTX_TOTAL: &str = "penumbra_pd_mempool_checktx_total"; From 60d6dd0276b6b1175376f62f4335517ed8924dfc Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:22:09 -0500 Subject: [PATCH 08/19] ci: fix rust-docs paths --- deployments/scripts/rust-docs | 52 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/deployments/scripts/rust-docs b/deployments/scripts/rust-docs index 571418bb2f..39b3009f4c 100755 --- a/deployments/scripts/rust-docs +++ b/deployments/scripts/rust-docs @@ -32,32 +32,32 @@ cargo +nightly doc --no-deps \ -p pclientd \ -p pd \ -p pmonitor \ - -p penumbra-app \ - -p penumbra-asset \ - -p penumbra-community-pool \ - -p penumbra-custody \ - -p penumbra-dex \ - -p penumbra-distributions \ - -p penumbra-fee \ - -p penumbra-governance \ - -p penumbra-ibc \ - -p penumbra-keys \ - -p penumbra-measure \ - -p penumbra-mock-consensus \ - -p penumbra-mock-tendermint-proxy \ - -p penumbra-mock-client \ - -p penumbra-num \ - -p penumbra-proof-params \ - -p penumbra-proof-setup \ - -p penumbra-proto \ - -p penumbra-sct \ - -p penumbra-shielded-pool \ - -p penumbra-stake \ - -p penumbra-tct \ - -p penumbra-transaction \ - -p penumbra-txhash \ - -p penumbra-view \ - -p penumbra-wallet \ + -p penumbra-sdk-app \ + -p penumbra-sdk-asset \ + -p penumbra-sdk-community-pool \ + -p penumbra-sdk-custody \ + -p penumbra-sdk-dex \ + -p penumbra-sdk-distributions \ + -p penumbra-sdk-fee \ + -p penumbra-sdk-governance \ + -p penumbra-sdk-ibc \ + -p penumbra-sdk-keys \ + -p penumbra-sdk-measure \ + -p penumbra-sdk-mock-consensus \ + -p penumbra-sdk-mock-tendermint-proxy \ + -p penumbra-sdk-mock-client \ + -p penumbra-sdk-num \ + -p penumbra-sdk-proof-params \ + -p penumbra-sdk-proof-setup \ + -p penumbra-sdk-proto \ + -p penumbra-sdk-sct \ + -p penumbra-sdk-shielded-pool \ + -p penumbra-sdk-stake \ + -p penumbra-sdk-tct \ + -p penumbra-sdk-transaction \ + -p penumbra-sdk-txhash \ + -p penumbra-sdk-view \ + -p penumbra-sdk-wallet \ -p poseidon-permutation \ -p poseidon377 \ -p tendermint \ From 96636c2d7b29ec1fbd41f4fdbace0d0be9713da9 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:29:17 -0500 Subject: [PATCH 09/19] penumbra: fix extra replaces and run `fmt` --- crates/bin/pd/src/cli.rs | 12 ++---------- crates/bin/pindexer/src/indexer_ext.rs | 4 ++-- crates/bin/pindexer/src/main.rs | 2 +- .../core/app/tests/common/test_node_builder_ext.rs | 5 +---- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index d7ac2b2a1c..e2af67d2bc 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -236,18 +236,10 @@ pub enum NetworkCommand { #[clap(long, env = "penumbra_sdk_PD_TM_EXTERNAL_ADDR")] external_address: Option, /// When generating Tendermint config, use this socket to bind the Tendermint RPC service. - #[clap( - long, - env = "PENUMBRA_PD_TM_RPC_BIND", - default_value = "0.0.0.0:26657" - )] + #[clap(long, 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_PD_TM_P2P_BIND", - default_value = "0.0.0.0:26656" - )] + #[clap(long, 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_PD_LEAVE_ARCHIVE", action)] diff --git a/crates/bin/pindexer/src/indexer_ext.rs b/crates/bin/pindexer/src/indexer_ext.rs index 08c6ab175a..fbd284fb9f 100644 --- a/crates/bin/pindexer/src/indexer_ext.rs +++ b/crates/bin/pindexer/src/indexer_ext.rs @@ -1,11 +1,11 @@ use std::str::FromStr; pub trait IndexerExt: Sized { - fn with_default_penumbra_sdk_app_views(self) -> Self; + fn with_default_penumbra_app_views(self) -> Self; } impl IndexerExt for cometindex::Indexer { - fn with_default_penumbra_sdk_app_views(self) -> Self { + fn with_default_penumbra_app_views(self) -> Self { self.with_index(Box::new(crate::block::Block {})) .with_index(Box::new(crate::stake::ValidatorSet {})) .with_index(Box::new(crate::stake::Slashings {})) diff --git a/crates/bin/pindexer/src/main.rs b/crates/bin/pindexer/src/main.rs index df39fe052b..fee7ab0f90 100644 --- a/crates/bin/pindexer/src/main.rs +++ b/crates/bin/pindexer/src/main.rs @@ -6,7 +6,7 @@ use pindexer::{Indexer, IndexerExt as _, Options}; async fn main() -> Result<()> { Indexer::new(Options::parse()) .with_default_tracing() - .with_default_penumbra_sdk_app_views() + .with_default_penumbra_app_views() .run() .await?; diff --git a/crates/core/app/tests/common/test_node_builder_ext.rs b/crates/core/app/tests/common/test_node_builder_ext.rs index 51eaf19247..f44619f5e2 100644 --- a/crates/core/app/tests/common/test_node_builder_ext.rs +++ b/crates/core/app/tests/common/test_node_builder_ext.rs @@ -26,10 +26,7 @@ pub trait BuilderExt: Sized { impl BuilderExt for Builder { type Error = anyhow::Error; - fn with_penumbra_auto_app_state( - mut self, - app_state: AppState, - ) -> Result { + fn with_penumbra_auto_app_state(mut self, app_state: AppState) -> Result { let Self { keyring, .. } = &self; let mut content = match app_state { AppState::Content(c) => c, From 04d7331cee46ff5fd26fe691e7baaa44d9fe5f62 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:43:36 -0500 Subject: [PATCH 10/19] penumbra: fix all strings `_sdk` --- crates/bin/pclientd/src/lib.rs | 2 +- crates/bin/pd/src/cli.rs | 2 +- crates/bin/pmonitor/src/main.rs | 2 +- .../app/tests/app_reproduce_testnet_75_vcb_close.rs | 4 ++-- crates/core/asset/src/asset/denom_metadata.rs | 2 +- crates/core/asset/src/asset/id.rs | 2 +- crates/core/component/auction/src/auction/dutch.rs | 2 +- crates/core/component/dex/src/component/metrics.rs | 12 ++++++------ crates/core/component/dex/src/lp/position.rs | 2 +- .../core/component/funding/src/component/metrics.rs | 8 ++++---- crates/core/component/ibc/src/component/client.rs | 8 ++++---- crates/core/component/stake/src/component/metrics.rs | 2 +- crates/core/keys/src/keys/diversifier.rs | 2 +- crates/core/keys/src/symmetric.rs | 8 ++++---- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/crates/bin/pclientd/src/lib.rs b/crates/bin/pclientd/src/lib.rs index c63212dae5..eaad5cdcf5 100644 --- a/crates/bin/pclientd/src/lib.rs +++ b/crates/bin/pclientd/src/lib.rs @@ -81,7 +81,7 @@ pub struct Opt { #[clap(subcommand)] pub cmd: Command, /// The path used to store pclientd state and config files. - #[clap(long, default_value_t = default_home(), env = "penumbra_sdk_PCLIENTD_HOME")] + #[clap(long, default_value_t = default_home(), env = "PENUMBRA_PCLIENTD_HOME")] pub home: Utf8PathBuf, } diff --git a/crates/bin/pd/src/cli.rs b/crates/bin/pd/src/cli.rs index e2af67d2bc..52e3b1d0d9 100644 --- a/crates/bin/pd/src/cli.rs +++ b/crates/bin/pd/src/cli.rs @@ -233,7 +233,7 @@ pub enum NetworkCommand { /// Public URL to advertise for this node's Tendermint P2P service. /// Setting this option will instruct other nodes on the network to connect /// to yours. Must be in the form of a socket, e.g. "1.2.3.4:26656". - #[clap(long, env = "penumbra_sdk_PD_TM_EXTERNAL_ADDR")] + #[clap(long, env = "PENUMBRA_PD_TM_EXTERNAL_ADDR")] external_address: Option, /// When generating Tendermint config, use this socket to bind the Tendermint RPC service. #[clap(long, env = "PENUMBRA_PD_TM_RPC_BIND", default_value = "0.0.0.0:26657")] diff --git a/crates/bin/pmonitor/src/main.rs b/crates/bin/pmonitor/src/main.rs index 88384961c4..ad4d3e735f 100644 --- a/crates/bin/pmonitor/src/main.rs +++ b/crates/bin/pmonitor/src/main.rs @@ -112,7 +112,7 @@ pub struct Opt { #[clap(subcommand)] pub cmd: Command, /// The path used to store pmonitor state. - #[clap(long, default_value_t = default_home(), env = "penumbra_sdk_PMONITOR_HOME")] + #[clap(long, default_value_t = default_home(), env = "PENUMBRA_PMONITOR_HOME")] pub home: Utf8PathBuf, } diff --git a/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs b/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs index 2262df1a15..011b46e150 100644 --- a/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs +++ b/crates/core/app/tests/app_reproduce_testnet_75_vcb_close.rs @@ -54,12 +54,12 @@ async fn app_can_reproduce_tesnet_75_vcb_close() -> anyhow::Result<()> { let guard = { let filter = EnvFilter::default() .add_directive( - "penumbra_sdk_auction=trace" + "penumbra_auction=trace" .parse() .expect("we only write valid code :)"), ) .add_directive( - "penumbra_sdk_dex=debug" + "penumbra_dex=debug" .parse() .expect("we only write valid code :)"), ); diff --git a/crates/core/asset/src/asset/denom_metadata.rs b/crates/core/asset/src/asset/denom_metadata.rs index 7e11128c4a..78af88ae88 100644 --- a/crates/core/asset/src/asset/denom_metadata.rs +++ b/crates/core/asset/src/asset/denom_metadata.rs @@ -225,7 +225,7 @@ impl Inner { let id = Id(Fq::from_le_bytes_mod_order( // XXX choice of hash function? blake2b_simd::Params::default() - .personal(b"penumbra_sdk_AssetID") + .personal(b"Penumbra_AssetID") .hash(base_denom.as_bytes()) .as_bytes(), )); diff --git a/crates/core/asset/src/asset/id.rs b/crates/core/asset/src/asset/id.rs index 09d8f9c09d..c073660b92 100644 --- a/crates/core/asset/src/asset/id.rs +++ b/crates/core/asset/src/asset/id.rs @@ -158,7 +158,7 @@ impl Id { Id(Fq::from_le_bytes_mod_order( // XXX choice of hash function? blake2b_simd::Params::default() - .personal(b"penumbra_sdk_AssetID") + .personal(b"Penumbra_AssetID") .hash(base_denom.as_bytes()) .as_bytes(), )) diff --git a/crates/core/component/auction/src/auction/dutch.rs b/crates/core/component/auction/src/auction/dutch.rs index c0cbd70e75..bd82262d3f 100644 --- a/crates/core/component/auction/src/auction/dutch.rs +++ b/crates/core/component/auction/src/auction/dutch.rs @@ -12,7 +12,7 @@ use crate::auction::AuctionId; pub mod actions; pub use actions::{ActionDutchAuctionEnd, ActionDutchAuctionSchedule, ActionDutchAuctionWithdraw}; -pub const DUTCH_AUCTION_DOMAIN_SEP: &[u8] = b"penumbra_sdk_DA_nft"; +pub const DUTCH_AUCTION_DOMAIN_SEP: &[u8] = b"penumbra_DA_nft"; /// A deployed Dutch Auction, containing an immutable description /// and stateful data about its current state. diff --git a/crates/core/component/dex/src/component/metrics.rs b/crates/core/component/dex/src/component/metrics.rs index 615468d20d..c894307077 100644 --- a/crates/core/component/dex/src/component/metrics.rs +++ b/crates/core/component/dex/src/component/metrics.rs @@ -70,14 +70,14 @@ const GENERIC_DEX_BUCKETS: &[f64; 16] = &[ 0.06786044041, ]; -pub const DEX_PATH_SEARCH_DURATION: &str = "penumbra_sdk_dex_path_search_duration_seconds"; +pub const DEX_PATH_SEARCH_DURATION: &str = "penumbra_dex_path_search_duration_seconds"; pub const DEX_PATH_SEARCH_RELAX_PATH_DURATION: &str = - "penumbra_sdk_dex_path_search_relax_path_duration_seconds"; -pub const DEX_ROUTE_FILL_DURATION: &str = "penumbra_sdk_dex_route_fill_duration_seconds"; -pub const DEX_ARB_DURATION: &str = "penumbra_sdk_dex_arb_duration_seconds"; -pub const DEX_BATCH_DURATION: &str = "penumbra_sdk_dex_batch_duration_seconds"; + "penumbra_dex_path_search_relax_path_duration_seconds"; +pub const DEX_ROUTE_FILL_DURATION: &str = "penumbra_dex_route_fill_duration_seconds"; +pub const DEX_ARB_DURATION: &str = "penumbra_dex_arb_duration_seconds"; +pub const DEX_BATCH_DURATION: &str = "penumbra_dex_batch_duration_seconds"; pub const DEX_RPC_SIMULATE_TRADE_DURATION: &str = - "penumbra_sdk_dex_rpc_simulate_trade_duration_seconds"; + "penumbra_dex_rpc_simulate_trade_duration_seconds"; /// An extension trait providing DEX-related interfaces for [`PrometheusBuilder`]. /// diff --git a/crates/core/component/dex/src/lp/position.rs b/crates/core/component/dex/src/lp/position.rs index a551dad6e4..1c05923053 100644 --- a/crates/core/component/dex/src/lp/position.rs +++ b/crates/core/component/dex/src/lp/position.rs @@ -144,7 +144,7 @@ impl Position { /// Get the ID of this position. pub fn id(&self) -> Id { let mut state = blake2b_simd::Params::default() - .personal(b"penumbra_sdk_lp_id") + .personal(b"penumbra_lp_id") .to_state(); state.update(&self.nonce); diff --git a/crates/core/component/funding/src/component/metrics.rs b/crates/core/component/funding/src/component/metrics.rs index 8adafcc9ce..296c7f1763 100644 --- a/crates/core/component/funding/src/component/metrics.rs +++ b/crates/core/component/funding/src/component/metrics.rs @@ -41,10 +41,10 @@ pub fn register_metrics() { } pub const TOTAL_VALIDATOR_REWARDS: &str = - "penumbra_sdk_funding_total_validator_rewards_staking_token"; + "penumbra_funding_total_validator_rewards_staking_token"; pub const VALIDATOR_FUNDING_VS_BUDGET_DIFFERENCE: &str = - "penumbra_sdk_funding_validator_vs_budget_difference_staking_token"; + "penumbra_funding_validator_vs_budget_difference_staking_token"; pub const FETCH_FUNDING_QUEUE_LATENCY: &str = - "penumbra_sdk_funding_fetch_funding_queue_latency_milliseconds"; + "penumbra_funding_fetch_funding_queue_latency_milliseconds"; pub const TOTAL_FUNDING_STREAMS_PROCESSING_TIME: &str = - "penumbra_sdk_funding_streams_total_processing_time_milliseconds"; + "penumbra_funding_streams_total_processing_time_milliseconds"; diff --git a/crates/core/component/ibc/src/component/client.rs b/crates/core/component/ibc/src/component/client.rs index a21347e89f..e98da4388e 100644 --- a/crates/core/component/ibc/src/component/client.rs +++ b/crates/core/component/ibc/src/component/client.rs @@ -216,7 +216,7 @@ pub trait StateWriteExt: StateWrite + StateReadExt { format!( // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. - "penumbra_sdk_verified_heights/{client_id}/verified_heights" + "penumbra_verified_heights/{client_id}/verified_heights" ), verified_heights, ); @@ -231,7 +231,7 @@ pub trait StateWriteExt: StateWrite + StateReadExt { // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. self.put( - format!("penumbra_sdk_consensus_states/{height}"), + format!("penumbra_consensus_states/{height}"), consensus_state, ); } @@ -324,7 +324,7 @@ pub trait StateReadExt: StateRead { self.get(&format!( // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. - "penumbra_sdk_verified_heights/{client_id}/verified_heights" + "penumbra_verified_heights/{client_id}/verified_heights" )) .await } @@ -336,7 +336,7 @@ pub trait StateReadExt: StateRead { ) -> Result { // NOTE: this is an implementation detail of the Penumbra ICS2 implementation, so // it's not in the same path namespace. - self.get(&format!("penumbra_sdk_consensus_states/{height}")) + self.get(&format!("penumbra_consensus_states/{height}")) .await? .ok_or_else(|| { anyhow::anyhow!("penumbra consensus state not found for height {height}") diff --git a/crates/core/component/stake/src/component/metrics.rs b/crates/core/component/stake/src/component/metrics.rs index d45538d5f5..7939be0f6d 100644 --- a/crates/core/component/stake/src/component/metrics.rs +++ b/crates/core/component/stake/src/component/metrics.rs @@ -22,4 +22,4 @@ pub fn register_metrics() { ); } -pub const MISSED_BLOCKS: &str = "penumbra_sdk_stake_missed_blocks"; +pub const MISSED_BLOCKS: &str = "penumbra_stake_missed_blocks"; diff --git a/crates/core/keys/src/keys/diversifier.rs b/crates/core/keys/src/keys/diversifier.rs index 8777a0d8ce..41dc7fa6cf 100644 --- a/crates/core/keys/src/keys/diversifier.rs +++ b/crates/core/keys/src/keys/diversifier.rs @@ -26,7 +26,7 @@ impl Diversifier { /// Generate the diversified basepoint associated to this diversifier. pub fn diversified_generator(&self) -> decaf377::Element { let hash = blake2b_simd::Params::new() - .personal(b"penumbra_sdk_Divrsfy") + .personal(b"Penumbra_Divrsfy") .hash(&self.0); decaf377::Element::encode_to_curve(&Fq::from_le_bytes_mod_order(hash.as_bytes())) diff --git a/crates/core/keys/src/symmetric.rs b/crates/core/keys/src/symmetric.rs index d6549eeded..f4aaa4e2d9 100644 --- a/crates/core/keys/src/symmetric.rs +++ b/crates/core/keys/src/symmetric.rs @@ -47,7 +47,7 @@ impl PayloadKey { /// Use Blake2b-256 to derive a `PayloadKey`. pub fn derive(shared_secret: &ka::SharedSecret, epk: &ka::Public) -> Self { let mut kdf_params = blake2b_simd::Params::new(); - kdf_params.personal(b"penumbra_sdk_Payload"); + kdf_params.personal(b"Penumbra_Payload"); kdf_params.hash_length(32); let mut kdf = kdf_params.to_state(); kdf.update(&shared_secret.0); @@ -96,7 +96,7 @@ impl PayloadKey { let cm_bytes: [u8; 32] = cm.into(); let mut kdf_params = blake2b_simd::Params::new(); - kdf_params.personal(b"penumbra_sdk_Payswap"); + kdf_params.personal(b"Penumbra_Payswap"); kdf_params.hash_length(32); let mut kdf = kdf_params.to_state(); kdf.update(&ovk.to_bytes()); @@ -189,7 +189,7 @@ impl OutgoingCipherKey { let mut kdf_params = blake2b_simd::Params::new(); kdf_params.hash_length(32); - kdf_params.personal(b"penumbra_sdk_OutCiph"); + kdf_params.personal(b"Penumbra_OutCiph"); let mut kdf = kdf_params.to_state(); kdf.update(&ovk.to_bytes()); kdf.update(&cv_bytes); @@ -351,7 +351,7 @@ pub struct BackreferenceKey(pub Key); impl BackreferenceKey { pub fn derive(ovk: &OutgoingViewingKey) -> Self { let mut kdf_params = blake2b_simd::Params::new(); - kdf_params.personal(b"penumbra_sdk_Backref"); + kdf_params.personal(b"Penumbra_Backref"); kdf_params.hash_length(32); let mut kdf = kdf_params.to_state(); kdf.update(&ovk.to_bytes()); From 2450c189f3c228eccbedd39db4da0ee0161940ba Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:46:04 -0500 Subject: [PATCH 11/19] proto-compiler: remove `cnidarium` proto building --- tools/proto-compiler/src/main.rs | 46 -------------------------------- 1 file changed, 46 deletions(-) diff --git a/tools/proto-compiler/src/main.rs b/tools/proto-compiler/src/main.rs index bd47d9c029..54f3d49547 100644 --- a/tools/proto-compiler/src/main.rs +++ b/tools/proto-compiler/src/main.rs @@ -4,13 +4,6 @@ fn main() -> anyhow::Result<()> { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); println!("root: {}", root.display()); - // We build the proto files for the main penumbra_sdk_proto crate - // and for the cnidarium crate separately, because the - // cnidarium crate is supposed to be independent of the - // rest of the Penumbra codebase and its proto structures. - // Unfortunately, this means duplicating a lot of logic, because - // we can't share the prost_build::Config between the two. - let target_dir = root .join("..") .join("..") @@ -18,16 +11,8 @@ fn main() -> anyhow::Result<()> { .join("proto") .join("src") .join("gen"); - let cnidarium_target_dir = root - .join("..") - .join("..") - .join("crates") - .join("cnidarium") - .join("src") - .join("gen"); println!("target_dir: {}", target_dir.display()); - println!("cnidarium_target_dir: {}", cnidarium_target_dir.display()); // https://github.com/penumbra-zone/penumbra/issues/3038#issuecomment-1722534133 // Using the "no_lfs" suffix prevents matching a catch-all LFS rule. @@ -35,7 +20,6 @@ fn main() -> anyhow::Result<()> { // prost_build::Config isn't Clone, so we need to make two. let mut config = prost_build::Config::new(); - let mut cnidarium_config = prost_build::Config::new(); config.compile_well_known_types(); // As recommended in pbjson_types docs. @@ -48,34 +32,13 @@ fn main() -> anyhow::Result<()> { config.extern_path(".ics23", "::ics23"); config.extern_path(".cosmos.ics23", "::ics23"); - cnidarium_config.compile_well_known_types(); - cnidarium_config.extern_path(".google.protobuf", "::pbjson_types"); - cnidarium_config.extern_path(".ibc", "::ibc_proto::ibc"); - cnidarium_config.extern_path(".ics23", "::ics23"); - cnidarium_config.extern_path(".cosmos.ics23", "::ics23"); - config .out_dir(&target_dir) .file_descriptor_set_path(&target_dir.join(descriptor_file_name)) .enable_type_names(); - cnidarium_config - .out_dir(&cnidarium_target_dir) - .file_descriptor_set_path(&cnidarium_target_dir.join(descriptor_file_name)) - .enable_type_names(); let rpc_doc_attr = r#"#[cfg(feature = "rpc")]"#; - tonic_build::configure() - .out_dir(&cnidarium_target_dir) - .emit_rerun_if_changed(false) - .server_mod_attribute(".", rpc_doc_attr) - .client_mod_attribute(".", rpc_doc_attr) - .compile_protos_with_config( - cnidarium_config, - &["../../proto/penumbra/penumbra/cnidarium/v1/cnidarium.proto"], - &["../../proto/penumbra/", "../../proto/rust-vendored/"], - )?; - tonic_build::configure() .out_dir(&target_dir) .emit_rerun_if_changed(false) @@ -111,8 +74,6 @@ fn main() -> anyhow::Result<()> { "../../proto/penumbra/penumbra/crypto/tct/v1/tct.proto", "../../proto/penumbra/penumbra/custody/v1/custody.proto", "../../proto/penumbra/penumbra/custody/threshold/v1/threshold.proto", - // Also included in the cnidarium crate directly. - "../../proto/penumbra/penumbra/cnidarium/v1/cnidarium.proto", "../../proto/penumbra/penumbra/tools/summoning/v1/summoning.proto", "../../proto/penumbra/penumbra/util/tendermint_proxy/v1/tendermint_proxy.proto", "../../proto/penumbra/penumbra/view/v1/view.proto", @@ -141,13 +102,6 @@ fn main() -> anyhow::Result<()> { // Finally, build pbjson Serialize, Deserialize impls: let descriptor_set = std::fs::read(target_dir.join(descriptor_file_name))?; - let cnidarium_descriptor_set = std::fs::read(cnidarium_target_dir.join(descriptor_file_name))?; - - pbjson_build::Builder::new() - .register_descriptors(&cnidarium_descriptor_set)? - .ignore_unknown_fields() - .out_dir(&cnidarium_target_dir) - .build(&[".penumbra"])?; pbjson_build::Builder::new() .register_descriptors(&descriptor_set)? From 92bab80f57b2649ef4c0e37daa5da5b9d770fada Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:46:10 -0500 Subject: [PATCH 12/19] penumbra: regenerate protos --- crates/proto/src/gen/penumbra.cnidarium.v1.rs | 833 ---------- .../src/gen/penumbra.cnidarium.v1.serde.rs | 1441 ----------------- .../proto/src/gen/penumbra.core.asset.v1.rs | 2 +- .../src/gen/penumbra.core.asset.v1.serde.rs | 16 +- .../proto/src/gen/proto_descriptor.bin.no_lfs | Bin 630017 -> 624303 bytes 5 files changed, 9 insertions(+), 2283 deletions(-) delete mode 100644 crates/proto/src/gen/penumbra.cnidarium.v1.rs delete mode 100644 crates/proto/src/gen/penumbra.cnidarium.v1.serde.rs diff --git a/crates/proto/src/gen/penumbra.cnidarium.v1.rs b/crates/proto/src/gen/penumbra.cnidarium.v1.rs deleted file mode 100644 index 858be10601..0000000000 --- a/crates/proto/src/gen/penumbra.cnidarium.v1.rs +++ /dev/null @@ -1,833 +0,0 @@ -// This file is @generated by prost-build. -/// Performs a key-value query against the nonverifiable storage, -/// using a byte-encoded key. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NonVerifiableKeyValueRequest { - #[prost(message, optional, tag = "1")] - pub key: ::core::option::Option, -} -/// Nested message and enum types in `NonVerifiableKeyValueRequest`. -pub mod non_verifiable_key_value_request { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Key { - #[prost(bytes = "vec", tag = "1")] - pub inner: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Key { - const NAME: &'static str = "Key"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key".into() - } - } -} -impl ::prost::Name for NonVerifiableKeyValueRequest { - const NAME: &'static str = "NonVerifiableKeyValueRequest"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.NonVerifiableKeyValueRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.NonVerifiableKeyValueRequest".into() - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NonVerifiableKeyValueResponse { - /// The value corresponding to the specified key, if it was found. - #[prost(message, optional, tag = "1")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `NonVerifiableKeyValueResponse`. -pub mod non_verifiable_key_value_response { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Value { - #[prost(bytes = "vec", tag = "1")] - pub value: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Value { - const NAME: &'static str = "Value"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value".into() - } - } -} -impl ::prost::Name for NonVerifiableKeyValueResponse { - const NAME: &'static str = "NonVerifiableKeyValueResponse"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.NonVerifiableKeyValueResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.NonVerifiableKeyValueResponse".into() - } -} -/// Performs a key-value query against the JMT, either by key or by key hash. -/// -/// Proofs are only supported by key. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct KeyValueRequest { - /// If set, the key to fetch from storage. - #[prost(string, tag = "2")] - pub key: ::prost::alloc::string::String, - /// whether to return a proof - #[prost(bool, tag = "3")] - pub proof: bool, -} -impl ::prost::Name for KeyValueRequest { - const NAME: &'static str = "KeyValueRequest"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.KeyValueRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.KeyValueRequest".into() - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct KeyValueResponse { - /// The value corresponding to the specified key, if it was found. - #[prost(message, optional, tag = "1")] - pub value: ::core::option::Option, - /// A proof of existence or non-existence. - #[prost(message, optional, tag = "2")] - pub proof: ::core::option::Option< - ::ibc_proto::ibc::core::commitment::v1::MerkleProof, - >, -} -/// Nested message and enum types in `KeyValueResponse`. -pub mod key_value_response { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Value { - #[prost(bytes = "vec", tag = "1")] - pub value: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Value { - const NAME: &'static str = "Value"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.KeyValueResponse.Value".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.KeyValueResponse.Value".into() - } - } -} -impl ::prost::Name for KeyValueResponse { - const NAME: &'static str = "KeyValueResponse"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.KeyValueResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.KeyValueResponse".into() - } -} -/// Performs a prefixed key-value query, by string prefix. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PrefixValueRequest { - /// The prefix to fetch subkeys from storage. - #[prost(string, tag = "2")] - pub prefix: ::prost::alloc::string::String, -} -impl ::prost::Name for PrefixValueRequest { - const NAME: &'static str = "PrefixValueRequest"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.PrefixValueRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.PrefixValueRequest".into() - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PrefixValueResponse { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for PrefixValueResponse { - const NAME: &'static str = "PrefixValueResponse"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.PrefixValueResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.PrefixValueResponse".into() - } -} -/// Requests a stream of new key-value pairs that have been committed to the state. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WatchRequest { - /// A regex for keys in the verifiable storage. - /// - /// Only key-value updates whose keys match this regex will be returned. - /// Note that the empty string matches all keys. - /// To exclude all keys, use the regex "$^", which matches no strings. - #[prost(string, tag = "1")] - pub key_regex: ::prost::alloc::string::String, - /// A regex for keys in the nonverifiable storage. - /// - /// Only key-value updates whose keys match this regex will be returned. - /// Note that the empty string matches all keys. - /// To exclude all keys, use the regex "$^", which matches no strings. - #[prost(string, tag = "2")] - pub nv_key_regex: ::prost::alloc::string::String, -} -impl ::prost::Name for WatchRequest { - const NAME: &'static str = "WatchRequest"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.WatchRequest".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.WatchRequest".into() - } -} -/// A key-value pair that has been committed to the state. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WatchResponse { - /// The state version the key-value pair was committed at. - #[prost(uint64, tag = "1")] - pub version: u64, - /// The entry that was committed. - #[prost(oneof = "watch_response::Entry", tags = "5, 6")] - pub entry: ::core::option::Option, -} -/// Nested message and enum types in `WatchResponse`. -pub mod watch_response { - /// Elements of the verifiable storage have string keys. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct KeyValue { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - /// If set to true, the key-value pair was deleted. - /// This allows distinguishing a deleted key-value pair from a key-value pair whose value is empty. - #[prost(bool, tag = "3")] - pub deleted: bool, - } - impl ::prost::Name for KeyValue { - const NAME: &'static str = "KeyValue"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.WatchResponse.KeyValue".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.WatchResponse.KeyValue".into() - } - } - /// Elements of the nonverifiable storage have byte keys. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct NvKeyValue { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - /// If set to true, the key-value pair was deleted. - /// This allows distinguishing a deleted key-value pair from a key-value pair whose value is empty. - #[prost(bool, tag = "3")] - pub deleted: bool, - } - impl ::prost::Name for NvKeyValue { - const NAME: &'static str = "NvKeyValue"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.WatchResponse.NvKeyValue".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.WatchResponse.NvKeyValue".into() - } - } - /// The entry that was committed. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Entry { - #[prost(message, tag = "5")] - Kv(KeyValue), - #[prost(message, tag = "6")] - NvKv(NvKeyValue), - } -} -impl ::prost::Name for WatchResponse { - const NAME: &'static str = "WatchResponse"; - const PACKAGE: &'static str = "penumbra.cnidarium.v1"; - fn full_name() -> ::prost::alloc::string::String { - "penumbra.cnidarium.v1.WatchResponse".into() - } - fn type_url() -> ::prost::alloc::string::String { - "/penumbra.cnidarium.v1.WatchResponse".into() - } -} -/// Generated client implementations. -#[cfg(feature = "rpc")] -pub mod query_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct QueryServiceClient { - inner: tonic::client::Grpc, - } - impl QueryServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - QueryServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// General-purpose key-value state query API, that can be used to query - /// arbitrary keys in the JMT storage. - pub async fn key_value( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/penumbra.cnidarium.v1.QueryService/KeyValue", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("penumbra.cnidarium.v1.QueryService", "KeyValue"), - ); - self.inner.unary(req, path, codec).await - } - /// General-purpose key-value state query API, that can be used to query - /// arbitrary keys in the non-verifiable storage. - pub async fn non_verifiable_key_value( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/penumbra.cnidarium.v1.QueryService/NonVerifiableKeyValue", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "penumbra.cnidarium.v1.QueryService", - "NonVerifiableKeyValue", - ), - ); - self.inner.unary(req, path, codec).await - } - /// General-purpose prefixed key-value state query API, that can be used to query - /// arbitrary prefixes in the JMT storage. - pub async fn prefix_value( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/penumbra.cnidarium.v1.QueryService/PrefixValue", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("penumbra.cnidarium.v1.QueryService", "PrefixValue"), - ); - self.inner.server_streaming(req, path, codec).await - } - /// Subscribes to a stream of key-value updates, with regex filtering on keys. - pub async fn watch( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/penumbra.cnidarium.v1.QueryService/Watch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("penumbra.cnidarium.v1.QueryService", "Watch")); - self.inner.server_streaming(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "rpc")] -pub mod query_service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with QueryServiceServer. - #[async_trait] - pub trait QueryService: std::marker::Send + std::marker::Sync + 'static { - /// General-purpose key-value state query API, that can be used to query - /// arbitrary keys in the JMT storage. - async fn key_value( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// General-purpose key-value state query API, that can be used to query - /// arbitrary keys in the non-verifiable storage. - async fn non_verifiable_key_value( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Server streaming response type for the PrefixValue method. - type PrefixValueStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result, - > - + std::marker::Send - + 'static; - /// General-purpose prefixed key-value state query API, that can be used to query - /// arbitrary prefixes in the JMT storage. - async fn prefix_value( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Server streaming response type for the Watch method. - type WatchStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result, - > - + std::marker::Send - + 'static; - /// Subscribes to a stream of key-value updates, with regex filtering on keys. - async fn watch( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - #[derive(Debug)] - pub struct QueryServiceServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl QueryServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for QueryServiceServer - where - T: QueryService, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - match req.uri().path() { - "/penumbra.cnidarium.v1.QueryService/KeyValue" => { - #[allow(non_camel_case_types)] - struct KeyValueSvc(pub Arc); - impl< - T: QueryService, - > tonic::server::UnaryService - for KeyValueSvc { - type Response = super::KeyValueResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::key_value(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = KeyValueSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/penumbra.cnidarium.v1.QueryService/NonVerifiableKeyValue" => { - #[allow(non_camel_case_types)] - struct NonVerifiableKeyValueSvc(pub Arc); - impl< - T: QueryService, - > tonic::server::UnaryService - for NonVerifiableKeyValueSvc { - type Response = super::NonVerifiableKeyValueResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::non_verifiable_key_value( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = NonVerifiableKeyValueSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/penumbra.cnidarium.v1.QueryService/PrefixValue" => { - #[allow(non_camel_case_types)] - struct PrefixValueSvc(pub Arc); - impl< - T: QueryService, - > tonic::server::ServerStreamingService - for PrefixValueSvc { - type Response = super::PrefixValueResponse; - type ResponseStream = T::PrefixValueStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::prefix_value(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = PrefixValueSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/penumbra.cnidarium.v1.QueryService/Watch" => { - #[allow(non_camel_case_types)] - struct WatchSvc(pub Arc); - impl< - T: QueryService, - > tonic::server::ServerStreamingService - for WatchSvc { - type Response = super::WatchResponse; - type ResponseStream = T::WatchStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::watch(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = WatchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } - } - } - } - impl Clone for QueryServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "penumbra.cnidarium.v1.QueryService"; - impl tonic::server::NamedService for QueryServiceServer { - const NAME: &'static str = SERVICE_NAME; - } -} diff --git a/crates/proto/src/gen/penumbra.cnidarium.v1.serde.rs b/crates/proto/src/gen/penumbra.cnidarium.v1.serde.rs deleted file mode 100644 index 6eea278b57..0000000000 --- a/crates/proto/src/gen/penumbra.cnidarium.v1.serde.rs +++ /dev/null @@ -1,1441 +0,0 @@ -impl serde::Serialize for KeyValueRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if self.proof { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.KeyValueRequest", len)?; - if !self.key.is_empty() { - struct_ser.serialize_field("key", &self.key)?; - } - if self.proof { - struct_ser.serialize_field("proof", &self.proof)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for KeyValueRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "proof", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Proof, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "proof" => Ok(GeneratedField::Proof), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = KeyValueRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.KeyValueRequest") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut proof__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some(map_.next_value()?); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(KeyValueRequest { - key: key__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.KeyValueRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for KeyValueResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.value.is_some() { - len += 1; - } - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.KeyValueResponse", len)?; - if let Some(v) = self.value.as_ref() { - struct_ser.serialize_field("value", v)?; - } - if let Some(v) = self.proof.as_ref() { - struct_ser.serialize_field("proof", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for KeyValueResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "value", - "proof", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Value, - Proof, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "value" => Ok(GeneratedField::Value), - "proof" => Ok(GeneratedField::Proof), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = KeyValueResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.KeyValueResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut value__ = None; - let mut proof__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = map_.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(KeyValueResponse { - value: value__, - proof: proof__, - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.KeyValueResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for key_value_response::Value { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.value.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.KeyValueResponse.Value", len)?; - if !self.value.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for key_value_response::Value { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Value, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "value" => Ok(GeneratedField::Value), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = key_value_response::Value; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.KeyValueResponse.Value") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(key_value_response::Value { - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.KeyValueResponse.Value", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for NonVerifiableKeyValueRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.key.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueRequest", len)?; - if let Some(v) = self.key.as_ref() { - struct_ser.serialize_field("key", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for NonVerifiableKeyValueRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = NonVerifiableKeyValueRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.NonVerifiableKeyValueRequest") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(NonVerifiableKeyValueRequest { - key: key__, - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for non_verifiable_key_value_request::Key { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.inner.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key", len)?; - if !self.inner.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("inner", pbjson::private::base64::encode(&self.inner).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for non_verifiable_key_value_request::Key { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "inner", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Inner, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "inner" => Ok(GeneratedField::Inner), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = non_verifiable_key_value_request::Key; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut inner__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Inner => { - if inner__.is_some() { - return Err(serde::de::Error::duplicate_field("inner")); - } - inner__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(non_verifiable_key_value_request::Key { - inner: inner__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueRequest.Key", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for NonVerifiableKeyValueResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.value.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueResponse", len)?; - if let Some(v) = self.value.as_ref() { - struct_ser.serialize_field("value", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for NonVerifiableKeyValueResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Value, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "value" => Ok(GeneratedField::Value), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = NonVerifiableKeyValueResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.NonVerifiableKeyValueResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = map_.next_value()?; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(NonVerifiableKeyValueResponse { - value: value__, - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for non_verifiable_key_value_response::Value { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.value.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value", len)?; - if !self.value.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for non_verifiable_key_value_response::Value { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Value, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "value" => Ok(GeneratedField::Value), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = non_verifiable_key_value_response::Value; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(non_verifiable_key_value_response::Value { - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.NonVerifiableKeyValueResponse.Value", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PrefixValueRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.prefix.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.PrefixValueRequest", len)?; - if !self.prefix.is_empty() { - struct_ser.serialize_field("prefix", &self.prefix)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrefixValueRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "prefix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Prefix, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "prefix" => Ok(GeneratedField::Prefix), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PrefixValueRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.PrefixValueRequest") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut prefix__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(PrefixValueRequest { - prefix: prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.PrefixValueRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PrefixValueResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if !self.value.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.PrefixValueResponse", len)?; - if !self.key.is_empty() { - struct_ser.serialize_field("key", &self.key)?; - } - if !self.value.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrefixValueResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PrefixValueResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.PrefixValueResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some(map_.next_value()?); - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(PrefixValueResponse { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.PrefixValueResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for WatchRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key_regex.is_empty() { - len += 1; - } - if !self.nv_key_regex.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.WatchRequest", len)?; - if !self.key_regex.is_empty() { - struct_ser.serialize_field("keyRegex", &self.key_regex)?; - } - if !self.nv_key_regex.is_empty() { - struct_ser.serialize_field("nvKeyRegex", &self.nv_key_regex)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for WatchRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key_regex", - "keyRegex", - "nv_key_regex", - "nvKeyRegex", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - KeyRegex, - NvKeyRegex, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "keyRegex" | "key_regex" => Ok(GeneratedField::KeyRegex), - "nvKeyRegex" | "nv_key_regex" => Ok(GeneratedField::NvKeyRegex), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = WatchRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.WatchRequest") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key_regex__ = None; - let mut nv_key_regex__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::KeyRegex => { - if key_regex__.is_some() { - return Err(serde::de::Error::duplicate_field("keyRegex")); - } - key_regex__ = Some(map_.next_value()?); - } - GeneratedField::NvKeyRegex => { - if nv_key_regex__.is_some() { - return Err(serde::de::Error::duplicate_field("nvKeyRegex")); - } - nv_key_regex__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(WatchRequest { - key_regex: key_regex__.unwrap_or_default(), - nv_key_regex: nv_key_regex__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.WatchRequest", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for WatchResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.version != 0 { - len += 1; - } - if self.entry.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.WatchResponse", len)?; - if self.version != 0 { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; - } - if let Some(v) = self.entry.as_ref() { - match v { - watch_response::Entry::Kv(v) => { - struct_ser.serialize_field("kv", v)?; - } - watch_response::Entry::NvKv(v) => { - struct_ser.serialize_field("nvKv", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for WatchResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "version", - "kv", - "nv_kv", - "nvKv", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - Kv, - NvKv, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "version" => Ok(GeneratedField::Version), - "kv" => Ok(GeneratedField::Kv), - "nvKv" | "nv_kv" => Ok(GeneratedField::NvKv), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = WatchResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.WatchResponse") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut entry__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Kv => { - if entry__.is_some() { - return Err(serde::de::Error::duplicate_field("kv")); - } - entry__ = map_.next_value::<::std::option::Option<_>>()?.map(watch_response::Entry::Kv) -; - } - GeneratedField::NvKv => { - if entry__.is_some() { - return Err(serde::de::Error::duplicate_field("nvKv")); - } - entry__ = map_.next_value::<::std::option::Option<_>>()?.map(watch_response::Entry::NvKv) -; - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(WatchResponse { - version: version__.unwrap_or_default(), - entry: entry__, - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.WatchResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for watch_response::KeyValue { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if !self.value.is_empty() { - len += 1; - } - if self.deleted { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.WatchResponse.KeyValue", len)?; - if !self.key.is_empty() { - struct_ser.serialize_field("key", &self.key)?; - } - if !self.value.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - if self.deleted { - struct_ser.serialize_field("deleted", &self.deleted)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for watch_response::KeyValue { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - "deleted", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Deleted, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - "deleted" => Ok(GeneratedField::Deleted), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = watch_response::KeyValue; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.WatchResponse.KeyValue") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - let mut deleted__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some(map_.next_value()?); - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Deleted => { - if deleted__.is_some() { - return Err(serde::de::Error::duplicate_field("deleted")); - } - deleted__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(watch_response::KeyValue { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - deleted: deleted__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.WatchResponse.KeyValue", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for watch_response::NvKeyValue { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if !self.value.is_empty() { - len += 1; - } - if self.deleted { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("penumbra.cnidarium.v1.WatchResponse.NvKeyValue", len)?; - if !self.key.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - #[allow(clippy::needless_borrow)] - #[allow(clippy::needless_borrows_for_generic_args)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - if self.deleted { - struct_ser.serialize_field("deleted", &self.deleted)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for watch_response::NvKeyValue { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - "deleted", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Deleted, - __SkipField__, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - "deleted" => Ok(GeneratedField::Deleted), - _ => Ok(GeneratedField::__SkipField__), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = watch_response::NvKeyValue; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct penumbra.cnidarium.v1.WatchResponse.NvKeyValue") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - let mut deleted__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Deleted => { - if deleted__.is_some() { - return Err(serde::de::Error::duplicate_field("deleted")); - } - deleted__ = Some(map_.next_value()?); - } - GeneratedField::__SkipField__ => { - let _ = map_.next_value::()?; - } - } - } - Ok(watch_response::NvKeyValue { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - deleted: deleted__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("penumbra.cnidarium.v1.WatchResponse.NvKeyValue", FIELDS, GeneratedVisitor) - } -} diff --git a/crates/proto/src/gen/penumbra.core.asset.v1.rs b/crates/proto/src/gen/penumbra.core.asset.v1.rs index 05dd5040ea..737329422a 100644 --- a/crates/proto/src/gen/penumbra.core.asset.v1.rs +++ b/crates/proto/src/gen/penumbra.core.asset.v1.rs @@ -87,7 +87,7 @@ pub struct Metadata { pub symbol: ::prost::alloc::string::String, /// the asset ID on Penumbra for this denomination. #[prost(message, optional, tag = "1984")] - pub penumbra_sdk_asset_id: ::core::option::Option, + pub penumbra_asset_id: ::core::option::Option, #[prost(message, repeated, tag = "1985")] pub images: ::prost::alloc::vec::Vec, /// An optional "score" used to prioritize token lists. diff --git a/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs b/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs index d1c18db5e8..e0233c0b07 100644 --- a/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs +++ b/crates/proto/src/gen/penumbra.core.asset.v1.serde.rs @@ -1241,7 +1241,7 @@ impl serde::Serialize for Metadata { if !self.symbol.is_empty() { len += 1; } - if self.penumbra_sdk_asset_id.is_some() { + if self.penumbra_asset_id.is_some() { len += 1; } if !self.images.is_empty() { @@ -1272,7 +1272,7 @@ impl serde::Serialize for Metadata { if !self.symbol.is_empty() { struct_ser.serialize_field("symbol", &self.symbol)?; } - if let Some(v) = self.penumbra_sdk_asset_id.as_ref() { + if let Some(v) = self.penumbra_asset_id.as_ref() { struct_ser.serialize_field("penumbraAssetId", v)?; } if !self.images.is_empty() { @@ -1303,7 +1303,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { "display", "name", "symbol", - "penumbra_sdk_asset_id", + "penumbra_asset_id", "penumbraAssetId", "images", "priority_score", @@ -1351,7 +1351,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { "display" => Ok(GeneratedField::Display), "name" => Ok(GeneratedField::Name), "symbol" => Ok(GeneratedField::Symbol), - "penumbraAssetId" | "penumbra_sdk_asset_id" => Ok(GeneratedField::PenumbraAssetId), + "penumbraAssetId" | "penumbra_asset_id" => Ok(GeneratedField::PenumbraAssetId), "images" => Ok(GeneratedField::Images), "priorityScore" | "priority_score" => Ok(GeneratedField::PriorityScore), "badges" => Ok(GeneratedField::Badges), @@ -1380,7 +1380,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { let mut display__ = None; let mut name__ = None; let mut symbol__ = None; - let mut penumbra_sdk_asset_id__ = None; + let mut penumbra_asset_id__ = None; let mut images__ = None; let mut priority_score__ = None; let mut badges__ = None; @@ -1423,10 +1423,10 @@ impl<'de> serde::Deserialize<'de> for Metadata { symbol__ = Some(map_.next_value()?); } GeneratedField::PenumbraAssetId => { - if penumbra_sdk_asset_id__.is_some() { + if penumbra_asset_id__.is_some() { return Err(serde::de::Error::duplicate_field("penumbraAssetId")); } - penumbra_sdk_asset_id__ = map_.next_value()?; + penumbra_asset_id__ = map_.next_value()?; } GeneratedField::Images => { if images__.is_some() { @@ -1460,7 +1460,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { display: display__.unwrap_or_default(), name: name__.unwrap_or_default(), symbol: symbol__.unwrap_or_default(), - penumbra_sdk_asset_id: penumbra_sdk_asset_id__, + penumbra_asset_id: penumbra_asset_id__, images: images__.unwrap_or_default(), priority_score: priority_score__.unwrap_or_default(), badges: badges__.unwrap_or_default(), diff --git a/crates/proto/src/gen/proto_descriptor.bin.no_lfs b/crates/proto/src/gen/proto_descriptor.bin.no_lfs index 9cc97daa81b471901cd058305f031e5b7ec527fa..0c102f1d35cdc992b8a4d0de249582ea9f2b09d6 100644 GIT binary patch delta 51 zcmZqNrMA9Tt)Ydng{g&k3(J!m?b#}_E)1JzIs7O=|m-8!V=#+Y9YDC&U2& D@iP)> delta 5579 zcmcIoOK%j}74CX;clGtV+y+x-%*AGm8SKV942DrAIKX5)GrT-NM1UEWyKmDK+EwkU z?zXKgDv3}=Q50#EjraKhi6TWp%0BCCiCB#kMM{>LNLeP|xpk}C#5OWYvOw}z_uTXR z&bg=g%`c{Y{QIdNJ=dP=&yC-ie}4JmZ-2Mu=NJDt!`^KOzqPg+x@XG1S8+qHwRWa` zwhKy)FlYw$NGew9h?UxBo$Xi03)At$Pc?S*R^UGnp;z_X)w=jZY&~%6EwL=tTOw-O zOU!sCwnjCsP4}F;RN7Nn=}j6+(6~%GoH1tLZ@b8{p6`ngI=7$vTh_CI*vC=*UDt21Jn{ z$3b<}z&C3-0TaK~*kJdrir|`xVEgO5K71vu7Yae?QD*k=)4rUVAhSK^Cb#dNE^r?< zm9?FL>=nlhv+snW>TSLj$|06($giVGGzv|8iw(afop`kU^?HGC-}=U~;)$EA_j_)$ zTubRO#tP5G))%38DmG-F1Tbk7rG%x@!RDKYUUo%JbwDp8{>-xguy z1-?{gE~n7`Hq+y0?a{1E#Oyv4cuiR+w;yGe^=EDSLzX3f+M_wC~Z z5pI1Z!nRiy_M@&@duku&Q@>P!oRfRY#hu(N3zhkwXl!K9Hnh+0t>cYt?_7A}rFhr4 zQC?J8&khROr}ojZLne*%y@QA*R_3%7`yR_mve=XR+}p`>=fse@ z5OL3kwBR4#yazQw=sp!C#(G(nEW?jNu0KUO(7GCq)( zyPWg`e-=YPQDm3D8hMc$QyyyYx9{jeir{bGwH5YU`Wx#w9MV5=Hg-9j%s-^;zeuli zTq)W!!*QBoO59LxNI5CJvQMNahqE*DDMA247nj&WnQwrie%bkyf7V)!%AvO^BC4^A zoP@$%<3V+Y|E)#^{D@}whS#id8p-h{uX^<+Qt3bCfiIcRDZ2rmin$(T*FdI+7lL&d-dRMxtk*gE>3CwPmjZHutPO!vRAhI@T7Nsi^!q-W&(8Um+ggC__&tY@Y z9%eV;sz#TmblbVg?;)|tP$&msC`WjO(g|`<&ZCAXqkZBeqchyAa<9oZ+=y3$mS0IY zK>85vl%7Nj1lv={8zmVCmZt`X*bfn{Zkscivziker0QzU%y1Edh$2LVi6K1b{8e+K z8hqe)XnO*ILIHNxw|LZQG=dNhsJf!4K;1KA9cJ^$flfIn=|j#mU#jv*G-(RTAxW`U z1$Gl&4TCi~HR8^gqkG77Nw;KlK+st#^ri^0mIemdw6uVuIanCu8#N&VfaXv%TcHoS z%8gI{6iTn?)I3>2baU!-ilFpL=?uG$ z44St2L1s~N7Iso_k0~xE&Gm=_@WMXeqaS4rUd|)|j0e+g4-m7}iIW7AsQP!nV z)LNBKXNOK*HsK~JaaFMi2wJZe2Bh0SaQiB%K!wlR=C#a+aZ>p##I9Lma_(fw_;p>r z2_^vaU03>mAb4G|6A1dQgGe;4vXt8!x-Crs;MxsU5+FKLB>}><8z{*WrcavKN|rJY zH0Lf?`x4FV?knPpjqQIG3y0#G+ZI?SgwM;t+M3s-W=w|)tsg3lIapf4?(z@3vu2J$ zxvd{|{-W_k`S9S~LBVDA)Z(%G37`RRo4UUHdbAp`e8SLpYV(Qs8vWcrk9(2Qyy4aB zwD2SyDKO0VtpIzGT!v^Ch_yzuQ+;_IucnJjF>#d6De4U~7i3Ulmj7*&P zd;$+?&4cY!g&!zNL5WO1;zs&!tEvGZDYpwrX@HRa+arhAKa&*U?7r?ef89St^ialo ztv$Qb^nc4ze6TdVU6zQX_d8i4lHMw{(sbaaL9jsRW!&1RXL{&4bxRWLdyVj`{ z1Q1p&trgL~u8*Km@6om?f0v@2=)Y}bYjsC@hkxDY#BHkinU}SwtH}VQVPmSpChY=% zuvmx1Sz?EUJ`VKIaE?in@_$H@p+MyBC{Hz8)UN@aLV7dv6iWjoO!U&m(J+%W4M%j= zmpt8h{R66A1Jz6Jp>*r!5p_?;y>(OmPKHX-xjvBUr0lF89{uvwOB4UH_?N@K{EJsF OtpVr7vFXBBpZ^;(&O0ao From c505c240b3f1874ea967398e33d39014f805c9c6 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:52:27 -0500 Subject: [PATCH 13/19] penumbra: more workshopping in protofiles --- crates/core/asset/src/asset/denom_metadata.rs | 4 ++-- crates/core/component/funding/src/component/metrics.rs | 3 +-- crates/proto/src/lib.rs | 7 ------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/crates/core/asset/src/asset/denom_metadata.rs b/crates/core/asset/src/asset/denom_metadata.rs index 78af88ae88..13866de43c 100644 --- a/crates/core/asset/src/asset/denom_metadata.rs +++ b/crates/core/asset/src/asset/denom_metadata.rs @@ -63,7 +63,7 @@ impl From<&Inner> for pb::Metadata { display: inner.units[inner.display_index].denom.clone(), name: inner.name.clone(), symbol: inner.symbol.clone(), - penumbra_sdk_asset_id: Some(inner.id.into()), + penumbra_asset_id: Some(inner.id.into()), denom_units: inner.units.clone().into_iter().map(|x| x.into()).collect(), images: inner.images.clone(), badges: inner.badges.clone(), @@ -85,7 +85,7 @@ impl TryFrom for Inner { // Compute the ID from the base denom to ensure we don't get confused. let id = Id::from_raw_denom(&base_denom); // If the ID was supplied, we should check that it's consistent with the base denom. - if let Some(supplied_id) = value.penumbra_sdk_asset_id { + if let Some(supplied_id) = value.penumbra_asset_id { let supplied_id = Id::try_from(supplied_id)?; ensure!( id == supplied_id, diff --git a/crates/core/component/funding/src/component/metrics.rs b/crates/core/component/funding/src/component/metrics.rs index 296c7f1763..075e01abf4 100644 --- a/crates/core/component/funding/src/component/metrics.rs +++ b/crates/core/component/funding/src/component/metrics.rs @@ -40,8 +40,7 @@ pub fn register_metrics() { ); } -pub const TOTAL_VALIDATOR_REWARDS: &str = - "penumbra_funding_total_validator_rewards_staking_token"; +pub const TOTAL_VALIDATOR_REWARDS: &str = "penumbra_funding_total_validator_rewards_staking_token"; pub const VALIDATOR_FUNDING_VS_BUDGET_DIFFERENCE: &str = "penumbra_funding_validator_vs_budget_difference_staking_token"; pub const FETCH_FUNDING_QUEUE_LATENCY: &str = diff --git a/crates/proto/src/lib.rs b/crates/proto/src/lib.rs index e43c91a31c..95ae722521 100644 --- a/crates/proto/src/lib.rs +++ b/crates/proto/src/lib.rs @@ -225,13 +225,6 @@ pub mod penumbra { } } - pub mod cnidarium { - pub mod v1 { - include!("gen/penumbra.cnidarium.v1.rs"); - include!("gen/penumbra.cnidarium.v1.serde.rs"); - } - } - pub mod util { pub mod tendermint_proxy { pub mod v1 { From 361a4de6b2329cc7b0cfe60a17e6bed09772e86d Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:55:53 -0500 Subject: [PATCH 14/19] penumbra: rename `penumbra_sdk_address` --- crates/bin/pindexer/src/ibc/mod.rs | 10 +++++----- crates/bin/pmonitor/tests/common/mod.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/bin/pindexer/src/ibc/mod.rs b/crates/bin/pindexer/src/ibc/mod.rs index b74c93b49f..2f3923905c 100644 --- a/crates/bin/pindexer/src/ibc/mod.rs +++ b/crates/bin/pindexer/src/ibc/mod.rs @@ -109,7 +109,7 @@ impl TryFrom<&ContextualizedEvent> for Event { /// The database's view of a transfer. #[derive(Debug)] struct DatabaseTransfer { - penumbra_sdk_addr: Address, + penumbra_addr: Address, foreign_addr: String, negate: bool, value: Value, @@ -124,7 +124,7 @@ impl Event { sender, value, } => DatabaseTransfer { - penumbra_sdk_addr: receiver, + penumbra_addr: receiver, foreign_addr: sender, negate: false, value, @@ -135,7 +135,7 @@ impl Event { receiver, value, } => DatabaseTransfer { - penumbra_sdk_addr: sender, + penumbra_addr: sender, foreign_addr: receiver, negate: true, value, @@ -147,7 +147,7 @@ impl Event { value, reason, } => DatabaseTransfer { - penumbra_sdk_addr: sender, + penumbra_addr: sender, foreign_addr: receiver, negate: false, value, @@ -176,7 +176,7 @@ async fn create_transfer( sqlx::query("INSERT INTO ibc_transfer VALUES (DEFAULT, $7, $1, $6::NUMERIC(39, 0) * $2::NUMERIC(39, 0), $3, $4, $5)") .bind(transfer.value.asset_id.to_bytes()) .bind(transfer.value.amount.to_string()) - .bind(transfer.penumbra_sdk_addr.to_vec()) + .bind(transfer.penumbra_addr.to_vec()) .bind(transfer.foreign_addr) .bind(transfer.kind) .bind(if transfer.negate { -1i32 } else { 1i32 }) diff --git a/crates/bin/pmonitor/tests/common/mod.rs b/crates/bin/pmonitor/tests/common/mod.rs index 9a3be25665..4d37a6ec08 100644 --- a/crates/bin/pmonitor/tests/common/mod.rs +++ b/crates/bin/pmonitor/tests/common/mod.rs @@ -124,8 +124,8 @@ impl PmonitorTestRunner { let mut results = Vec::
::new(); for i in 0..self.num_wallets - 1 { let pcli_home = self.wallets_dir()?.join(format!("wallet-{}", i)); - let penumbra_sdk_address = pcli_view_address(&pcli_home)?; - results.push(penumbra_sdk_address); + let penumbra_address = pcli_view_address(&pcli_home)?; + results.push(penumbra_address); } Ok(results) } From bafb95489c529558379fd1d53327bcad1793246d Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 11:58:09 -0500 Subject: [PATCH 15/19] penumbra: same thing in tx perspective --- crates/core/transaction/src/view/transaction_perspective.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/transaction/src/view/transaction_perspective.rs b/crates/core/transaction/src/view/transaction_perspective.rs index df41b3204f..72b8a3bf89 100644 --- a/crates/core/transaction/src/view/transaction_perspective.rs +++ b/crates/core/transaction/src/view/transaction_perspective.rs @@ -214,7 +214,7 @@ impl TryFrom for TransactionPerspective { for denom in msg.denoms { denoms.insert( denom - .penumbra_sdk_asset_id + .penumbra_asset_id .clone() .ok_or_else(|| anyhow!("missing penumbra asset ID in denom"))? .try_into()?, From 4a7e64901db814915fe42a586ea33dad5c7d92a8 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 15:40:06 -0500 Subject: [PATCH 16/19] penumbra: use `cnidarium@0.82` --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- crates/bin/pcli/Cargo.toml | 1 + crates/bin/pcli/src/command/query.rs | 2 +- crates/proto/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 563f3b694c..67bb0fff56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1287,9 +1287,9 @@ dependencies = [ [[package]] name = "cnidarium" -version = "0.81.0" +version = "0.82.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77ae2f37b1ca16db2524f7d1f1a14416372dc2594635d18a6357b609c4164c8" +checksum = "f93ab30a485dceb9aca3210c03fbbecadd14837a94aef19deb594eef9cb5ced1" dependencies = [ "anyhow", "async-trait", @@ -4372,6 +4372,7 @@ dependencies = [ "bytes", "camino", "clap", + "cnidarium", "colored", "colored_json", "comfy-table", diff --git a/Cargo.toml b/Cargo.toml index e8eb1e6d5f..f368d816bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,7 @@ camino = { version = "1" } chacha20poly1305 = { version = "0.9.0" } chrono = { default-features = false, version = "0.4" } clap = { version = "3.2" } -cnidarium = { version = "0.81", default-features = false} +cnidarium = { version = "0.82", default-features = false} cnidarium-component = { default-features = false, path = "crates/cnidarium-component" } cometindex = { path = "crates/util/cometindex" } criterion = { version = "0.4" } diff --git a/crates/bin/pcli/Cargo.toml b/crates/bin/pcli/Cargo.toml index 870bebb274..744b5f3ebc 100644 --- a/crates/bin/pcli/Cargo.toml +++ b/crates/bin/pcli/Cargo.toml @@ -39,6 +39,7 @@ bincode = {workspace = true} blake2b_simd = {workspace = true} bytes = {workspace = true} camino = {workspace = true} +cnidarium = {workspace = true, features = ["rpc"] } clap = {workspace = true, features = ["derive", "env"]} colored = "2.1.0" colored_json = "4.1" diff --git a/crates/bin/pcli/src/command/query.rs b/crates/bin/pcli/src/command/query.rs index 119d33453b..6d64098d75 100644 --- a/crates/bin/pcli/src/command/query.rs +++ b/crates/bin/pcli/src/command/query.rs @@ -1,4 +1,4 @@ -use anyhow::{anyhow, Context, Result}; +use anyhow::{anyhow, Result}; pub(crate) mod auction; mod chain; diff --git a/crates/proto/Cargo.toml b/crates/proto/Cargo.toml index 36d1d5a681..7fbfa9bbe9 100644 --- a/crates/proto/Cargo.toml +++ b/crates/proto/Cargo.toml @@ -24,7 +24,7 @@ async-trait = {workspace = true} bech32 = {workspace = true} bytes = {workspace = true, features = ["serde"]} chrono = {workspace = true, optional = true, default-features = false, features = ["serde"]} -cnidarium = {workspace = true, optional = true, default-features = true} +cnidarium = {workspace = true, optional = true, default-features = true, features = ["rpc"]} decaf377-fmd = {workspace = true} decaf377-rdsa = {workspace = true} futures = {workspace = true} From 3551d142488d531cbfb1d22ab47bca3a11c645a7 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 16:42:12 -0500 Subject: [PATCH 17/19] penumbra: fix all path, compiles --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/bin/pcli/src/command/query.rs | 16 +++++++--------- crates/core/app/src/rpc.rs | 6 ++---- .../app/tests/mock_consensus_block_proving.rs | 7 +++---- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67bb0fff56..827970c648 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1287,9 +1287,9 @@ dependencies = [ [[package]] name = "cnidarium" -version = "0.82.0" +version = "0.82.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab30a485dceb9aca3210c03fbbecadd14837a94aef19deb594eef9cb5ced1" +checksum = "7f0060de634f1f7411ab7464f1021f48ffdeb72fd63cf19553035fa766563828" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index f368d816bc..8ab80872f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,7 @@ camino = { version = "1" } chacha20poly1305 = { version = "0.9.0" } chrono = { default-features = false, version = "0.4" } clap = { version = "3.2" } -cnidarium = { version = "0.82", default-features = false} +cnidarium = { version = "0.82.1", default-features = false} cnidarium-component = { default-features = false, path = "crates/cnidarium-component" } cometindex = { path = "crates/util/cometindex" } criterion = { version = "0.4" } diff --git a/crates/bin/pcli/src/command/query.rs b/crates/bin/pcli/src/command/query.rs index 6d64098d75..f2657b3cc6 100644 --- a/crates/bin/pcli/src/command/query.rs +++ b/crates/bin/pcli/src/command/query.rs @@ -1,4 +1,4 @@ -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, Context, Result}; pub(crate) mod auction; mod chain; @@ -13,12 +13,12 @@ mod validator; use auction::AuctionCmd; use base64::prelude::*; use chain::ChainCmd; +use cnidarium::proto::v1::non_verifiable_key_value_request::Key as NVKey; use colored_json::ToColoredJson; use community_pool::CommunityPoolCmd; use dex::DexCmd; use governance::GovernanceCmd; use ibc_query::IbcCmd; -use penumbra_sdk_proto::cnidarium::v1::non_verifiable_key_value_request::Key as NVKey; use shielded_pool::ShieldedPool; use tx::Tx; pub(super) use validator::ValidatorCmd; @@ -177,7 +177,7 @@ impl QueryCmd { } => (key.clone(), storage_backend.clone()), }; - use penumbra_sdk_proto::cnidarium::v1::query_service_client::QueryServiceClient; + use cnidarium::proto::v1::query_service_client::QueryServiceClient; let mut client = QueryServiceClient::new(app.pd_channel().await?); // Using an enum in the clap arguments was annoying; this is workable: @@ -187,7 +187,7 @@ impl QueryCmd { .decode(&key) .map_err(|e| anyhow::anyhow!(format!("invalid base64: {}", e)))?; - let req = penumbra_sdk_proto::cnidarium::v1::NonVerifiableKeyValueRequest { + let req = cnidarium::proto::v1::NonVerifiableKeyValueRequest { key: Some(NVKey { inner: key_bytes }), ..Default::default() }; @@ -205,7 +205,7 @@ impl QueryCmd { } // Default to JMT "jmt" | _ => { - let req = penumbra_sdk_proto::cnidarium::v1::KeyValueRequest { + let req = cnidarium::proto::v1::KeyValueRequest { key: key.clone(), // Command-line queries don't have a reason to include proofs as of now. proof: false, @@ -269,12 +269,10 @@ impl QueryCmd { // this code (not just this function, the whole module) is pretty shitty, // but that's maybe okay for the moment. it exists to consume the rpc. async fn watch(key_regex: String, nv_key_regex: String, app: &mut App) -> Result<()> { - use penumbra_sdk_proto::cnidarium::v1::{ - query_service_client::QueryServiceClient, watch_response as wr, - }; + use cnidarium::proto::v1::{query_service_client::QueryServiceClient, watch_response as wr}; let mut client = QueryServiceClient::new(app.pd_channel().await?); - let req = penumbra_sdk_proto::cnidarium::v1::WatchRequest { + let req = cnidarium::proto::v1::WatchRequest { key_regex, nv_key_regex, }; diff --git a/crates/core/app/src/rpc.rs b/crates/core/app/src/rpc.rs index fd69cb5933..eec4d504bc 100644 --- a/crates/core/app/src/rpc.rs +++ b/crates/core/app/src/rpc.rs @@ -10,10 +10,8 @@ use { self::query::AppQueryServer, crate::PenumbraHost, anyhow::Context, - cnidarium::rpc::{ - proto::v1::query_service_server::QueryServiceServer as StorageQueryServiceServer, - Server as StorageServer, - }, + cnidarium::proto::v1::query_service_server::QueryServiceServer as StorageQueryServiceServer, + cnidarium::rpc::Server as StorageServer, ibc_proto::{ cosmos::bank::v1beta1::query_server::QueryServer as TransferQueryServer, ibc::{ diff --git a/crates/core/app/tests/mock_consensus_block_proving.rs b/crates/core/app/tests/mock_consensus_block_proving.rs index 831117f368..d6e7ef9e5c 100644 --- a/crates/core/app/tests/mock_consensus_block_proving.rs +++ b/crates/core/app/tests/mock_consensus_block_proving.rs @@ -1,5 +1,8 @@ use { anyhow::Context as _, + cnidarium::proto::v1::{ + query_service_client::QueryServiceClient as CnidariumQueryServiceClient, KeyValueRequest, + }, cnidarium::{StateRead as _, TempStorage}, common::{BuilderExt as _, TempStorageExt as _}, ibc_proto::ibc::core::client::v1::{ @@ -23,10 +26,6 @@ use { penumbra_sdk_mock_client::MockClient, penumbra_sdk_mock_consensus::TestNode, penumbra_sdk_proto::{ - cnidarium::v1::{ - query_service_client::QueryServiceClient as CnidariumQueryServiceClient, - KeyValueRequest, - }, util::tendermint_proxy::v1::{ tendermint_proxy_service_client::TendermintProxyServiceClient, GetBlockByHeightRequest, }, From 9fef613e2a01851bfd566bcb75ce93b83b170a29 Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 17:06:32 -0500 Subject: [PATCH 18/19] view: import `cnidarium` --- Cargo.lock | 1 + crates/bench/Cargo.toml | 1 - crates/core/app/Cargo.toml | 1 - crates/core/component/dex/src/state_key.rs | 2 -- crates/view/Cargo.toml | 1 + crates/view/src/worker.rs | 5 +++-- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 827970c648..012ffa9d36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5846,6 +5846,7 @@ dependencies = [ "async-trait", "bytes", "camino", + "cnidarium", "decaf377", "digest 0.9.0", "ed25519-consensus", diff --git a/crates/bench/Cargo.toml b/crates/bench/Cargo.toml index 900e923515..91c00a40a4 100644 --- a/crates/bench/Cargo.toml +++ b/crates/bench/Cargo.toml @@ -103,4 +103,3 @@ features = [ "bundled-proving-keys", "download-proving-keys", ] -package = "penumbra-sdk-proof-params" diff --git a/crates/core/app/Cargo.toml b/crates/core/app/Cargo.toml index f6d39dfe99..c634c0cfb2 100644 --- a/crates/core/app/Cargo.toml +++ b/crates/core/app/Cargo.toml @@ -132,4 +132,3 @@ features = [ "bundled-proving-keys", "download-proving-keys", ] -package = "penumbra-sdk-proof-params" diff --git a/crates/core/component/dex/src/state_key.rs b/crates/core/component/dex/src/state_key.rs index 89bcfe9184..cbd51b9873 100644 --- a/crates/core/component/dex/src/state_key.rs +++ b/crates/core/component/dex/src/state_key.rs @@ -1,7 +1,5 @@ use std::string::String; - use penumbra_sdk_asset::asset; - use crate::{lp::position, DirectedTradingPair, TradingPair}; pub mod config { diff --git a/crates/view/Cargo.toml b/crates/view/Cargo.toml index 986ed4c6fe..5f14afc037 100644 --- a/crates/view/Cargo.toml +++ b/crates/view/Cargo.toml @@ -33,6 +33,7 @@ ibc-types = {workspace = true, default-features = false} metrics = {workspace = true} once_cell = {workspace = true} parking_lot = {workspace = true} +cnidarium = {workspace = true, features = ["rpc"]} penumbra-sdk-app = {workspace = true, default-features = false} penumbra-sdk-asset = {workspace = true, default-features = true} penumbra-sdk-community-pool = {workspace = true, default-features = false} diff --git a/crates/view/src/worker.rs b/crates/view/src/worker.rs index 9126773ef0..8ca7bbf5ca 100644 --- a/crates/view/src/worker.rs +++ b/crates/view/src/worker.rs @@ -487,14 +487,15 @@ async fn sct_divergence_check( height: u64, actual_root: penumbra_sdk_tct::Root, ) -> anyhow::Result<()> { - use penumbra_sdk_proto::{cnidarium::v1::query_service_client::QueryServiceClient, DomainType}; + use cnidarium::proto::v1::query_service_client::QueryServiceClient; + use penumbra_sdk_proto::DomainType; use penumbra_sdk_sct::state_key as sct_state_key; let mut client = QueryServiceClient::new(channel); tracing::info!(?height, "fetching anchor @ height"); let value = client - .key_value(penumbra_sdk_proto::cnidarium::v1::KeyValueRequest { + .key_value(cnidarium::proto::v1::KeyValueRequest { key: sct_state_key::tree::anchor_by_height(height), proof: false, ..Default::default() From 6d6a71d81793a5f03b924c3ff5848b6056f2e49e Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Wed, 25 Dec 2024 17:12:29 -0500 Subject: [PATCH 19/19] penumbra: run `fmt` --- crates/core/component/dex/src/state_key.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/core/component/dex/src/state_key.rs b/crates/core/component/dex/src/state_key.rs index cbd51b9873..6ce4e5ccb6 100644 --- a/crates/core/component/dex/src/state_key.rs +++ b/crates/core/component/dex/src/state_key.rs @@ -1,6 +1,6 @@ -use std::string::String; -use penumbra_sdk_asset::asset; use crate::{lp::position, DirectedTradingPair, TradingPair}; +use penumbra_sdk_asset::asset; +use std::string::String; pub mod config { pub fn dex_params() -> &'static str {