From bc4b854b726a95f8f2c011f4a1d22bd90550a5da Mon Sep 17 00:00:00 2001 From: Erwan Or Date: Mon, 26 Feb 2024 16:35:44 -0500 Subject: [PATCH] staking: remove `component::FP_SCALING_FACTOR` dup (#3895) This should fix the wasm build unless something else is wrong. The problem was that we defined the same constant (`FP_SCALING_FACTOR`) twice, once correctly at the crate-level, and another one in `penumbra_stake::component`. During development, the latter one was used and created a discreet dependency on the component module. x-ref #3894 --------- Co-authored-by: turbocrime --- COMPATIBILITY.md | 2 +- Cargo.lock | 148 +++++----- Cargo.toml | 262 +++++++++--------- .../stake/src/component/epoch_handler.rs | 5 +- .../core/component/stake/src/component/mod.rs | 10 +- .../component/stake/src/funding_stream.rs | 11 +- crates/core/component/stake/src/lib.rs | 2 +- crates/core/component/stake/src/rate.rs | 39 +-- docs/guide/src/penumbra_version.md | 2 +- 9 files changed, 242 insertions(+), 239 deletions(-) diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index e913d6aab0..43141f22f1 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -1,3 +1,3 @@ | Application version (Name)| Penumbra crate version | CometBFT | Protobuf | | ------------------------- | ---------------------- | -------- | -------- | -| 1 (Testnet 67) | v0.68.0-alpha.1 | v0.37.2 | v1 | +| 1 (Testnet 67) | v0.68.0-alpha.2 | v0.37.2 | v1 | diff --git a/Cargo.lock b/Cargo.lock index 4b7d7ca0fb..1467d6d41a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -744,7 +744,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -761,7 +761,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -944,7 +944,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "cnidarium" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "async-trait", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "cnidarium-component" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "async-trait", @@ -1825,7 +1825,7 @@ dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", "strsim", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1836,7 +1836,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "decaf377-fmd" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "ark-ff", "ark-serialize", @@ -1920,7 +1920,7 @@ dependencies = [ [[package]] name = "decaf377-frost" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -1935,7 +1935,7 @@ dependencies = [ [[package]] name = "decaf377-ka" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "ark-ff", "decaf377 0.5.0", @@ -2105,7 +2105,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -2125,9 +2125,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" @@ -2570,7 +2570,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -2745,9 +2745,9 @@ dependencies = [ [[package]] name = "half" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" dependencies = [ "cfg-if", "crunchy", @@ -4223,7 +4223,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4398,7 +4398,7 @@ dependencies = [ [[package]] name = "pcli" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4476,7 +4476,7 @@ dependencies = [ [[package]] name = "pclientd" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "assert_cmd", @@ -4529,7 +4529,7 @@ dependencies = [ [[package]] name = "pd" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4667,7 +4667,7 @@ dependencies = [ [[package]] name = "penumbra-app" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4742,7 +4742,7 @@ dependencies = [ [[package]] name = "penumbra-asset" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4780,7 +4780,7 @@ dependencies = [ [[package]] name = "penumbra-auto-https" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "axum-server", @@ -4792,7 +4792,7 @@ dependencies = [ [[package]] name = "penumbra-bench" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ec", @@ -4836,7 +4836,7 @@ dependencies = [ [[package]] name = "penumbra-community-pool" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4868,7 +4868,7 @@ dependencies = [ [[package]] name = "penumbra-compact-block" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4904,7 +4904,7 @@ dependencies = [ [[package]] name = "penumbra-custody" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4937,7 +4937,7 @@ dependencies = [ [[package]] name = "penumbra-dex" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -4997,7 +4997,7 @@ dependencies = [ [[package]] name = "penumbra-distributions" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "async-trait", @@ -5014,7 +5014,7 @@ dependencies = [ [[package]] name = "penumbra-eddy" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5032,7 +5032,7 @@ dependencies = [ [[package]] name = "penumbra-fee" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5057,7 +5057,7 @@ dependencies = [ [[package]] name = "penumbra-funding" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "async-trait", @@ -5079,7 +5079,7 @@ dependencies = [ [[package]] name = "penumbra-genesis" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "penumbra-community-pool", @@ -5097,7 +5097,7 @@ dependencies = [ [[package]] name = "penumbra-governance" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5153,7 +5153,7 @@ dependencies = [ [[package]] name = "penumbra-ibc" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5188,7 +5188,7 @@ dependencies = [ [[package]] name = "penumbra-keys" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "aes 0.8.4", "anyhow", @@ -5234,7 +5234,7 @@ dependencies = [ [[package]] name = "penumbra-measure" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "bytesize", @@ -5253,7 +5253,7 @@ dependencies = [ [[package]] name = "penumbra-mock-client" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "cnidarium", @@ -5267,7 +5267,7 @@ dependencies = [ [[package]] name = "penumbra-mock-consensus" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "bytes", @@ -5280,7 +5280,7 @@ dependencies = [ [[package]] name = "penumbra-num" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5317,7 +5317,7 @@ dependencies = [ [[package]] name = "penumbra-proof-params" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ec", @@ -5346,7 +5346,7 @@ dependencies = [ [[package]] name = "penumbra-proof-setup" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ec", @@ -5374,7 +5374,7 @@ dependencies = [ [[package]] name = "penumbra-proto" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "async-trait", @@ -5404,7 +5404,7 @@ dependencies = [ [[package]] name = "penumbra-sct" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5437,7 +5437,7 @@ dependencies = [ [[package]] name = "penumbra-shielded-pool" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5487,7 +5487,7 @@ dependencies = [ [[package]] name = "penumbra-stake" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5539,7 +5539,7 @@ dependencies = [ [[package]] name = "penumbra-tct" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "ark-ed-on-bls12-377", "ark-ff", @@ -5570,7 +5570,7 @@ dependencies = [ [[package]] name = "penumbra-tct-property-test" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "futures", @@ -5582,7 +5582,7 @@ dependencies = [ [[package]] name = "penumbra-tct-visualize" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "axum", @@ -5612,7 +5612,7 @@ dependencies = [ [[package]] name = "penumbra-tendermint-proxy" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "chrono", @@ -5643,7 +5643,7 @@ dependencies = [ [[package]] name = "penumbra-tower-trace" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "futures", "hex", @@ -5664,7 +5664,7 @@ dependencies = [ [[package]] name = "penumbra-transaction" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-ff", @@ -5716,7 +5716,7 @@ dependencies = [ [[package]] name = "penumbra-txhash" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "blake2b_simd 1.0.2", @@ -5728,7 +5728,7 @@ dependencies = [ [[package]] name = "penumbra-view" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-std", @@ -5783,7 +5783,7 @@ dependencies = [ [[package]] name = "penumbra-wallet" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-std", @@ -5851,7 +5851,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -6116,7 +6116,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2 1.0.78", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -6290,7 +6290,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.50", + "syn 2.0.51", "tempfile", "which", ] @@ -6305,7 +6305,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7104,7 +7104,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7148,7 +7148,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7176,7 +7176,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f1b15838534b38fb67ffe60033fe3ffad48f916c175e8baa0400e0cdb958dec" dependencies = [ "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7218,7 +7218,7 @@ dependencies = [ "darling", "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7569,7 +7569,7 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "summonerd" -version = "0.68.0-alpha.1" +version = "0.68.0-alpha.2" dependencies = [ "anyhow", "ark-groth16", @@ -7632,9 +7632,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", @@ -7854,7 +7854,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7999,7 +7999,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -8302,7 +8302,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -8547,7 +8547,7 @@ checksum = "b3fd98999db9227cf28e59d83e1f120f42bc233d4b152e8fab9bc87d5bb1e0f8" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -8617,7 +8617,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", "wasm-bindgen-shared", ] @@ -8651,7 +8651,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8963,7 +8963,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -8983,7 +8983,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 480f89c80e..02ea79609d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,9 @@ members = [ "crates/misc/measure", "crates/misc/tct-visualize", "crates/bench", - "tools/summonerd", "crates/core/component/funding", "crates/core/genesis", + "tools/summonerd", + "crates/core/component/funding", + "crates/core/genesis", ] # Config for 'cargo dist' @@ -84,7 +86,7 @@ shared-version = true # Format spec for the auto-generated git tag, based on new version for release. tag-name = "v{{version}}" # The message is required for an annotated tag to be created. -tag-message = "Penumbra version {{version}}" +tag-message = "Penumbra version {{version}}" pre-release-commit-message = "chore: release version {{version}}" # Don't push to crates.io; we're still using git branches for velocity. publish = false @@ -94,134 +96,134 @@ tag = true push = false [workspace.package] -authors = ["Penumbra Labs "] -edition = "2021" -version = "0.68.0-alpha.1" +authors = ["Penumbra Labs "] +edition = "2021" +version = "0.68.0-alpha.2" repository = "https://github.com/penumbra-zone/penumbra" -homepage = "https://penumbra.zone" -license = "MIT OR Apache-2.0" +homepage = "https://penumbra.zone" +license = "MIT OR Apache-2.0" [workspace.dependencies] -anyhow = {version = "1.0.75"} -ark-ec = {default-features = false, version = "0.4.2"} -ark-ff = {default-features = false, version = "0.4.2"} -ark-groth16 = {default-features = false, version = "0.4.0"} -ark-r1cs-std = {default-features = false, version = "0.4.0"} -ark-relations = {version = "0.4"} -ark-serialize = {version = "0.4.2"} -ark-snark = {version = "0.4.0"} -ark-std = {default-features = false, version = "0.4"} -assert_cmd = {version = "2.0"} -async-stream = {version = "0.3.5"} -async-trait = {version = "0.1.52"} -atty = {version = "0.2"} -axum = {version = "0.6"} -axum-server = {version = "0.4.7"} -base64 = {version = "0.21.2"} -bech32 = {version = "0.8.1"} -bincode = {version = "1.3.3"} -bitvec = {version = "1"} -blake2b_simd = {version = "1"} -bytes = {version = "1.2"} -camino = {version = "1"} -chacha20poly1305 = {version = "0.9.0"} -chrono = {default-features = false, version = "0.4"} -clap = {version = "3.2"} -cnidarium = {default-features = false, path = "crates/cnidarium"} -cnidarium-component = {default-features = false, path = "crates/cnidarium-component"} -console-subscriber = {version = "0.2"} -criterion = {version = "0.4"} -decaf377 = {default-features = false, version = "0.5"} -decaf377-fmd = {path = "crates/crypto/decaf377-fmd"} -decaf377-ka = {path = "crates/crypto/decaf377-ka"} -decaf377-rdsa = {version = "0.9"} -derivative = {version = "2.2"} -directories = {version = "4.0.1"} -ed25519-consensus = {version = "2.1"} -ethnum = {version = "1.3"} -futures = {version = "0.3.28"} -hex = {version = "0.4.3"} -http = {version = "0.2.9"} -http-body = {version = "0.4.5"} -ibc-proto = {default-features = false, version = "0.40.0"} -ibc-types = {default-features = false, version = "0.11.0"} -ibig = {version = "0.3"} -ics23 = {version = "0.11.0"} -im = {version = "^15.1.0"} -indicatif = {version = "0.16"} -jmt = {version = "0.9"} -metrics = {version = "0.22"} -metrics-tracing-context = {version = "0.15"} -num-bigint = {version = "0.4"} -num-traits = {default-features = false, version = "0.2.15"} -once_cell = {version = "1.8"} -parking_lot = {version = "0.12.1"} -pbjson = {version = "0.6"} -pbjson-types = {version = "0.6.0"} -penumbra-app = {path = "crates/core/app"} -penumbra-asset = {default-features = false, path = "crates/core/asset"} -penumbra-community-pool = {default-features = false, path = "crates/core/component/community-pool"} -penumbra-compact-block = {default-features = false, path = "crates/core/component/compact-block"} -penumbra-custody = {path = "crates/custody"} -penumbra-dex = {default-features = false, path = "crates/core/component/dex"} -penumbra-distributions = {default-features = false, path = "crates/core/component/distributions"} -penumbra-fee = {default-features = false, path = "crates/core/component/fee"} -penumbra-funding = {default-features = false, path = "crates/core/component/funding"} -penumbra-governance = {default-features = false, path = "crates/core/component/governance"} -penumbra-genesis = { path = "crates/core/genesis" } -penumbra-ibc = {default-features = false, path = "crates/core/component/ibc"} -penumbra-keys = {default-features = false, path = "crates/core/keys"} -penumbra-mock-client = {path = "crates/test/mock-client"} -penumbra-mock-consensus = {path = "crates/test/mock-consensus"} -penumbra-num = {default-features = false, path = "crates/core/num"} -penumbra-proof-params = {default-features = false, path = "crates/crypto/proof-params"} -penumbra-proof-setup = {path = "crates/crypto/proof-setup"} -penumbra-proto = {default-features = false, path = "crates/proto"} -penumbra-sct = {default-features = false, path = "crates/core/component/sct"} -penumbra-shielded-pool = {default-features = false, path = "crates/core/component/shielded-pool"} -penumbra-stake = {default-features = false, path = "crates/core/component/stake"} -penumbra-tct = {default-features = false, path = "crates/crypto/tct"} -penumbra-transaction = {default-features = false, path = "crates/core/transaction"} -penumbra-txhash = {default-features = false, path = "crates/core/txhash"} -penumbra-view = {path = "crates/view"} -penumbra-extension = { path = "crates/penumbra-extension", default-features = false } -pin-project = {version = "1.0.12"} -pin-project-lite = {version = "0.2.9"} -poseidon377 = {version = "0.6"} -proptest = {version = "1"} -proptest-derive = {version = "0.3"} -prost = {version = "0.12.3"} -prost-types = {version = "0.12"} -r2d2 = {version = "0.8"} -r2d2_sqlite = {version = "0.22"} -rand = {version = "0.8.5"} -rand_chacha = {version = "0.3.1"} -rand_core = {version = "0.6.4"} -regex = {version = "1.8.1"} -rocksdb = {version = "0.21.0"} -serde = {version = "1.0.186"} -serde_json = {version = "1.0.96"} -serde_unit_struct = {version = "0.1"} -serde_with = {version = "3.5.1"} -sha2 = {version = "0.10"} -tap = "1.0.1" -tempfile = {version = "3.3.0"} -tendermint = {default-features = false, version = "0.34.0"} -tendermint-config = {version = "0.34.0"} -tendermint-light-client-verifier = {version = "0.34.0"} -tendermint-proto = {version = "0.34.0"} -tendermint-rpc = {version = "0.34.0"} -thiserror = {version = "1.0"} -tokio = {version = "1.3"} -tokio-stream = {version = "0.1.8"} -tokio-util = {version = "0.7"} -toml = {version = "0.7"} -tonic = {version = "0.10"} -tonic-reflection = {version = "0.10.0"} -tonic-web = {version = "0.10.0"} -tower = {version = "0.4.0"} -tower-http = {version = "0.4"} -tower-service = {version = "0.3.2"} -tracing = {version = "0.1"} -tracing-subscriber = {version = "0.3.17", features = ["env-filter"]} -url = {version = "2.2"} +anyhow = { version = "1.0.75" } +ark-ec = { default-features = false, version = "0.4.2" } +ark-ff = { default-features = false, version = "0.4.2" } +ark-groth16 = { default-features = false, version = "0.4.0" } +ark-r1cs-std = { default-features = false, version = "0.4.0" } +ark-relations = { version = "0.4" } +ark-serialize = { version = "0.4.2" } +ark-snark = { version = "0.4.0" } +ark-std = { default-features = false, version = "0.4" } +assert_cmd = { version = "2.0" } +async-stream = { version = "0.3.5" } +async-trait = { version = "0.1.52" } +atty = { version = "0.2" } +axum = { version = "0.6" } +axum-server = { version = "0.4.7" } +base64 = { version = "0.21.2" } +bech32 = { version = "0.8.1" } +bincode = { version = "1.3.3" } +bitvec = { version = "1" } +blake2b_simd = { version = "1" } +bytes = { version = "1.2" } +camino = { version = "1" } +chacha20poly1305 = { version = "0.9.0" } +chrono = { default-features = false, version = "0.4" } +clap = { version = "3.2" } +cnidarium = { default-features = false, path = "crates/cnidarium" } +cnidarium-component = { default-features = false, path = "crates/cnidarium-component" } +console-subscriber = { version = "0.2" } +criterion = { version = "0.4" } +decaf377 = { default-features = false, version = "0.5" } +decaf377-fmd = { path = "crates/crypto/decaf377-fmd" } +decaf377-ka = { path = "crates/crypto/decaf377-ka" } +decaf377-rdsa = { version = "0.9" } +derivative = { version = "2.2" } +directories = { version = "4.0.1" } +ed25519-consensus = { version = "2.1" } +ethnum = { version = "1.3" } +futures = { version = "0.3.28" } +hex = { version = "0.4.3" } +http = { version = "0.2.9" } +http-body = { version = "0.4.5" } +ibc-proto = { default-features = false, version = "0.40.0" } +ibc-types = { default-features = false, version = "0.11.0" } +ibig = { version = "0.3" } +ics23 = { version = "0.11.0" } +im = { version = "^15.1.0" } +indicatif = { version = "0.16" } +jmt = { version = "0.9" } +metrics = { version = "0.22" } +metrics-tracing-context = { version = "0.15" } +num-bigint = { version = "0.4" } +num-traits = { default-features = false, version = "0.2.15" } +once_cell = { version = "1.8" } +parking_lot = { version = "0.12.1" } +pbjson = { version = "0.6" } +pbjson-types = { version = "0.6.0" } +penumbra-app = { path = "crates/core/app" } +penumbra-asset = { default-features = false, path = "crates/core/asset" } +penumbra-community-pool = { default-features = false, path = "crates/core/component/community-pool" } +penumbra-compact-block = { default-features = false, path = "crates/core/component/compact-block" } +penumbra-custody = { path = "crates/custody" } +penumbra-dex = { default-features = false, path = "crates/core/component/dex" } +penumbra-distributions = { default-features = false, path = "crates/core/component/distributions" } +penumbra-fee = { default-features = false, path = "crates/core/component/fee" } +penumbra-funding = { default-features = false, path = "crates/core/component/funding" } +penumbra-governance = { default-features = false, path = "crates/core/component/governance" } +penumbra-genesis = { path = "crates/core/genesis" } +penumbra-ibc = { default-features = false, path = "crates/core/component/ibc" } +penumbra-keys = { default-features = false, path = "crates/core/keys" } +penumbra-mock-client = { path = "crates/test/mock-client" } +penumbra-mock-consensus = { path = "crates/test/mock-consensus" } +penumbra-num = { default-features = false, path = "crates/core/num" } +penumbra-proof-params = { default-features = false, path = "crates/crypto/proof-params" } +penumbra-proof-setup = { path = "crates/crypto/proof-setup" } +penumbra-proto = { default-features = false, path = "crates/proto" } +penumbra-sct = { default-features = false, path = "crates/core/component/sct" } +penumbra-shielded-pool = { default-features = false, path = "crates/core/component/shielded-pool" } +penumbra-stake = { default-features = false, path = "crates/core/component/stake" } +penumbra-tct = { default-features = false, path = "crates/crypto/tct" } +penumbra-transaction = { default-features = false, path = "crates/core/transaction" } +penumbra-txhash = { default-features = false, path = "crates/core/txhash" } +penumbra-view = { path = "crates/view" } +penumbra-extension = { path = "crates/penumbra-extension", default-features = false } +pin-project = { version = "1.0.12" } +pin-project-lite = { version = "0.2.9" } +poseidon377 = { version = "0.6" } +proptest = { version = "1" } +proptest-derive = { version = "0.3" } +prost = { version = "0.12.3" } +prost-types = { version = "0.12" } +r2d2 = { version = "0.8" } +r2d2_sqlite = { version = "0.22" } +rand = { version = "0.8.5" } +rand_chacha = { version = "0.3.1" } +rand_core = { version = "0.6.4" } +regex = { version = "1.8.1" } +rocksdb = { version = "0.21.0" } +serde = { version = "1.0.186" } +serde_json = { version = "1.0.96" } +serde_unit_struct = { version = "0.1" } +serde_with = { version = "3.5.1" } +sha2 = { version = "0.10" } +tap = "1.0.1" +tempfile = { version = "3.3.0" } +tendermint = { default-features = false, version = "0.34.0" } +tendermint-config = { version = "0.34.0" } +tendermint-light-client-verifier = { version = "0.34.0" } +tendermint-proto = { version = "0.34.0" } +tendermint-rpc = { version = "0.34.0" } +thiserror = { version = "1.0" } +tokio = { version = "1.3" } +tokio-stream = { version = "0.1.8" } +tokio-util = { version = "0.7" } +toml = { version = "0.7" } +tonic = { version = "0.10" } +tonic-reflection = { version = "0.10.0" } +tonic-web = { version = "0.10.0" } +tower = { version = "0.4.0" } +tower-http = { version = "0.4" } +tower-service = { version = "0.3.2" } +tracing = { version = "0.1" } +tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } +url = { version = "2.2" } diff --git a/crates/core/component/stake/src/component/epoch_handler.rs b/crates/core/component/stake/src/component/epoch_handler.rs index 2cfc6da07c..72fe4cc483 100644 --- a/crates/core/component/stake/src/component/epoch_handler.rs +++ b/crates/core/component/stake/src/component/epoch_handler.rs @@ -18,11 +18,12 @@ use tokio::task::JoinSet; use tracing::instrument; use crate::state_key; +use crate::BPS_SQUARED_SCALING_FACTOR; use crate::{ component::{ stake::{ConsensusUpdateWrite, InternalStakingData, RateDataWrite}, validator_handler::{ValidatorDataRead, ValidatorDataWrite, ValidatorManager}, - SlashingData, FP_SCALING_FACTOR, + SlashingData, }, rate::BaseRateData, validator, CurrentConsensusKeys, DelegationToken, FundingStreams, IdentityKey, Penalty, @@ -387,7 +388,7 @@ pub trait EpochHandler: StateWriteExt + ConsensusIndexRead { let base_reward_rate = U128x128::ratio(issuance_budget_for_epoch, total_active_stake_previous_epoch) .expect("total active stake is nonzero"); - let base_reward_rate: Amount = (base_reward_rate * *FP_SCALING_FACTOR) + let base_reward_rate: Amount = (base_reward_rate * *BPS_SQUARED_SCALING_FACTOR) .expect("base reward rate is around one") .round_down() .try_into() diff --git a/crates/core/component/stake/src/component/mod.rs b/crates/core/component/stake/src/component/mod.rs index ad99d22adf..aa8da70564 100644 --- a/crates/core/component/stake/src/component/mod.rs +++ b/crates/core/component/stake/src/component/mod.rs @@ -1,19 +1,15 @@ pub mod action_handler; +mod epoch_handler; pub mod metrics; pub mod rpc; pub mod stake; pub mod validator_handler; -mod epoch_handler; - -use once_cell::sync::Lazy; +pub use self::metrics::register_metrics; pub use stake::Staking; + // Max validator power is 1152921504606846975 (i64::MAX / 8) // https://github.com/tendermint/tendermint/blob/master/types/validator_set.go#L25 pub const MAX_VOTING_POWER: u128 = 1152921504606846975; -pub static FP_SCALING_FACTOR: Lazy = - Lazy::new(|| 1_0000_0000u128.into()); - -pub use self::metrics::register_metrics; pub use stake::{ConsensusIndexRead, SlashingData}; pub use stake::{StateReadExt, StateWriteExt}; diff --git a/crates/core/component/stake/src/funding_stream.rs b/crates/core/component/stake/src/funding_stream.rs index 3e25016802..51de448c14 100644 --- a/crates/core/component/stake/src/funding_stream.rs +++ b/crates/core/component/stake/src/funding_stream.rs @@ -1,4 +1,4 @@ -use crate::component::FP_SCALING_FACTOR; +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}; @@ -50,7 +50,7 @@ impl FundingStream { impl FundingStream { /// Computes the amount of reward at the epoch boundary. /// The input rates are assumed to be in basis points squared, this means that - /// to get the actual rate, you need to rescale by [`FP_SCALING_FACTOR`]. + /// to get the actual rate, you need to rescale by [`BPS_SQUARED_SCALING_FACTOR`]. pub fn reward_amount( &self, base_reward_rate: Amount, @@ -66,10 +66,11 @@ impl FundingStream { // First, we remove the scaling factors: let commission_rate = (commission_rate_bps / max_bps).expect("nonzero divisor"); - let prev_validator_exchange_rate = - (prev_validator_exchange_rate_bps_sq / *FP_SCALING_FACTOR).expect("nonzero divisor"); + let prev_validator_exchange_rate = (prev_validator_exchange_rate_bps_sq + / *BPS_SQUARED_SCALING_FACTOR) + .expect("nonzero divisor"); let prev_base_reward_rate = - (prev_base_reward_rate_bps_sq / *FP_SCALING_FACTOR).expect("nonzero divisor"); + (prev_base_reward_rate_bps_sq / *BPS_SQUARED_SCALING_FACTOR).expect("nonzero divisor"); // The reward amount at epoch e, for validator v, is R_{v,e}. // It is computed as: diff --git a/crates/core/component/stake/src/lib.rs b/crates/core/component/stake/src/lib.rs index 26bb404c00..834032709e 100644 --- a/crates/core/component/stake/src/lib.rs +++ b/crates/core/component/stake/src/lib.rs @@ -14,7 +14,7 @@ pub mod component; #[cfg(feature = "component")] pub use component::StateReadExt; -pub static FP_SCALING_FACTOR: Lazy = +pub static BPS_SQUARED_SCALING_FACTOR: Lazy = Lazy::new(|| 1_0000_0000u128.into()); pub mod delegate; diff --git a/crates/core/component/stake/src/rate.rs b/crates/core/component/stake/src/rate.rs index 60e59b5876..4cc47b51e1 100644 --- a/crates/core/component/stake/src/rate.rs +++ b/crates/core/component/stake/src/rate.rs @@ -7,7 +7,7 @@ use penumbra_proto::{penumbra::core::component::stake::v1 as pb, DomainType}; use serde::{Deserialize, Serialize}; use crate::{validator::State, FundingStream, IdentityKey}; -use crate::{Delegate, Penalty, Undelegate, FP_SCALING_FACTOR}; +use crate::{Delegate, Penalty, Undelegate, BPS_SQUARED_SCALING_FACTOR}; /// Describes a validator's reward rate and voting power in some epoch. #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] @@ -54,7 +54,7 @@ impl RateData { // Rate data is represented with an implicit scaling factor of 1_0000_0000. // To make the calculations more readable, we use `U128x128` to represent // the intermediate descaled values. As a last step, we scaled them back - // using [`FP_SCALING_FACTOR`] and round down to an [`Amount`]. + // using [`BPS_SQUARED_SCALING_FACTOR`] and round down to an [`Amount`]. /* Setting up constants and unrolling scaling factors */ let one = U128x128::from(1u128); @@ -67,10 +67,10 @@ impl RateData { let validator_commission = (validator_commission_bps / max_bps).expect("max_bps is nonzero"); - let next_base_reward_rate = - (next_base_reward_rate / *FP_SCALING_FACTOR).expect("scaling factor is nonzero"); + let next_base_reward_rate = (next_base_reward_rate / *BPS_SQUARED_SCALING_FACTOR) + .expect("scaling factor is nonzero"); let previous_validator_exchange_rate = (previous_validator_exchange_rate - / *FP_SCALING_FACTOR) + / *BPS_SQUARED_SCALING_FACTOR) .expect("scaling factor is nonzero"); /* ************************************************* */ @@ -97,12 +97,14 @@ impl RateData { /* ***************************************************************** */ /* Rescale the rate data using the fixed point scaling factor */ - let next_validator_reward_rate = (next_validator_reward_rate * *FP_SCALING_FACTOR) + let next_validator_reward_rate = (next_validator_reward_rate + * *BPS_SQUARED_SCALING_FACTOR) .expect("rate is between 0 and 1") .round_down() .try_into() .expect("rounding down gives an integral type"); - let next_validator_exchange_rate = (next_validator_exchange_rate * *FP_SCALING_FACTOR) + let next_validator_exchange_rate = (next_validator_exchange_rate + * *BPS_SQUARED_SCALING_FACTOR) .expect("rate is between 0 and 1") .round_down() .try_into() @@ -146,8 +148,8 @@ impl RateData { let validator_exchange_rate = U128x128::from(self.validator_exchange_rate); // Remove scaling factors: - let validator_exchange_rate = - (validator_exchange_rate / *FP_SCALING_FACTOR).expect("scaling factor is nonzero"); + let validator_exchange_rate = (validator_exchange_rate / *BPS_SQUARED_SCALING_FACTOR) + .expect("scaling factor is nonzero"); if validator_exchange_rate == U128x128::from(0u128) { // If the exchange rate is zero, the delegation amount is also zero. // This is extremely unlikely to be hit in practice, but it's a valid @@ -199,8 +201,8 @@ impl RateData { let validator_exchange_rate = U128x128::from(self.validator_exchange_rate); // Remove scaling factors: - let validator_exchange_rate = - (validator_exchange_rate / *FP_SCALING_FACTOR).expect("scaling factor is nonzero"); + let validator_exchange_rate = (validator_exchange_rate / *BPS_SQUARED_SCALING_FACTOR) + .expect("scaling factor is nonzero"); /* **************** Compute the unbonded amount *********************** */ (delegation_amount * validator_exchange_rate) @@ -217,8 +219,8 @@ impl RateData { let validator_exchange_rate = U128x128::from(self.validator_exchange_rate); // Remove scaling factors: - let validator_exchange_rate = - (validator_exchange_rate / *FP_SCALING_FACTOR).expect("scaling factor is nonzero"); + let validator_exchange_rate = (validator_exchange_rate / *BPS_SQUARED_SCALING_FACTOR) + .expect("scaling factor is nonzero"); /* ************************ Convert the delegation tokens to staking tokens ******************** */ let voting_power = (delegation_pool_size * validator_exchange_rate) @@ -276,10 +278,10 @@ impl BaseRateData { let one = U128x128::from(1u128); // Remove scaling factors: - let prev_base_exchange_rate = - (prev_base_exchange_rate / *FP_SCALING_FACTOR).expect("scaling factor is nonzero"); - let next_base_reward_rate_fp = - (next_base_reward_rate / *FP_SCALING_FACTOR).expect("scaling factor is nonzero"); + let prev_base_exchange_rate = (prev_base_exchange_rate / *BPS_SQUARED_SCALING_FACTOR) + .expect("scaling factor is nonzero"); + let next_base_reward_rate_fp = (next_base_reward_rate / *BPS_SQUARED_SCALING_FACTOR) + .expect("scaling factor is nonzero"); // Compute the reward growth factor: let reward_growth_factor = (one + next_base_reward_rate_fp).expect("does not overflow"); @@ -290,7 +292,8 @@ impl BaseRateData { /* ****************************************************************************** */ // Rescale the exchange rate: - let next_base_exchange_rate_scaled = (next_base_exchange_rate * *FP_SCALING_FACTOR) + let next_base_exchange_rate_scaled = (next_base_exchange_rate + * *BPS_SQUARED_SCALING_FACTOR) .expect("rate is between 0 and 1") .round_down() .try_into() diff --git a/docs/guide/src/penumbra_version.md b/docs/guide/src/penumbra_version.md index 846e52e485..7668bd72f4 100644 --- a/docs/guide/src/penumbra_version.md +++ b/docs/guide/src/penumbra_version.md @@ -1 +1 @@ -v0.68.0-alpha.1 +v0.68.0-alpha.2