From 89b6667c75f197ff66f3ef83a64b103a78107e30 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Fri, 12 Aug 2022 12:50:17 +0100 Subject: [PATCH 1/9] Splitting changelogs into their own files --- CHANGELOG.md | 229 --------------------------------------- contracts/CHANGELOG.md | 32 ++++++ nym-connect/CHANGELOG.md | 14 +++ nym-wallet/CHANGELOG.md | 183 +++++++++++++++++++++++++++++++ 4 files changed, 229 insertions(+), 229 deletions(-) create mode 100644 contracts/CHANGELOG.md create mode 100644 nym-connect/CHANGELOG.md create mode 100644 nym-wallet/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index bbb1fff18b..04e7241d53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - ## [nym-binaries-1.0.2](https://github.com/nymtech/nym/tree/nym-binaries-1.0.2) ### Added @@ -84,90 +83,6 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// [#1503]: https://github.com/nymtech/nym/pull/1503 [#1520]: https://github.com/nymtech/nym/pull/1520 -## [nym-connect-v1.0.1](https://github.com/nymtech/nym/tree/nym-connect-v1.0.1) (2022-07-22) - -### Added - -- nym-connect: initial proof-of-concept of a UI around the socks5 client was added -- nym-connect: add ability to select network requester and gateway ([#1427]) -- nym-connect: add ability to export gateway keys as JSON -- nym-connect: add auto updater - -### Changed - -- nym-connect: reuse config id instead of creating a new id on each connection - -[#1427]: https://github.com/nymtech/nym/pull/1427 - -## [nym-wallet-v1.0.7](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.7) (2022-07-11) - -- wallet: dark mode -- wallet: when simulating gas costs, an automatic adjustment is being used ([#1388]). - -[#1388]: https://github.com/nymtech/nym/pull/1388 - -## [nym-contracts-v1.0.1](https://github.com/nymtech/nym/tree/nym-contracts-v1.0.1) (2022-06-22) - -### Added - -- mixnet-contract: Added ClaimOperatorReward and ClaimDelegatorReward messages ([#1292]) -- mixnet-contract: Replace all naked `-` with `saturating_sub`. -- mixnet-contract: Added staking_supply field to ContractStateParams. -- mixnet-contract: Added a query to get MixnodeBond by identity key ([#1369]). -- mixnet-contract: Added a query to get GatewayBond by identity key ([#1369]). -- vesting-contract: Added ClaimOperatorReward and ClaimDelegatorReward messages ([#1292]) -- vesting-contract: Added limit to the amount of tokens one can pledge ([#1331]) - -### Fixed - -- mixnet-contract: `estimated_delegator_reward` calculation ([#1284]) -- mixnet-contract: delegator and operator rewards use lambda and sigma instead of lambda_ticked and sigma_ticked ([#1284]) -- mixnet-contract: removed `expect` in `query_delegator_reward` and queries containing invalid proxy address should now return a more human-readable error ([#1257]) -- mixnet-contract: replaced integer division with fixed for performance calculations ([#1284]) -- mixnet-contract: Under certain circumstances nodes could not be unbonded ([#1255](https://github.com/nymtech/nym/issues/1255)) ([#1258]) -- mixnet-contract: Using correct staking supply when distributing rewards. ([#1373]) -- vesting-contract: replaced `checked_sub` with `saturating_sub` to fix the underflow in `get_vesting_tokens` ([#1275]) - - -[#1255]: https://github.com/nymtech/nym/pull/1255 -[#1257]: https://github.com/nymtech/nym/pull/1257 -[#1258]: https://github.com/nymtech/nym/pull/1258 -[#1275]: https://github.com/nymtech/nym/pull/1275 -[#1284]: https://github.com/nymtech/nym/pull/1284 -[#1292]: https://github.com/nymtech/nym/pull/1292 -[#1331]: https://github.com/nymtech/nym/pull/1331 -[#1369]: https://github.com/nymtech/nym/pull/1369 -[#1373]: https://github.com/nymtech/nym/pull/1373 - -## [nym-wallet-v1.0.6](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.6) (2022-06-21) - -- wallet: undelegating now uses either the mixnet or vesting contract, or both, depending on how delegations were made -- wallet: redeeming and compounding now uses both the mixnet and vesting contract -- wallet: the wallet backend learned how to archive wallet files -- wallet: add ENABLE_QA_MODE environment variable to enable QA mode on built wallet - -## [nym-wallet-v1.0.5](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.5) (2022-06-14) - -- wallet: add simple CLI tool for decrypting and recovering the wallet file. -- wallet: added support for multiple accounts ([#1265]) -- wallet: compound and claim reward endpoints for operators and delegators ([#1302]) -- wallet: require password to switch accounts -- wallet: the wallet backend learned how to keep track of validator name, either hardcoded or by querying the status endpoint. -- wallet: new delegation and rewards UI -- wallet: show version in nav bar -- wallet: contract admin route put back -- wallet: staking_supply field to StateParams -- wallet: show transaction hash for redeeming or compounding rewards - -[#1265]: https://github.com/nymtech/nym/pull/1265 -[#1302]: https://github.com/nymtech/nym/pull/1302 - -## [nym-wallet-v1.0.4](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.4) (2022-05-04) - -### Changed - -- all: the default behaviour of validator client is changed to use `broadcast_sync` and poll for transaction inclusion instead of using `broadcast_commit` to deal with timeouts ([#1246]) - ## [v1.0.1](https://github.com/nymtech/nym/tree/v1.0.1) (2022-05-04) ### Added @@ -199,38 +114,7 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// [Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.3...nym-binaries-1.0.0) -## [nym-wallet-v1.0.3](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.3) (2022-04-25) -[Full Changelog](https://github.com/nymtech/nym/compare/nym-binaries-1.0.0-rc.2...nym-wallet-v1.0.3) - -**Fixed bugs:** - -- \[Issue\] Wallet 1.0.2 cannot send NYM tokens from a DelayedVestingAccount [\#1215](https://github.com/nymtech/nym/issues/1215) -- Main README not showing properly with GitHub dark mode [\#1211](https://github.com/nymtech/nym/issues/1211) - -**Merged pull requests:** - -- Bugfix - wallet undelegation for vesting accounts [\#1220](https://github.com/nymtech/nym/pull/1220) ([mmsinclair](https://github.com/mmsinclair)) -- Bugfix/delegation reconcile [\#1219](https://github.com/nymtech/nym/pull/1219) ([jstuczyn](https://github.com/jstuczyn)) -- Bugfix/query proxied pending delegations [\#1218](https://github.com/nymtech/nym/pull/1218) ([jstuczyn](https://github.com/jstuczyn)) -- Using custom gas multiplier in the wallet [\#1217](https://github.com/nymtech/nym/pull/1217) ([jstuczyn](https://github.com/jstuczyn)) -- Feature/vesting accounts support [\#1216](https://github.com/nymtech/nym/pull/1216) ([jstuczyn](https://github.com/jstuczyn)) -- Release/1.0.0 rc.2 [\#1214](https://github.com/nymtech/nym/pull/1214) ([jstuczyn](https://github.com/jstuczyn)) -- chore: fix dark mode rendering [\#1212](https://github.com/nymtech/nym/pull/1212) ([pwnfoo](https://github.com/pwnfoo)) -- Feature/spend coconut [\#1210](https://github.com/nymtech/nym/pull/1210) ([neacsu](https://github.com/neacsu)) -- Bugfix/unique sphinx key [\#1207](https://github.com/nymtech/nym/pull/1207) ([jstuczyn](https://github.com/jstuczyn)) -- Add cache read and write timeouts [\#1206](https://github.com/nymtech/nym/pull/1206) ([durch](https://github.com/durch)) -- Additional, more informative routes [\#1204](https://github.com/nymtech/nym/pull/1204) ([durch](https://github.com/durch)) -- Feature/aggregated econ dynamics explorer endpoint [\#1203](https://github.com/nymtech/nym/pull/1203) ([jstuczyn](https://github.com/jstuczyn)) -- Debugging validator [\#1198](https://github.com/nymtech/nym/pull/1198) ([durch](https://github.com/durch)) -- wallet: expose additional validator configuration functionality to the frontend [\#1195](https://github.com/nymtech/nym/pull/1195) ([octol](https://github.com/octol)) -- Update rewarding validator address [\#1193](https://github.com/nymtech/nym/pull/1193) ([durch](https://github.com/durch)) -- Crypto part of the Groth's NIDKG [\#1182](https://github.com/nymtech/nym/pull/1182) ([jstuczyn](https://github.com/jstuczyn)) -- fix unbond page [\#1180](https://github.com/nymtech/nym/pull/1180) ([tommyv1987](https://github.com/tommyv1987)) -- Type safe bounds [\#1179](https://github.com/nymtech/nym/pull/1179) ([durch](https://github.com/durch)) -- Fix delegation paging [\#1174](https://github.com/nymtech/nym/pull/1174) ([durch](https://github.com/durch)) -- Update binaries to rc version [\#1172](https://github.com/nymtech/nym/pull/1172) ([tommyv1987](https://github.com/tommyv1987)) -- Bump ansi-regex from 4.1.0 to 4.1.1 in /docker/typescript\_client/upload\_contract [\#1171](https://github.com/nymtech/nym/pull/1171) ([dependabot[bot]](https://github.com/apps/dependabot)) ## [nym-binaries-1.0.0-rc.2](https://github.com/nymtech/nym/tree/nym-binaries-1.0.0-rc.2) (2022-04-15) @@ -259,17 +143,6 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// - wallet: wire up account storage [\#1153](https://github.com/nymtech/nym/pull/1153) ([octol](https://github.com/octol)) - Feature/signature on deposit [\#1151](https://github.com/nymtech/nym/pull/1151) ([neacsu](https://github.com/neacsu)) -## [nym-wallet-v1.0.1](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.1) (2022-04-05) - -[Full Changelog](https://github.com/nymtech/nym/compare/nym-binaries-1.0.0-rc.1...nym-wallet-v1.0.1) - -**Closed issues:** - -- Check enabling bbbc simultaneously with open access. Estimate what it would take to make this the default compilation target. [\#1175](https://github.com/nymtech/nym/issues/1175) -- Get coconut credential for deposited tokens [\#1138](https://github.com/nymtech/nym/issues/1138) -- Make payments lazy [\#1135](https://github.com/nymtech/nym/issues/1135) -- Uptime on node selection for sets [\#1049](https://github.com/nymtech/nym/issues/1049) - ## [nym-binaries-1.0.0-rc.1](https://github.com/nymtech/nym/tree/nym-binaries-1.0.0-rc.1) (2022-03-28) [Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.0...nym-binaries-1.0.0-rc.1) @@ -348,108 +221,6 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// - feature/pedersen-commitments [\#1048](https://github.com/nymtech/nym/pull/1048) ([danielementary](https://github.com/danielementary)) - Feature/reuse init owner [\#970](https://github.com/nymtech/nym/pull/970) ([neacsu](https://github.com/neacsu)) -## [nym-wallet-v1.0.0](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.0) (2022-02-03) - -[Full Changelog](https://github.com/nymtech/nym/compare/v0.12.1...nym-wallet-v1.0.0) - -**Implemented enhancements:** - -- \[Feature Request\] Please enable registration without need for Telegram account [\#1016](https://github.com/nymtech/nym/issues/1016) -- Fast mixnode launch with a pre-built ISO + VM software [\#1001](https://github.com/nymtech/nym/issues/1001) - -**Fixed bugs:** - -- \[Issue\] [\#1000](https://github.com/nymtech/nym/issues/1000) -- \[Issue\] `nym-client` requires multiple attempts to run a server [\#869](https://github.com/nymtech/nym/issues/869) -- De-'float'-ing `Interval` \(`Display` impl + `serde`\) [\#1065](https://github.com/nymtech/nym/pull/1065) ([jstuczyn](https://github.com/jstuczyn)) -- display client address on wallet creation [\#1058](https://github.com/nymtech/nym/pull/1058) ([fmtabbara](https://github.com/fmtabbara)) - -**Closed issues:** - -- Rewarded set inclusion probability API endpoint [\#1037](https://github.com/nymtech/nym/issues/1037) -- Update cw-storage-plus to 0.11 [\#1032](https://github.com/nymtech/nym/issues/1032) -- Change `u128` fields in `RewardEstimationResponse` to `u64` [\#1029](https://github.com/nymtech/nym/issues/1029) -- Test out the mainnet Gravity Bridge [\#1006](https://github.com/nymtech/nym/issues/1006) -- Add vesting contract interface to nym-wallet [\#959](https://github.com/nymtech/nym/issues/959) -- Mixnode crash [\#486](https://github.com/nymtech/nym/issues/486) - -**Merged pull requests:** - -- create custom urls for mainnet [\#1095](https://github.com/nymtech/nym/pull/1095) ([fmtabbara](https://github.com/fmtabbara)) -- Wallet signing on MacOS [\#1093](https://github.com/nymtech/nym/pull/1093) ([mmsinclair](https://github.com/mmsinclair)) -- Fix rust 2018 idioms warnings [\#1092](https://github.com/nymtech/nym/pull/1092) ([octol](https://github.com/octol)) -- Prevent contract overwriting [\#1090](https://github.com/nymtech/nym/pull/1090) ([durch](https://github.com/durch)) -- Logout operation [\#1087](https://github.com/nymtech/nym/pull/1087) ([jstuczyn](https://github.com/jstuczyn)) -- Update to rust edition 2021 everywhere [\#1086](https://github.com/nymtech/nym/pull/1086) ([octol](https://github.com/octol)) -- Tag contract errors, and print out lines for easier QA [\#1084](https://github.com/nymtech/nym/pull/1084) ([durch](https://github.com/durch)) -- Feature/flexible vesting + utility queries [\#1083](https://github.com/nymtech/nym/pull/1083) ([durch](https://github.com/durch)) -- Bump @openzeppelin/contracts from 4.3.1 to 4.4.2 in /contracts/basic-bandwidth-generation [\#1082](https://github.com/nymtech/nym/pull/1082) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Bump nth-check from 2.0.0 to 2.0.1 in /clients/native/examples/js-examples/websocket [\#1081](https://github.com/nymtech/nym/pull/1081) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Bump url-parse from 1.5.1 to 1.5.4 in /clients/native/examples/js-examples/websocket [\#1080](https://github.com/nymtech/nym/pull/1080) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Bump follow-redirects from 1.14.1 to 1.14.7 in /clients/native/examples/js-examples/websocket [\#1079](https://github.com/nymtech/nym/pull/1079) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Bump nanoid from 3.1.23 to 3.2.0 in /clients/native/examples/js-examples/websocket [\#1078](https://github.com/nymtech/nym/pull/1078) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Setup basic test for mixnode stats reporting [\#1077](https://github.com/nymtech/nym/pull/1077) ([octol](https://github.com/octol)) -- Make wallet\_address mandatory for mixnode init [\#1076](https://github.com/nymtech/nym/pull/1076) ([octol](https://github.com/octol)) -- Tidy nym-mixnode module visibility [\#1075](https://github.com/nymtech/nym/pull/1075) ([octol](https://github.com/octol)) -- Feature/wallet login with password [\#1074](https://github.com/nymtech/nym/pull/1074) ([fmtabbara](https://github.com/fmtabbara)) -- Add trait to mock client dependency in DelayForwarder [\#1073](https://github.com/nymtech/nym/pull/1073) ([octol](https://github.com/octol)) -- Bump rust-version to latest stable for nym-mixnode [\#1072](https://github.com/nymtech/nym/pull/1072) ([octol](https://github.com/octol)) -- Fixes CI for our wasm build [\#1069](https://github.com/nymtech/nym/pull/1069) ([jstuczyn](https://github.com/jstuczyn)) -- Add @octol as codeowner [\#1068](https://github.com/nymtech/nym/pull/1068) ([octol](https://github.com/octol)) -- set-up inclusion probability [\#1067](https://github.com/nymtech/nym/pull/1067) ([fmtabbara](https://github.com/fmtabbara)) -- Feature/wasm client [\#1066](https://github.com/nymtech/nym/pull/1066) ([neacsu](https://github.com/neacsu)) -- Changed bech32\_prefix from punk to nymt [\#1064](https://github.com/nymtech/nym/pull/1064) ([jstuczyn](https://github.com/jstuczyn)) -- Bump nanoid from 3.1.30 to 3.2.0 in /testnet-faucet [\#1063](https://github.com/nymtech/nym/pull/1063) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Bump nanoid from 3.1.30 to 3.2.0 in /nym-wallet [\#1062](https://github.com/nymtech/nym/pull/1062) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Rework vesting contract storage [\#1061](https://github.com/nymtech/nym/pull/1061) ([durch](https://github.com/durch)) -- Mixnet Contract constants extraction [\#1060](https://github.com/nymtech/nym/pull/1060) ([jstuczyn](https://github.com/jstuczyn)) -- fix: make explorer footer year dynamic [\#1059](https://github.com/nymtech/nym/pull/1059) ([martinyung](https://github.com/martinyung)) -- Add mnemonic just on creation, to display it [\#1057](https://github.com/nymtech/nym/pull/1057) ([neacsu](https://github.com/neacsu)) -- Network Explorer: updates to API and UI to show the active set [\#1056](https://github.com/nymtech/nym/pull/1056) ([mmsinclair](https://github.com/mmsinclair)) -- Made contract addresses for query NymdClient construction optional [\#1055](https://github.com/nymtech/nym/pull/1055) ([jstuczyn](https://github.com/jstuczyn)) -- Introduced RPC query for total token supply [\#1053](https://github.com/nymtech/nym/pull/1053) ([jstuczyn](https://github.com/jstuczyn)) -- Feature/tokio console [\#1052](https://github.com/nymtech/nym/pull/1052) ([durch](https://github.com/durch)) -- Implemented beta clippy lint recommendations [\#1051](https://github.com/nymtech/nym/pull/1051) ([jstuczyn](https://github.com/jstuczyn)) -- add new function to update profit percentage [\#1050](https://github.com/nymtech/nym/pull/1050) ([fmtabbara](https://github.com/fmtabbara)) -- Upgrade Clap and use declarative argument parsing for nym-mixnode [\#1047](https://github.com/nymtech/nym/pull/1047) ([octol](https://github.com/octol)) -- Feature/additional bond validation [\#1046](https://github.com/nymtech/nym/pull/1046) ([fmtabbara](https://github.com/fmtabbara)) -- Fix clippy on relevant lints [\#1044](https://github.com/nymtech/nym/pull/1044) ([neacsu](https://github.com/neacsu)) -- Bump shelljs from 0.8.4 to 0.8.5 in /contracts/basic-bandwidth-generation [\#1043](https://github.com/nymtech/nym/pull/1043) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Endpoint for rewarded set inclusion probabilities [\#1042](https://github.com/nymtech/nym/pull/1042) ([durch](https://github.com/durch)) -- Bump follow-redirects from 1.14.4 to 1.14.7 in /contracts/basic-bandwidth-generation [\#1041](https://github.com/nymtech/nym/pull/1041) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Bump follow-redirects from 1.14.5 to 1.14.7 in /testnet-faucet [\#1040](https://github.com/nymtech/nym/pull/1040) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Feature/node settings update [\#1036](https://github.com/nymtech/nym/pull/1036) ([fmtabbara](https://github.com/fmtabbara)) -- Migrate to cw-storage-plus 0.11.1 [\#1035](https://github.com/nymtech/nym/pull/1035) ([durch](https://github.com/durch)) -- Bump @openzeppelin/contracts from 4.4.1 to 4.4.2 in /contracts/basic-bandwidth-generation [\#1034](https://github.com/nymtech/nym/pull/1034) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Feature/configurable wallet [\#1033](https://github.com/nymtech/nym/pull/1033) ([neacsu](https://github.com/neacsu)) -- Feature/downcast reward estimation [\#1031](https://github.com/nymtech/nym/pull/1031) ([durch](https://github.com/durch)) -- Wallet UI updates [\#1028](https://github.com/nymtech/nym/pull/1028) ([fmtabbara](https://github.com/fmtabbara)) -- Remove migration code [\#1027](https://github.com/nymtech/nym/pull/1027) ([neacsu](https://github.com/neacsu)) -- Chore/stricter dependency requirements [\#1025](https://github.com/nymtech/nym/pull/1025) ([jstuczyn](https://github.com/jstuczyn)) -- Feature/validator api client endpoints [\#1024](https://github.com/nymtech/nym/pull/1024) ([jstuczyn](https://github.com/jstuczyn)) -- Updated cosmrs to 0.4.1 [\#1023](https://github.com/nymtech/nym/pull/1023) ([jstuczyn](https://github.com/jstuczyn)) -- Feature/testnet deploy scripts [\#1022](https://github.com/nymtech/nym/pull/1022) ([mfahampshire](https://github.com/mfahampshire)) -- Changed wallet's client to a full validator client [\#1021](https://github.com/nymtech/nym/pull/1021) ([jstuczyn](https://github.com/jstuczyn)) -- Fix 404 link [\#1020](https://github.com/nymtech/nym/pull/1020) ([RiccardoMasutti](https://github.com/RiccardoMasutti)) -- Feature/additional mixnode endpoints [\#1019](https://github.com/nymtech/nym/pull/1019) ([jstuczyn](https://github.com/jstuczyn)) -- Introduced denom check when trying to withdraw vested coins [\#1018](https://github.com/nymtech/nym/pull/1018) ([jstuczyn](https://github.com/jstuczyn)) -- Add network defaults for qa [\#1017](https://github.com/nymtech/nym/pull/1017) ([neacsu](https://github.com/neacsu)) -- Feature/expanded events [\#1015](https://github.com/nymtech/nym/pull/1015) ([jstuczyn](https://github.com/jstuczyn)) -- update frontend to use new profit update api [\#1014](https://github.com/nymtech/nym/pull/1014) ([fmtabbara](https://github.com/fmtabbara)) -- Feature/node state endpoint [\#1013](https://github.com/nymtech/nym/pull/1013) ([jstuczyn](https://github.com/jstuczyn)) -- Feature/hourly set updates [\#1012](https://github.com/nymtech/nym/pull/1012) ([durch](https://github.com/durch)) -- Feature/remove unused profit margin [\#1011](https://github.com/nymtech/nym/pull/1011) ([neacsu](https://github.com/neacsu)) -- Feature/explorer node status [\#1010](https://github.com/nymtech/nym/pull/1010) ([jstuczyn](https://github.com/jstuczyn)) -- Use serial integer instead of random [\#1009](https://github.com/nymtech/nym/pull/1009) ([durch](https://github.com/durch)) -- Feature/configure profit [\#1008](https://github.com/nymtech/nym/pull/1008) ([neacsu](https://github.com/neacsu)) -- Feature/fix gateway sign [\#1004](https://github.com/nymtech/nym/pull/1004) ([neacsu](https://github.com/neacsu)) -- Fix clippy [\#1003](https://github.com/nymtech/nym/pull/1003) ([neacsu](https://github.com/neacsu)) -- Update wallet version [\#998](https://github.com/nymtech/nym/pull/998) ([tommyv1987](https://github.com/tommyv1987)) -- Fix wallet build instructions [\#997](https://github.com/nymtech/nym/pull/997) ([tommyv1987](https://github.com/tommyv1987)) -- Make the separation between testnet-mode and erc20 bandwidth mode clearer [\#994](https://github.com/nymtech/nym/pull/994) ([neacsu](https://github.com/neacsu)) -- Bump @openzeppelin/contracts from 3.4.0 to 4.4.1 in /contracts/basic-bandwidth-generation [\#983](https://github.com/nymtech/nym/pull/983) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Feature/implicit runtime [\#973](https://github.com/nymtech/nym/pull/973) ([jstuczyn](https://github.com/jstuczyn)) -- Differentiate staking and ownership [\#961](https://github.com/nymtech/nym/pull/961) ([durch](https://github.com/durch)) ## [v0.12.1](https://github.com/nymtech/nym/tree/v0.12.1) (2021-12-23) diff --git a/contracts/CHANGELOG.md b/contracts/CHANGELOG.md new file mode 100644 index 0000000000..bed698076b --- /dev/null +++ b/contracts/CHANGELOG.md @@ -0,0 +1,32 @@ +## [nym-contracts-v1.0.1](https://github.com/nymtech/nym/tree/nym-contracts-v1.0.1) (2022-06-22) + +### Added + +- mixnet-contract: Added ClaimOperatorReward and ClaimDelegatorReward messages ([#1292]) +- mixnet-contract: Replace all naked `-` with `saturating_sub`. +- mixnet-contract: Added staking_supply field to ContractStateParams. +- mixnet-contract: Added a query to get MixnodeBond by identity key ([#1369]). +- mixnet-contract: Added a query to get GatewayBond by identity key ([#1369]). +- vesting-contract: Added ClaimOperatorReward and ClaimDelegatorReward messages ([#1292]) +- vesting-contract: Added limit to the amount of tokens one can pledge ([#1331]) + +### Fixed + +- mixnet-contract: `estimated_delegator_reward` calculation ([#1284]) +- mixnet-contract: delegator and operator rewards use lambda and sigma instead of lambda_ticked and sigma_ticked ([#1284]) +- mixnet-contract: removed `expect` in `query_delegator_reward` and queries containing invalid proxy address should now return a more human-readable error ([#1257]) +- mixnet-contract: replaced integer division with fixed for performance calculations ([#1284]) +- mixnet-contract: Under certain circumstances nodes could not be unbonded ([#1255](https://github.com/nymtech/nym/issues/1255)) ([#1258]) +- mixnet-contract: Using correct staking supply when distributing rewards. ([#1373]) +- vesting-contract: replaced `checked_sub` with `saturating_sub` to fix the underflow in `get_vesting_tokens` ([#1275]) + + +[#1255]: https://github.com/nymtech/nym/pull/1255 +[#1257]: https://github.com/nymtech/nym/pull/1257 +[#1258]: https://github.com/nymtech/nym/pull/1258 +[#1275]: https://github.com/nymtech/nym/pull/1275 +[#1284]: https://github.com/nymtech/nym/pull/1284 +[#1292]: https://github.com/nymtech/nym/pull/1292 +[#1331]: https://github.com/nymtech/nym/pull/1331 +[#1369]: https://github.com/nymtech/nym/pull/1369 +[#1373]: https://github.com/nymtech/nym/pull/1373 \ No newline at end of file diff --git a/nym-connect/CHANGELOG.md b/nym-connect/CHANGELOG.md new file mode 100644 index 0000000000..0baec4fd35 --- /dev/null +++ b/nym-connect/CHANGELOG.md @@ -0,0 +1,14 @@ +## [nym-connect-v1.0.1](https://github.com/nymtech/nym/tree/nym-connect-v1.0.1) (2022-07-22) + +### Added + +- nym-connect: initial proof-of-concept of a UI around the socks5 client was added +- nym-connect: add ability to select network requester and gateway ([#1427]) +- nym-connect: add ability to export gateway keys as JSON +- nym-connect: add auto updater + +### Changed + +- nym-connect: reuse config id instead of creating a new id on each connection + +[#1427]: https://github.com/nymtech/nym/pull/1427 \ No newline at end of file diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md new file mode 100644 index 0000000000..8c8ea9ba9f --- /dev/null +++ b/nym-wallet/CHANGELOG.md @@ -0,0 +1,183 @@ +## [nym-wallet-v1.0.7](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.7) (2022-07-11) + +- wallet: dark mode +- wallet: when simulating gas costs, an automatic adjustment is being used ([#1388]). + +[#1388]: https://github.com/nymtech/nym/pull/1388 + + +## [nym-wallet-v1.0.6](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.6) (2022-06-21) + +- wallet: undelegating now uses either the mixnet or vesting contract, or both, depending on how delegations were made +- wallet: redeeming and compounding now uses both the mixnet and vesting contract +- wallet: the wallet backend learned how to archive wallet files +- wallet: add ENABLE_QA_MODE environment variable to enable QA mode on built wallet + +## [nym-wallet-v1.0.5](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.5) (2022-06-14) + +- wallet: add simple CLI tool for decrypting and recovering the wallet file. +- wallet: added support for multiple accounts ([#1265]) +- wallet: compound and claim reward endpoints for operators and delegators ([#1302]) +- wallet: require password to switch accounts +- wallet: the wallet backend learned how to keep track of validator name, either hardcoded or by querying the status endpoint. +- wallet: new delegation and rewards UI +- wallet: show version in nav bar +- wallet: contract admin route put back +- wallet: staking_supply field to StateParams +- wallet: show transaction hash for redeeming or compounding rewards + +[#1265]: https://github.com/nymtech/nym/pull/1265 +[#1302]: https://github.com/nymtech/nym/pull/1302 + +## [nym-wallet-v1.0.4](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.4) (2022-05-04) + +### Changed + +- all: the default behaviour of validator client is changed to use `broadcast_sync` and poll for transaction inclusion instead of using `broadcast_commit` to deal with timeouts ([#1246]) + +## [nym-wallet-v1.0.3](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.3) (2022-04-25) + +[Full Changelog](https://github.com/nymtech/nym/compare/nym-binaries-1.0.0-rc.2...nym-wallet-v1.0.3) + +**Fixed bugs:** + +- \[Issue\] Wallet 1.0.2 cannot send NYM tokens from a DelayedVestingAccount [\#1215](https://github.com/nymtech/nym/issues/1215) +- Main README not showing properly with GitHub dark mode [\#1211](https://github.com/nymtech/nym/issues/1211) + +**Merged pull requests:** + +- Bugfix - wallet undelegation for vesting accounts [\#1220](https://github.com/nymtech/nym/pull/1220) ([mmsinclair](https://github.com/mmsinclair)) +- Bugfix/delegation reconcile [\#1219](https://github.com/nymtech/nym/pull/1219) ([jstuczyn](https://github.com/jstuczyn)) +- Bugfix/query proxied pending delegations [\#1218](https://github.com/nymtech/nym/pull/1218) ([jstuczyn](https://github.com/jstuczyn)) +- Using custom gas multiplier in the wallet [\#1217](https://github.com/nymtech/nym/pull/1217) ([jstuczyn](https://github.com/jstuczyn)) +- Feature/vesting accounts support [\#1216](https://github.com/nymtech/nym/pull/1216) ([jstuczyn](https://github.com/jstuczyn)) +- Release/1.0.0 rc.2 [\#1214](https://github.com/nymtech/nym/pull/1214) ([jstuczyn](https://github.com/jstuczyn)) +- chore: fix dark mode rendering [\#1212](https://github.com/nymtech/nym/pull/1212) ([pwnfoo](https://github.com/pwnfoo)) +- Feature/spend coconut [\#1210](https://github.com/nymtech/nym/pull/1210) ([neacsu](https://github.com/neacsu)) +- Bugfix/unique sphinx key [\#1207](https://github.com/nymtech/nym/pull/1207) ([jstuczyn](https://github.com/jstuczyn)) +- Add cache read and write timeouts [\#1206](https://github.com/nymtech/nym/pull/1206) ([durch](https://github.com/durch)) +- Additional, more informative routes [\#1204](https://github.com/nymtech/nym/pull/1204) ([durch](https://github.com/durch)) +- Feature/aggregated econ dynamics explorer endpoint [\#1203](https://github.com/nymtech/nym/pull/1203) ([jstuczyn](https://github.com/jstuczyn)) +- Debugging validator [\#1198](https://github.com/nymtech/nym/pull/1198) ([durch](https://github.com/durch)) +- wallet: expose additional validator configuration functionality to the frontend [\#1195](https://github.com/nymtech/nym/pull/1195) ([octol](https://github.com/octol)) +- Update rewarding validator address [\#1193](https://github.com/nymtech/nym/pull/1193) ([durch](https://github.com/durch)) +- Crypto part of the Groth's NIDKG [\#1182](https://github.com/nymtech/nym/pull/1182) ([jstuczyn](https://github.com/jstuczyn)) +- fix unbond page [\#1180](https://github.com/nymtech/nym/pull/1180) ([tommyv1987](https://github.com/tommyv1987)) +- Type safe bounds [\#1179](https://github.com/nymtech/nym/pull/1179) ([durch](https://github.com/durch)) +- Fix delegation paging [\#1174](https://github.com/nymtech/nym/pull/1174) ([durch](https://github.com/durch)) +- Update binaries to rc version [\#1172](https://github.com/nymtech/nym/pull/1172) ([tommyv1987](https://github.com/tommyv1987)) +- Bump ansi-regex from 4.1.0 to 4.1.1 in /docker/typescript\_client/upload\_contract [\#1171](https://github.com/nymtech/nym/pull/1171) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [nym-wallet-v1.0.1](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.1) (2022-04-05) + +[Full Changelog](https://github.com/nymtech/nym/compare/nym-binaries-1.0.0-rc.1...nym-wallet-v1.0.1) + +**Closed issues:** + +- Check enabling bbbc simultaneously with open access. Estimate what it would take to make this the default compilation target. [\#1175](https://github.com/nymtech/nym/issues/1175) +- Get coconut credential for deposited tokens [\#1138](https://github.com/nymtech/nym/issues/1138) +- Make payments lazy [\#1135](https://github.com/nymtech/nym/issues/1135) +- Uptime on node selection for sets [\#1049](https://github.com/nymtech/nym/issues/1049) + +## [nym-wallet-v1.0.0](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.0) (2022-02-03) + +[Full Changelog](https://github.com/nymtech/nym/compare/v0.12.1...nym-wallet-v1.0.0) + +**Implemented enhancements:** + +- \[Feature Request\] Please enable registration without need for Telegram account [\#1016](https://github.com/nymtech/nym/issues/1016) +- Fast mixnode launch with a pre-built ISO + VM software [\#1001](https://github.com/nymtech/nym/issues/1001) + +**Fixed bugs:** + +- \[Issue\] [\#1000](https://github.com/nymtech/nym/issues/1000) +- \[Issue\] `nym-client` requires multiple attempts to run a server [\#869](https://github.com/nymtech/nym/issues/869) +- De-'float'-ing `Interval` \(`Display` impl + `serde`\) [\#1065](https://github.com/nymtech/nym/pull/1065) ([jstuczyn](https://github.com/jstuczyn)) +- display client address on wallet creation [\#1058](https://github.com/nymtech/nym/pull/1058) ([fmtabbara](https://github.com/fmtabbara)) + +**Closed issues:** + +- Rewarded set inclusion probability API endpoint [\#1037](https://github.com/nymtech/nym/issues/1037) +- Update cw-storage-plus to 0.11 [\#1032](https://github.com/nymtech/nym/issues/1032) +- Change `u128` fields in `RewardEstimationResponse` to `u64` [\#1029](https://github.com/nymtech/nym/issues/1029) +- Test out the mainnet Gravity Bridge [\#1006](https://github.com/nymtech/nym/issues/1006) +- Add vesting contract interface to nym-wallet [\#959](https://github.com/nymtech/nym/issues/959) +- Mixnode crash [\#486](https://github.com/nymtech/nym/issues/486) + +**Merged pull requests:** + +- create custom urls for mainnet [\#1095](https://github.com/nymtech/nym/pull/1095) ([fmtabbara](https://github.com/fmtabbara)) +- Wallet signing on MacOS [\#1093](https://github.com/nymtech/nym/pull/1093) ([mmsinclair](https://github.com/mmsinclair)) +- Fix rust 2018 idioms warnings [\#1092](https://github.com/nymtech/nym/pull/1092) ([octol](https://github.com/octol)) +- Prevent contract overwriting [\#1090](https://github.com/nymtech/nym/pull/1090) ([durch](https://github.com/durch)) +- Logout operation [\#1087](https://github.com/nymtech/nym/pull/1087) ([jstuczyn](https://github.com/jstuczyn)) +- Update to rust edition 2021 everywhere [\#1086](https://github.com/nymtech/nym/pull/1086) ([octol](https://github.com/octol)) +- Tag contract errors, and print out lines for easier QA [\#1084](https://github.com/nymtech/nym/pull/1084) ([durch](https://github.com/durch)) +- Feature/flexible vesting + utility queries [\#1083](https://github.com/nymtech/nym/pull/1083) ([durch](https://github.com/durch)) +- Bump @openzeppelin/contracts from 4.3.1 to 4.4.2 in /contracts/basic-bandwidth-generation [\#1082](https://github.com/nymtech/nym/pull/1082) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump nth-check from 2.0.0 to 2.0.1 in /clients/native/examples/js-examples/websocket [\#1081](https://github.com/nymtech/nym/pull/1081) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump url-parse from 1.5.1 to 1.5.4 in /clients/native/examples/js-examples/websocket [\#1080](https://github.com/nymtech/nym/pull/1080) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump follow-redirects from 1.14.1 to 1.14.7 in /clients/native/examples/js-examples/websocket [\#1079](https://github.com/nymtech/nym/pull/1079) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump nanoid from 3.1.23 to 3.2.0 in /clients/native/examples/js-examples/websocket [\#1078](https://github.com/nymtech/nym/pull/1078) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Setup basic test for mixnode stats reporting [\#1077](https://github.com/nymtech/nym/pull/1077) ([octol](https://github.com/octol)) +- Make wallet\_address mandatory for mixnode init [\#1076](https://github.com/nymtech/nym/pull/1076) ([octol](https://github.com/octol)) +- Tidy nym-mixnode module visibility [\#1075](https://github.com/nymtech/nym/pull/1075) ([octol](https://github.com/octol)) +- Feature/wallet login with password [\#1074](https://github.com/nymtech/nym/pull/1074) ([fmtabbara](https://github.com/fmtabbara)) +- Add trait to mock client dependency in DelayForwarder [\#1073](https://github.com/nymtech/nym/pull/1073) ([octol](https://github.com/octol)) +- Bump rust-version to latest stable for nym-mixnode [\#1072](https://github.com/nymtech/nym/pull/1072) ([octol](https://github.com/octol)) +- Fixes CI for our wasm build [\#1069](https://github.com/nymtech/nym/pull/1069) ([jstuczyn](https://github.com/jstuczyn)) +- Add @octol as codeowner [\#1068](https://github.com/nymtech/nym/pull/1068) ([octol](https://github.com/octol)) +- set-up inclusion probability [\#1067](https://github.com/nymtech/nym/pull/1067) ([fmtabbara](https://github.com/fmtabbara)) +- Feature/wasm client [\#1066](https://github.com/nymtech/nym/pull/1066) ([neacsu](https://github.com/neacsu)) +- Changed bech32\_prefix from punk to nymt [\#1064](https://github.com/nymtech/nym/pull/1064) ([jstuczyn](https://github.com/jstuczyn)) +- Bump nanoid from 3.1.30 to 3.2.0 in /testnet-faucet [\#1063](https://github.com/nymtech/nym/pull/1063) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump nanoid from 3.1.30 to 3.2.0 in /nym-wallet [\#1062](https://github.com/nymtech/nym/pull/1062) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Rework vesting contract storage [\#1061](https://github.com/nymtech/nym/pull/1061) ([durch](https://github.com/durch)) +- Mixnet Contract constants extraction [\#1060](https://github.com/nymtech/nym/pull/1060) ([jstuczyn](https://github.com/jstuczyn)) +- fix: make explorer footer year dynamic [\#1059](https://github.com/nymtech/nym/pull/1059) ([martinyung](https://github.com/martinyung)) +- Add mnemonic just on creation, to display it [\#1057](https://github.com/nymtech/nym/pull/1057) ([neacsu](https://github.com/neacsu)) +- Network Explorer: updates to API and UI to show the active set [\#1056](https://github.com/nymtech/nym/pull/1056) ([mmsinclair](https://github.com/mmsinclair)) +- Made contract addresses for query NymdClient construction optional [\#1055](https://github.com/nymtech/nym/pull/1055) ([jstuczyn](https://github.com/jstuczyn)) +- Introduced RPC query for total token supply [\#1053](https://github.com/nymtech/nym/pull/1053) ([jstuczyn](https://github.com/jstuczyn)) +- Feature/tokio console [\#1052](https://github.com/nymtech/nym/pull/1052) ([durch](https://github.com/durch)) +- Implemented beta clippy lint recommendations [\#1051](https://github.com/nymtech/nym/pull/1051) ([jstuczyn](https://github.com/jstuczyn)) +- add new function to update profit percentage [\#1050](https://github.com/nymtech/nym/pull/1050) ([fmtabbara](https://github.com/fmtabbara)) +- Upgrade Clap and use declarative argument parsing for nym-mixnode [\#1047](https://github.com/nymtech/nym/pull/1047) ([octol](https://github.com/octol)) +- Feature/additional bond validation [\#1046](https://github.com/nymtech/nym/pull/1046) ([fmtabbara](https://github.com/fmtabbara)) +- Fix clippy on relevant lints [\#1044](https://github.com/nymtech/nym/pull/1044) ([neacsu](https://github.com/neacsu)) +- Bump shelljs from 0.8.4 to 0.8.5 in /contracts/basic-bandwidth-generation [\#1043](https://github.com/nymtech/nym/pull/1043) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Endpoint for rewarded set inclusion probabilities [\#1042](https://github.com/nymtech/nym/pull/1042) ([durch](https://github.com/durch)) +- Bump follow-redirects from 1.14.4 to 1.14.7 in /contracts/basic-bandwidth-generation [\#1041](https://github.com/nymtech/nym/pull/1041) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump follow-redirects from 1.14.5 to 1.14.7 in /testnet-faucet [\#1040](https://github.com/nymtech/nym/pull/1040) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Feature/node settings update [\#1036](https://github.com/nymtech/nym/pull/1036) ([fmtabbara](https://github.com/fmtabbara)) +- Migrate to cw-storage-plus 0.11.1 [\#1035](https://github.com/nymtech/nym/pull/1035) ([durch](https://github.com/durch)) +- Bump @openzeppelin/contracts from 4.4.1 to 4.4.2 in /contracts/basic-bandwidth-generation [\#1034](https://github.com/nymtech/nym/pull/1034) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Feature/configurable wallet [\#1033](https://github.com/nymtech/nym/pull/1033) ([neacsu](https://github.com/neacsu)) +- Feature/downcast reward estimation [\#1031](https://github.com/nymtech/nym/pull/1031) ([durch](https://github.com/durch)) +- Wallet UI updates [\#1028](https://github.com/nymtech/nym/pull/1028) ([fmtabbara](https://github.com/fmtabbara)) +- Remove migration code [\#1027](https://github.com/nymtech/nym/pull/1027) ([neacsu](https://github.com/neacsu)) +- Chore/stricter dependency requirements [\#1025](https://github.com/nymtech/nym/pull/1025) ([jstuczyn](https://github.com/jstuczyn)) +- Feature/validator api client endpoints [\#1024](https://github.com/nymtech/nym/pull/1024) ([jstuczyn](https://github.com/jstuczyn)) +- Updated cosmrs to 0.4.1 [\#1023](https://github.com/nymtech/nym/pull/1023) ([jstuczyn](https://github.com/jstuczyn)) +- Feature/testnet deploy scripts [\#1022](https://github.com/nymtech/nym/pull/1022) ([mfahampshire](https://github.com/mfahampshire)) +- Changed wallet's client to a full validator client [\#1021](https://github.com/nymtech/nym/pull/1021) ([jstuczyn](https://github.com/jstuczyn)) +- Fix 404 link [\#1020](https://github.com/nymtech/nym/pull/1020) ([RiccardoMasutti](https://github.com/RiccardoMasutti)) +- Feature/additional mixnode endpoints [\#1019](https://github.com/nymtech/nym/pull/1019) ([jstuczyn](https://github.com/jstuczyn)) +- Introduced denom check when trying to withdraw vested coins [\#1018](https://github.com/nymtech/nym/pull/1018) ([jstuczyn](https://github.com/jstuczyn)) +- Add network defaults for qa [\#1017](https://github.com/nymtech/nym/pull/1017) ([neacsu](https://github.com/neacsu)) +- Feature/expanded events [\#1015](https://github.com/nymtech/nym/pull/1015) ([jstuczyn](https://github.com/jstuczyn)) +- update frontend to use new profit update api [\#1014](https://github.com/nymtech/nym/pull/1014) ([fmtabbara](https://github.com/fmtabbara)) +- Feature/node state endpoint [\#1013](https://github.com/nymtech/nym/pull/1013) ([jstuczyn](https://github.com/jstuczyn)) +- Feature/hourly set updates [\#1012](https://github.com/nymtech/nym/pull/1012) ([durch](https://github.com/durch)) +- Feature/remove unused profit margin [\#1011](https://github.com/nymtech/nym/pull/1011) ([neacsu](https://github.com/neacsu)) +- Feature/explorer node status [\#1010](https://github.com/nymtech/nym/pull/1010) ([jstuczyn](https://github.com/jstuczyn)) +- Use serial integer instead of random [\#1009](https://github.com/nymtech/nym/pull/1009) ([durch](https://github.com/durch)) +- Feature/configure profit [\#1008](https://github.com/nymtech/nym/pull/1008) ([neacsu](https://github.com/neacsu)) +- Feature/fix gateway sign [\#1004](https://github.com/nymtech/nym/pull/1004) ([neacsu](https://github.com/neacsu)) +- Fix clippy [\#1003](https://github.com/nymtech/nym/pull/1003) ([neacsu](https://github.com/neacsu)) +- Update wallet version [\#998](https://github.com/nymtech/nym/pull/998) ([tommyv1987](https://github.com/tommyv1987)) +- Fix wallet build instructions [\#997](https://github.com/nymtech/nym/pull/997) ([tommyv1987](https://github.com/tommyv1987)) +- Make the separation between testnet-mode and erc20 bandwidth mode clearer [\#994](https://github.com/nymtech/nym/pull/994) ([neacsu](https://github.com/neacsu)) +- Bump @openzeppelin/contracts from 3.4.0 to 4.4.1 in /contracts/basic-bandwidth-generation [\#983](https://github.com/nymtech/nym/pull/983) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Feature/implicit runtime [\#973](https://github.com/nymtech/nym/pull/973) ([jstuczyn](https://github.com/jstuczyn)) +- Differentiate staking and ownership [\#961](https://github.com/nymtech/nym/pull/961) ([durch](https://github.com/durch)) From 7f5ce3ffeb0e335c9cff5d07033617b0d9787f2b Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Fri, 12 Aug 2022 12:58:49 +0100 Subject: [PATCH 2/9] Removing wallet entries from main changelog --- CHANGELOG.md | 25 ------------------------- nym-wallet/CHANGELOG.md | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04e7241d53..353c77ea06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,35 +114,10 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// [Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.3...nym-binaries-1.0.0) - - ## [nym-binaries-1.0.0-rc.2](https://github.com/nymtech/nym/tree/nym-binaries-1.0.0-rc.2) (2022-04-15) [Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.2...nym-binaries-1.0.0-rc.2) -## [nym-wallet-v1.0.2](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.2) (2022-04-05) - -[Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.1...nym-wallet-v1.0.2) - -**Merged pull requests:** - -- Wallet 1.0.2 visual tweaks [\#1197](https://github.com/nymtech/nym/pull/1197) ([mmsinclair](https://github.com/mmsinclair)) -- Password for wallet with routes [\#1196](https://github.com/nymtech/nym/pull/1196) ([fmtabbara](https://github.com/fmtabbara)) -- Add auto-updater to Nym Wallet [\#1194](https://github.com/nymtech/nym/pull/1194) ([mmsinclair](https://github.com/mmsinclair)) -- Fix clippy warnings for beta toolchain [\#1191](https://github.com/nymtech/nym/pull/1191) ([octol](https://github.com/octol)) -- wallet: expose validator urls to the frontend [\#1190](https://github.com/nymtech/nym/pull/1190) ([octol](https://github.com/octol)) -- wallet: add test for decrypting stored wallet file [\#1189](https://github.com/nymtech/nym/pull/1189) ([octol](https://github.com/octol)) -- Fix clippy warnings [\#1188](https://github.com/nymtech/nym/pull/1188) ([octol](https://github.com/octol)) -- Password for wallet with routes [\#1187](https://github.com/nymtech/nym/pull/1187) ([mmsinclair](https://github.com/mmsinclair)) -- wallet: add validate\_mnemonic [\#1186](https://github.com/nymtech/nym/pull/1186) ([octol](https://github.com/octol)) -- wallet: support removing accounts from the wallet file [\#1185](https://github.com/nymtech/nym/pull/1185) ([octol](https://github.com/octol)) -- Feature/adding discord [\#1184](https://github.com/nymtech/nym/pull/1184) ([gala1234](https://github.com/gala1234)) -- wallet: config backend for validator selection [\#1183](https://github.com/nymtech/nym/pull/1183) ([octol](https://github.com/octol)) -- Add storybook to wallet [\#1178](https://github.com/nymtech/nym/pull/1178) ([mmsinclair](https://github.com/mmsinclair)) -- wallet: connection test nymd and api urls independently [\#1170](https://github.com/nymtech/nym/pull/1170) ([octol](https://github.com/octol)) -- wallet: wire up account storage [\#1153](https://github.com/nymtech/nym/pull/1153) ([octol](https://github.com/octol)) -- Feature/signature on deposit [\#1151](https://github.com/nymtech/nym/pull/1151) ([neacsu](https://github.com/neacsu)) - ## [nym-binaries-1.0.0-rc.1](https://github.com/nymtech/nym/tree/nym-binaries-1.0.0-rc.1) (2022-03-28) [Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.0...nym-binaries-1.0.0-rc.1) diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index 8c8ea9ba9f..497ec93034 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -68,6 +68,29 @@ - Update binaries to rc version [\#1172](https://github.com/nymtech/nym/pull/1172) ([tommyv1987](https://github.com/tommyv1987)) - Bump ansi-regex from 4.1.0 to 4.1.1 in /docker/typescript\_client/upload\_contract [\#1171](https://github.com/nymtech/nym/pull/1171) ([dependabot[bot]](https://github.com/apps/dependabot)) +## [nym-wallet-v1.0.2](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.2) (2022-04-05) + +[Full Changelog](https://github.com/nymtech/nym/compare/nym-wallet-v1.0.1...nym-wallet-v1.0.2) + +**Merged pull requests:** + +- Wallet 1.0.2 visual tweaks [\#1197](https://github.com/nymtech/nym/pull/1197) ([mmsinclair](https://github.com/mmsinclair)) +- Password for wallet with routes [\#1196](https://github.com/nymtech/nym/pull/1196) ([fmtabbara](https://github.com/fmtabbara)) +- Add auto-updater to Nym Wallet [\#1194](https://github.com/nymtech/nym/pull/1194) ([mmsinclair](https://github.com/mmsinclair)) +- Fix clippy warnings for beta toolchain [\#1191](https://github.com/nymtech/nym/pull/1191) ([octol](https://github.com/octol)) +- wallet: expose validator urls to the frontend [\#1190](https://github.com/nymtech/nym/pull/1190) ([octol](https://github.com/octol)) +- wallet: add test for decrypting stored wallet file [\#1189](https://github.com/nymtech/nym/pull/1189) ([octol](https://github.com/octol)) +- Fix clippy warnings [\#1188](https://github.com/nymtech/nym/pull/1188) ([octol](https://github.com/octol)) +- Password for wallet with routes [\#1187](https://github.com/nymtech/nym/pull/1187) ([mmsinclair](https://github.com/mmsinclair)) +- wallet: add validate\_mnemonic [\#1186](https://github.com/nymtech/nym/pull/1186) ([octol](https://github.com/octol)) +- wallet: support removing accounts from the wallet file [\#1185](https://github.com/nymtech/nym/pull/1185) ([octol](https://github.com/octol)) +- Feature/adding discord [\#1184](https://github.com/nymtech/nym/pull/1184) ([gala1234](https://github.com/gala1234)) +- wallet: config backend for validator selection [\#1183](https://github.com/nymtech/nym/pull/1183) ([octol](https://github.com/octol)) +- Add storybook to wallet [\#1178](https://github.com/nymtech/nym/pull/1178) ([mmsinclair](https://github.com/mmsinclair)) +- wallet: connection test nymd and api urls independently [\#1170](https://github.com/nymtech/nym/pull/1170) ([octol](https://github.com/octol)) +- wallet: wire up account storage [\#1153](https://github.com/nymtech/nym/pull/1153) ([octol](https://github.com/octol)) +- Feature/signature on deposit [\#1151](https://github.com/nymtech/nym/pull/1151) ([neacsu](https://github.com/neacsu)) + ## [nym-wallet-v1.0.1](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.1) (2022-04-05) [Full Changelog](https://github.com/nymtech/nym/compare/nym-binaries-1.0.0-rc.1...nym-wallet-v1.0.1) From 27b384e03423aec950af867f3a3c3ff2b7d2a73a Mon Sep 17 00:00:00 2001 From: Jess <31625607+jessgess@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:53:40 +0100 Subject: [PATCH 3/9] Update CHANGELOG.md --- nym-wallet/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index 497ec93034..6c652afcf0 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -1,3 +1,10 @@ +## [nym-wallet-v1.0.8](https://github.com/nymtech/nym/releases/tag/nym-wallet-v1.0.8) + +- wallet: new bonding flow +- wallet: compound and redeem functionalities for operators rewards +- wallet: a few minor touch ups and bug fixes + + ## [nym-wallet-v1.0.7](https://github.com/nymtech/nym/tree/nym-wallet-v1.0.7) (2022-07-11) - wallet: dark mode From 6af59c303ecaed13c690c561ba72abfbe23878ce Mon Sep 17 00:00:00 2001 From: Jess <31625607+jessgess@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:54:09 +0100 Subject: [PATCH 4/9] Update CHANGELOG.md --- nym-wallet/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index 6c652afcf0..a808fef6f0 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -1,4 +1,4 @@ -## [nym-wallet-v1.0.8](https://github.com/nymtech/nym/releases/tag/nym-wallet-v1.0.8) +## [nym-wallet-v1.0.8](https://github.com/nymtech/nym/releases/tag/nym-wallet-v1.0.8) (2022-08-11) - wallet: new bonding flow - wallet: compound and redeem functionalities for operators rewards From ab5740087f08e1bffff0613d381ec9fc87713ba1 Mon Sep 17 00:00:00 2001 From: Jess <31625607+jessgess@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:55:39 +0100 Subject: [PATCH 5/9] Update CHANGELOG.md --- nym-wallet/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index a808fef6f0..b630e83b02 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -1,7 +1,7 @@ ## [nym-wallet-v1.0.8](https://github.com/nymtech/nym/releases/tag/nym-wallet-v1.0.8) (2022-08-11) -- wallet: new bonding flow -- wallet: compound and redeem functionalities for operators rewards +- wallet: new bonding flow and screen for bonded node +- wallet: compound and redeem functionalities for operator rewards - wallet: a few minor touch ups and bug fixes From 8ec074cb1fb4400379065aec55a40246af54a282 Mon Sep 17 00:00:00 2001 From: Pierre Dommerc Date: Fri, 12 Aug 2022 16:02:27 +0200 Subject: [PATCH 6/9] fix(wallet): typo (#1527) --- nym-wallet/src/components/Delegation/DelegationActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nym-wallet/src/components/Delegation/DelegationActions.tsx b/nym-wallet/src/components/Delegation/DelegationActions.tsx index 2bf0070d98..0cdec430e7 100644 --- a/nym-wallet/src/components/Delegation/DelegationActions.tsx +++ b/nym-wallet/src/components/Delegation/DelegationActions.tsx @@ -98,7 +98,7 @@ export const DelegationsActionsMenu: React.FC<{ } onClick={() => handleActionSelect('undelegate')} /> R} onClick={() => handleActionSelect('redeem')} disabled={disableRedeemingRewards} From 957cbb45b00553025efe71db27c7b3f2a06e5c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Fri, 12 Aug 2022 17:56:49 +0100 Subject: [PATCH 7/9] Chore/linter updates (#1530) * Removed needless return * Added Eq derivation where applicable for types with PartialEq --- .../coconut-bandwidth-contract/src/spend_credential.rs | 2 +- common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs | 4 ++-- nym-wallet/src-tauri/src/operations/mixnet/bond.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/src/spend_credential.rs b/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/src/spend_credential.rs index 8aef32f1a1..28842576c6 100644 --- a/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/src/spend_credential.rs +++ b/common/cosmwasm-smart-contracts/coconut-bandwidth-contract/src/spend_credential.rs @@ -37,7 +37,7 @@ impl SpendCredentialData { } } -#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] +#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] pub enum SpendCredentialStatus { InProgress, Spent, diff --git a/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs b/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs index 6d71de8887..a9b3e8fbf3 100644 --- a/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs +++ b/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs @@ -213,7 +213,7 @@ pub enum QueryMsg { }, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct MigrateMsg { pub mixnet_denom: String, @@ -226,7 +226,7 @@ impl MigrateMsg { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct NodeToRemove { owner: String, proxy: Option, diff --git a/nym-wallet/src-tauri/src/operations/mixnet/bond.rs b/nym-wallet/src-tauri/src/operations/mixnet/bond.rs index e350bd49d9..033186886a 100644 --- a/nym-wallet/src-tauri/src/operations/mixnet/bond.rs +++ b/nym-wallet/src-tauri/src/operations/mixnet/bond.rs @@ -254,7 +254,7 @@ pub async fn get_mix_node_description( host: &str, port: u16, ) -> Result { - return fetch_mix_node_description(host, port) + fetch_mix_node_description(host, port) .await - .map_err(|e| BackendError::ReqwestError { source: e }); + .map_err(|e| BackendError::ReqwestError { source: e }) } From 0a37c81709da20a4c29b6d09f7ca07f40869bf7a Mon Sep 17 00:00:00 2001 From: tommy Date: Tue, 16 Aug 2022 12:05:38 +0200 Subject: [PATCH 8/9] remove not needed prior state of denom --- contracts/mixnet/src/queued_migrations.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/mixnet/src/queued_migrations.rs b/contracts/mixnet/src/queued_migrations.rs index a0d329fdf6..56e4a9f890 100644 --- a/contracts/mixnet/src/queued_migrations.rs +++ b/contracts/mixnet/src/queued_migrations.rs @@ -18,7 +18,6 @@ pub fn migrate_config_from_env( #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct OldContractState { pub owner: Addr, - pub mix_denom: String, pub rewarding_validator_address: Addr, pub params: ContractStateParams, } From 728b0f454906b24c790bc385d1dd64e4c15d8a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Tue, 16 Aug 2022 14:19:55 +0200 Subject: [PATCH 9/9] inclusion-probability: new crate for simulation active set inclusion (#1534) --- CHANGELOG.md | 1 + Cargo.lock | 16 +- Cargo.toml | 15 +- common/inclusion-probability/Cargo.toml | 10 + common/inclusion-probability/src/error.rs | 9 + common/inclusion-probability/src/lib.rs | 278 ++++++++++++++++++++++ nym-connect/Cargo.lock | 2 +- nym-wallet/Cargo.lock | 2 +- 8 files changed, 320 insertions(+), 13 deletions(-) create mode 100644 common/inclusion-probability/Cargo.toml create mode 100644 common/inclusion-probability/src/error.rs create mode 100644 common/inclusion-probability/src/lib.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 353c77ea06..293737b04e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// - validator-client: add `denom` argument and add simple test for querying an account balance - gateway, validator-api: Checks for coconut credential double spending attempts, taking the coconut bandwidth contract as source of truth ([#1457]) - coconut-bandwidth-contract: Record the state of a coconut credential; create specific proposal for releasing funds ([#1457]) +- inclusion-probability: add simulator for active set inclusion probability ### Fixed diff --git a/Cargo.lock b/Cargo.lock index a075fc0a4f..cc35237b23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2496,6 +2496,14 @@ dependencies = [ "syn", ] +[[package]] +name = "inclusion-probability" +version = "0.1.0" +dependencies = [ + "rand 0.8.5", + "thiserror", +] + [[package]] name = "indenter" version = "0.3.3" @@ -5652,18 +5660,18 @@ checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 8b8d9d560b..6e3dc19265 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,22 +22,23 @@ members = [ "clients/native", "clients/native/websocket-requests", "clients/socks5", + "common/bandwidth-claim-contract", "common/client-libs/gateway-client", "common/client-libs/mixnet-client", "common/client-libs/validator-client", - "common/credential-storage", "common/coconut-interface", "common/config", - "common/credentials", - "common/crypto", - "common/crypto/dkg", - "common/execute", - "common/bandwidth-claim-contract", "common/cosmwasm-smart-contracts/coconut-bandwidth-contract", "common/cosmwasm-smart-contracts/contracts-common", "common/cosmwasm-smart-contracts/mixnet-contract", "common/cosmwasm-smart-contracts/multisig-contract", "common/cosmwasm-smart-contracts/vesting-contract", + "common/credential-storage", + "common/credentials", + "common/crypto", + "common/crypto/dkg", + "common/execute", + "common/inclusion-probability", "common/mixnode-common", "common/network-defaults", "common/nonexhaustive-delayqueue", @@ -53,9 +54,9 @@ members = [ "common/nymsphinx/params", "common/nymsphinx/types", "common/pemstore", - "common/statistics", "common/socks5/proxy-helpers", "common/socks5/requests", + "common/statistics", "common/task", "common/topology", "common/types", diff --git a/common/inclusion-probability/Cargo.toml b/common/inclusion-probability/Cargo.toml new file mode 100644 index 0000000000..0df3bfe4e7 --- /dev/null +++ b/common/inclusion-probability/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "inclusion-probability" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.8.5" +thiserror = "1.0.32" diff --git a/common/inclusion-probability/src/error.rs b/common/inclusion-probability/src/error.rs new file mode 100644 index 0000000000..9e9908a585 --- /dev/null +++ b/common/inclusion-probability/src/error.rs @@ -0,0 +1,9 @@ +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("The list of cumulative stake was unexpectedly empty")] + EmptyListCumulStake, + #[error("Sample point was unexpectedly out of bounds")] + SamplePointOutOfBounds, + #[error("Norm computation failed on different size arrarys")] + NormDifferenceSizeArrays, +} diff --git a/common/inclusion-probability/src/lib.rs b/common/inclusion-probability/src/lib.rs new file mode 100644 index 0000000000..b392ab9803 --- /dev/null +++ b/common/inclusion-probability/src/lib.rs @@ -0,0 +1,278 @@ +//! Active set inclusion probability simulator + +use error::Error; + +mod error; + +const TOLERANCE_L2_NORM: f64 = 1e-4; +const TOLERANCE_MAX_NORM: f64 = 1e-3; + +pub struct SelectionProbability { + pub active_set_probability: Vec, + pub reserve_set_probability: Vec, + pub samples: u32, + pub delta_l2: f64, + pub delta_max: f64, +} + +pub fn simulate_selection_probability_mixnodes( + list_stake_for_mixnodes: &[u64], + active_set_size: usize, + reserve_set_size: usize, + max_samples: u32, +) -> Result { + // Total number of existing (registered) nodes + let num_mixnodes = list_stake_for_mixnodes.len(); + + // Cumulative stake ordered by node index + let list_cumul = cumul_sum(list_stake_for_mixnodes); + + // The computed probabilities + let mut active_set_probability = vec![0.0; num_mixnodes]; + let mut reserve_set_probability = vec![0.0; num_mixnodes]; + + // Number sufficiently large to have a good approximation of selection probability + let mut samples = 0; + let mut delta_l2; + let mut delta_max; + let mut rng = rand::thread_rng(); + + loop { + samples += 1; + let mut sample_active_mixnodes = Vec::new(); + let mut sample_reserve_mixnodes = Vec::new(); + let mut list_cumul_temp = list_cumul.clone(); + + let active_set_probability_previous = active_set_probability.clone(); + + // Select the active nodes for the epoch (hour) + while sample_active_mixnodes.len() < active_set_size { + let candidate = sample_candidate(&list_cumul_temp, &mut rng)?; + + if !sample_active_mixnodes.contains(&candidate) { + sample_active_mixnodes.push(candidate); + remove_mixnode_from_cumul_stake(candidate, &mut list_cumul_temp); + } + } + + // Select the reserve nodes for the epoch (hour) + while sample_reserve_mixnodes.len() < reserve_set_size { + let candidate = sample_candidate(&list_cumul_temp, &mut rng)?; + + if !sample_reserve_mixnodes.contains(&candidate) + && !sample_active_mixnodes.contains(&candidate) + { + sample_reserve_mixnodes.push(candidate); + remove_mixnode_from_cumul_stake(candidate, &mut list_cumul_temp); + } + } + + // Sum up nodes being in active or reserve set + for active_mixnodes in sample_active_mixnodes { + active_set_probability[active_mixnodes] += 1.0; + } + for reserve_mixnodes in sample_reserve_mixnodes { + reserve_set_probability[reserve_mixnodes] += 1.0; + } + + // Convergence critera only on active set. + // We devide by samples to get the average, that is not really part of the delta + // computation. + delta_l2 = l2_diff(&active_set_probability, &active_set_probability_previous)? + / f64::from(samples); + delta_max = max_diff(&active_set_probability, &active_set_probability_previous)? + / f64::from(samples); + if samples > 10 && delta_l2 < TOLERANCE_L2_NORM && delta_max < TOLERANCE_MAX_NORM + || samples >= max_samples + { + break; + } + } + + active_set_probability + .iter_mut() + .for_each(|x| *x /= f64::from(samples)); + reserve_set_probability + .iter_mut() + .for_each(|x| *x /= f64::from(samples)); + + Ok(SelectionProbability { + active_set_probability, + reserve_set_probability, + samples, + delta_l2, + delta_max, + }) +} + +// Compute the cumulative sum +fn cumul_sum<'a>(list: impl IntoIterator) -> Vec { + let mut list_cumul = Vec::new(); + let mut cumul = 0; + for entry in list { + cumul += entry; + list_cumul.push(cumul); + } + list_cumul +} + +fn sample_candidate(list_cumul: &[u64], rng: &mut rand::rngs::ThreadRng) -> Result { + use rand::distributions::{Distribution, Uniform}; + let uniform = Uniform::from(0..*list_cumul.last().ok_or(Error::EmptyListCumulStake)?); + let r = uniform.sample(rng); + + let candidate = list_cumul + .iter() + .enumerate() + .find(|(_, x)| *x >= &r) + .ok_or(Error::SamplePointOutOfBounds)? + .0; + + Ok(candidate) +} + +// Update list of cumulative stake to reflect eliminating the picked node +fn remove_mixnode_from_cumul_stake(candidate: usize, list_cumul_stake: &mut [u64]) { + let prob_candidate = if candidate == 0 { + list_cumul_stake[0] + } else { + list_cumul_stake[candidate] - list_cumul_stake[candidate - 1] + }; + + for cumul in list_cumul_stake.iter_mut().skip(candidate) { + *cumul -= prob_candidate; + } +} + +// Compute the difference in l2-norm +fn l2_diff(v1: &[f64], v2: &[f64]) -> Result { + if v1.len() != v2.len() { + return Err(Error::NormDifferenceSizeArrays); + } + Ok(v1 + .iter() + .zip(v2) + .map(|(&i1, &i2)| (i1 - i2).powi(2)) + .sum::() + .sqrt()) +} + +// Compute the difference in max-norm +fn max_diff(v1: &[f64], v2: &[f64]) -> Result { + if v1.len() != v2.len() { + return Err(Error::NormDifferenceSizeArrays); + } + Ok(v1 + .iter() + .zip(v2) + .map(|(x, y)| (x - y).abs()) + .fold(f64::NEG_INFINITY, f64::max)) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn compute_cumul_sum() { + let v = cumul_sum(&vec![1, 2, 3]); + assert_eq!(v, &[1, 3, 6]); + } + + #[test] + fn remove_mixnode_from_cumul() { + let mut cumul_stake = vec![1, 2, 3, 4, 5, 6]; + remove_mixnode_from_cumul_stake(3, &mut cumul_stake); + assert_eq!(cumul_stake, &[1, 2, 3, 3, 4, 5]); + } + + #[test] + fn max_norm() { + let v1 = vec![1.0, 2.0, 3.0]; + let v2 = vec![2.0, 4.0, -6.0]; + assert!((max_diff(&v1, &v2).unwrap() - 9.0).abs() < f64::EPSILON); + } + + #[test] + fn ls_norm() { + let v1 = vec![1.0, 2.0, 3.0]; + let v2 = vec![2.0, 3.0, -2.0]; + assert!((l2_diff(&v1, &v2).unwrap() - 5.196_152_422_706_632).abs() < 1e2 * f64::EPSILON); + } + + // Replicate the results from the Python simulation code in https://github.com/nymtech/team-core/issues/114 + #[test] + fn replicate_python_simulation() { + let active_set_size = 4; + let standby_set_size = 1; + + // this has to contain the total stake per node + let list_mix = vec![ + 100, 100, 3000, 500_000, 100, 10, 10, 10, 10, 10, 30000, 500, 200, 52345, + ]; + + let max_samples = 100_000; + + let SelectionProbability { + active_set_probability, + reserve_set_probability, + samples, + delta_l2, + delta_max, + } = simulate_selection_probability_mixnodes( + &list_mix, + active_set_size, + standby_set_size, + max_samples, + ) + .unwrap(); + + // These values comes from running the python simulator for a very long time + let expected_active_set_probability = vec![ + 0.025_070_8, + 0.025_073_2, + 0.744_117, + 0.999_999, + 0.025_000_2, + 0.002_524_4, + 0.002_527_8, + 0.002_528_6, + 0.002_569_6, + 0.002_513_6, + 0.994, + 0.125_482_8, + 0.050_279_8, + 0.998_313_2, + ]; + // The same check is used in the convergence criterion, and hence should be reflected in + // `delta_max` too. + assert!( + max_diff(&active_set_probability, &expected_active_set_probability).unwrap() < 1e-2 + ); + + let expected_reserve_set_probability = vec![ + 0.076_392_4, + 0.076_499, + 0.204_893_6, + 1e-06, + 0.076_278_8, + 0.007_720_6, + 0.007_673, + 0.007_700_2, + 0.007_669_4, + 0.007_731_2, + 0.005_789_4, + 0.368_465_6, + 0.151_537_2, + 0.001_648_6, + ]; + assert!( + max_diff(&reserve_set_probability, &expected_reserve_set_probability).unwrap() < 1e-2 + ); + + // We converge around 20_000, add another 500 for some slack due to random values + assert!(samples < 20_500); + assert!(delta_l2 < TOLERANCE_L2_NORM); + assert!(delta_max < TOLERANCE_MAX_NORM); + } +} diff --git a/nym-connect/Cargo.lock b/nym-connect/Cargo.lock index a94e7ab621..229016b1ce 100644 --- a/nym-connect/Cargo.lock +++ b/nym-connect/Cargo.lock @@ -3436,7 +3436,7 @@ dependencies = [ [[package]] name = "nym-socks5-client" -version = "1.0.1" +version = "1.0.2" dependencies = [ "clap", "client-core", diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 2561ca57b6..1a48fd35b5 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -3055,7 +3055,7 @@ dependencies = [ [[package]] name = "nym_wallet" -version = "1.0.7" +version = "1.0.8" dependencies = [ "aes-gcm", "argon2 0.3.4",