dda00a0f16850fff1b668ae751be0e4eefea9994
11 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
136666d759 |
Feature/rewarding revamp (#1472)
* Query for node stake saturation * Queries for currently pending events * Rewarded set query * Moved ContractState to common types since it's being returned as a result of one of the queries on the mixnet contract and thus it needs to be accessible outside the contract itself * Cleaend up storage initialisation * started restoring unit tests * Removed attached 1ucoin for cross-contract execute msgs * wip * query for rewarding details of a mix node * Changes for mixnodes and gateways * Furher progress on v2 changelog(-ish) description * wip * first version of the description * mixnode bonding queries tests and fixes * ibid for storage * MixnodeEventType enum + created events for missing mixnode txs * tests for adding new mixnode * Additional mixnode-related tests + bug fixes * Display for Percent * Bunch of tests for try_reward_mixnode * More tests and fixes * ibid * tests for updating rewarding params + important bug fix * Started removing unused imports * rewarding queries tests + undelegation bugfix * A lot of todo()-ing and commenting out unimplemented code * implements https://github.com/nymtech/team-core/issues/113 * Delegation tests + fixes * Emiting events by top level interval txs + incorporating limit * question * Missing events emissions * removed some code duplication * wip * pending delegation tests * Vesting contract update * More tests (and fixes) for pending events txs * Restored gateway tx tests * Another cleanup iteration * removed redundant comment * Unit tests, fixes and simplifcations for interval-related txs * Unit tests for helper functions * Interval queries unit tests * Test for correct contract initialisation * Another round of cleanup * Work on mixnet_query_client trait * mixnet_signing_client trait * Removed redundant methods * Slowly restoring validator client functionality * Added deprecated query for mix details by identity * wip restoration of validator-api * Work on deprecating validator API routes * Further validator-api routes * Restored rest of status api routes * Resolved all todos in ValidatorApiStorage There's still bunch left in StorageManager though * Changed NodeId from u64 to u32 * Updating sql code * Network monitor internals * Changed behaviour of full_epoch_id and updated epoch operations * Fixed sql queries * [most likely] finished updating rest of the validator API * Post rebasing fixes * Feature/rewarding revamp explorer api changes (#1511) * Changed cache to allow for non-string keys * Helper method for best-effort conversion of pubkey to nodeid * Updated validator-api client routes * Updated routes to use mix-id indexing * Introduction of deprecated routes callable by identity key * Fixed mixnode compatibility by changing read node details fields (#1512) * Fixed bond to topology conversion for client compatibility (#1513) * Updated 'verify_gateway_owner' to use correct nymd_client method for obtaining gateway details (#1515) * Updated constructor for ValidatorCacheInner * Fixed wasm client topology construction * Run cargo fmt on the entire codebase * Feature/rewarding revamp wallet backend changes (#1529) * Updated mixnode-related ts types * Updated nym-wallet-types * Updated 'get_contract_settings' and commented out code of other tauri commands * 'update_contract_settings' * 'bond_gateway' * unbond_gateway' * Utility commands for the transition period * 'bond_mixnode' * 'unbond_mixnode' * Ability to update mixnode cost paramaters * Mixnode config update * Updated mixnode_bond_details It also returns a different underlying type now * Updated 'gateway_bond_details' * Obtaining pending operator rewards * Improved way of obtaining number of mixnode delegators * simplified error handling in 'fetch_mix_node_description' * mixnode and gateway ownership queries * updated get_number_of_mixnode_delegators to use mix_id since we have the conversion utils helper * mixnode delegation * undelegating * Obtaining pending delegator rewards * Command for obtaining current interval details * Queries to handle paging for pending events * Additional level of indirection to pending events to incorporate event id into response * Wallet compatible pending event types * Commands fo obtaining pending events * Re-implemented pending delegation events * Further work on delegation * Removed unused imports * Commands for withdrawing rewards * Admin-related simulations * mixnet-related simulation commands * Validator-api related routes * Bond-related vesting operations * Vesting simulations * Vesting handler for UpdateMixnodeCostParams * Vesting reward claiming * Vesting queries * claim_locked_and_unlocked_delegator_reward * The massive delegation query * cleanup * updated typescript requests * sorted the new type exports in ts-rs-cli * Regenerated typescript types * temporarily ignoring unreachable code in vesting migration * Updated missed test fixture * Fixed missing coconut-specific import * cargo fmt * Exporting reward-related types * utility to convert stringified decimal to cosmjs Decimal * deriving Eq alongside PartialEq * wip - typescript fixes * using default operating cost when bonding mixnode * Using default operating cost when updating mixnode cost params * most delegation fixes * Wrapping delegation with node identity * Added MultiIndex on owner and identity key to unbonded mixnodes * Support for queries for unbonded nodes by owner or by identity key * Cargo fmt + ts types update * feature locking unused imports * fix(nym-wallet): typing and error (#1548) * post-rebase fixes * Changed storage key for new delegations map in vesting contract * fix(wallet): typing issues (#1562) * fix(wallet): error UI feedback (#1565) * clean(wallet): remove useless files (with flamethrowers 🔥) (#1567) * Changed default_mixnode_cost_params to allow accepting f32 instead * Revert "Changed default_mixnode_cost_params to allow accepting f32 instead" This reverts commit |
||
|
|
d3372bfc85 |
Additional, more informative routes (#1204)
* Have reward set updater run its own timer (#1200) * Have reward set updater run its own timer * Filter rocket log spam * Take last day of uptime for rewarding (#1202) * Take last day of uptime for rewarding * Rejigger calculations * Blacklist based on last 24 hr * Cleanup * Clippy * Additional, more informative routes * Improve blacklist updates * Fix rewards estimation |
||
|
|
9e8f550e6d |
Feature/signature on deposit (#1151)
* Add placeholder client for implementing coconut interactions * Add db for persistance * Add nymd client * Add new coconut-bandwidth contract * Call deposit function * Introduce error handling * Call the old flow of getting a signature * List available tx hashes * Add signed req in body * Save signature received * Add event generation * Checks in validator-api * Fail with error instead of panic in validator-api route * Fix contract address and small bug * Add file db for storing previous signatures * Encrypt and store data in validator-api * Decrypt the received signature * Remove tx hashes after getting credentials * Small listing changes in client * Change response so that it easier to serialize * Error message is sent to client for display * Remove already signed error and return the previous sig * Merge signature with deposit data in client * Entrypoint for getting the encrypted signature * Refactor blinding stuff so that it can be backed up * Backed up the blind sign request * Client can re-request the encrypted signature shares * Update crypto features * Fix clippy * Activate instantiate test and remove unused code * Add tx tests * Add verification key endpoint test * Voucher consistency test * Test for some errors and a race condition on blind signing * Refactor and add client trait for enabling better testing env * Test some more of blind sign * Finished testing all extract_encryption_key paths * Split into function test and endpoint test * Test for correct signature * Test for state functions * Remove print * Test blind_sign endpoint * Test for cached signature endpoint * Stricter types in voucher * Rename signature with partial_bandwidth_credential * Extra route levels * Length check and remove some unused code from coconut interface * Renamed coconut-bandwidth common crate * Renamed verification_key to identity_key * Use const instead of hardcoded values * Use type aliases for crypto algorithms * Remove unused mods, until needed * Remove unneeded unwrap * Fix some coconut issues that were blocking the wasm client build * Move from sled to existing sql database * Update tests for new db type * Fix wasm for coconut too * Remove sled from dependencies |
||
|
|
008fc045b7 | drop foreign key constraints | ||
|
|
fe6c685ab1 |
Feature/hourly set updates (#1012)
* Rename function/variables mixnodes->set * Stub utility interface * Rewarded set contract interface * Move epoch to common, epoch to contract * Move epoch to the chain * Rewarded set validator-api * [ci skip] Generate TS types * Epoch queries * Moved new code to a new module * Restored cosmwasm dependencies to their beta.3 versions for better compatibility with the rest of the codebase * Rewarded set write reorganisation * Stub for validator api module responsible for rewarded set updates * Reorganised validator api cache * Pending contract changes * Relevant updates to the validator client * Updating rewarded set based on contract state * Advancing/Setting current epoch in the contract * Using blocktime as 'now' at startup * Adjusted validator-api side rewarding code * Contract cleanup + query for epoch rewarded set heights * [ci skip] Generate TS types * Simplified rewarder processing loop and initial sync * [ci skip] Generate TS types * Fixed EXISTING query-related unit tests * Fixed existing unit tests for rewarding-related transactions * Cargo fmt * Removed some dead code * Using cosmwasm 1.0.0-beta3 for compatibility [with cw-storage-plus and rest of codebase] * Missing TryInto import * Additional storage and query related unit tests + a bug fix * Transaction-related unit tests + bug fixes * Required migration code * Update common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs Co-authored-by: Drazen Urch <drazen@urch.eu> * Update common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs Co-authored-by: Drazen Urch <drazen@urch.eu> * Constant renaming * Changed determining previous epoch return type to Option<Epoch> if they would precede the genesis * Exposed the new endpoint to the wallet * Epoch-related unit tests fixes * Recommended #[must_use] on next_epoch method * Renamed all epoch occurences to interval As they refer to the 'rewarding interval' Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com> Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com> |
||
|
|
8bcc931d9b |
Feature/removal of monitor good nodes (#833)
* Removed separated ipv4 and ipv6 testing * Testing network using chosen core nodes This should have probably been like 20 independent commits... sorry... * SQL migrations for updated schema * SQL updates * Using absolute uptime directly * New uptime calculations * Config entries, more DB work, some cleanup * Additional API query routes * More SQL and API work * Changed `_` to `-` in new routes * Removed good topology from config * Fixed gateways reader yield condition * Initial gateways pinger * Minor cleanup and logging level decreases * Missing trait derivations * Further logging adjustments * Unused commented out import * Claiming additional bandwidth in coconut feature when low * Fixed build with coconut feature * Minimum number of test routes * Making beta/nightly clippy happier |
||
|
|
b19528d47e |
Removed gateway rewarding and delegation (#856)
* Removed gateway rewarding and delegation * Removed redundant error variants * [ci skip] Generate TS types * Test fixes Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com> |
||
|
|
020cad897d |
Feature/rust rewarding (#750)
* Calculating gas fees * Ability to set custom fees * Added extra test * Removed commented code * Moved all msg types to common contract crate * Temporarily disabling get_tx method * Finishing up nymd client API * Comment fix * Remaining fee values * Some cleanup * Removed needless borrow * Fixed imports in contract tests * Moved error types around * New ValidatorClient * Experiment with new type of defaults * Removed dead module * Dealt with unwrap * Migrated mixnode to use new validator client * Migrated gateway to use new validator client * Mixnode and gateway adjustments * More exported defaults * Clients using new validator client * Fixed mixnode upgrade * Moved default values to a new crate * Changed behaviour of validator client features * Migrated basic functions of validator api * Updated config + fixed startup * Fixed wasm client build * Integration with the explorer api * Removed tokio dev dependency * Needless borrow * Fixex wasm client build * Fixed tauri client build * Needless borrows * New tables for rewarding * Updated cosmos-sdk version * Removed reward-specific node status routes * New rewarding-specific config entries * Additional network defaults * Initial periodic rewards from validator api * Replaced print with log * Filtering nodes with uptime > 0 * Additional failure logging statements * Fixed operation ordering * Adjusted next rewarding epoch determination * Modified rewarding behaviour to keep track of rewarding in progress * Improved error message on config load failure * Additional log statement * Adjusted rewarding gas limit calculation * Made naming slightly more consistent * Fixed incorrect parentheses placement * Fixed fee calculation * Cargo fmt * Removed failed merge artifacts * Introduced comment for any future reward modification * typos * Helper functions for the future * Making @mfahampshire 's life easier * Redesigned epoch + rewarding skipped epochs (if possible) * Removed old merge artifacts * Naming consistency * Constraining arguments * Removed unnecessary if branch * Ignore monitor check for current epoch * Additional checks for current epoch data * Monitor threshold check * cargo fmt * Fixed post-merge issues in transactions.rs |
||
|
|
15ae0f521e |
Feature/more reliable uptime calculation (#747)
* New database table holding monitor run info * SQL interface for new table * Updated uptime calculation to instead rely on number of monitor test runs |
||
|
|
c81454e00b | Validator API storage fixes and adjustments | ||
|
|
e5afd54ce0 |
Feature/node status api (#680)
* Basic storage stub * New models for new node status api * Route handling * Mounting new routes * Missing selective commit * Moved network monitor related files to separate package * Starting to see some sqlx action * Schema updates * Log statement upon finished migration * Removed old diesel related imports * Converted mixnode cache initialisation into a fairing * Moved cache related functionalities to separate package Also defined staging there * Created run method for validator cache + removed unwrap * Removed old node-status-api types and left bunch of todo placeholders in their place * Fixed managing validatorcache * Status reports are starting to get constructed * Submitting some dummy results to the database * Removing duplicate code for generating reports * Removed statuses older than 48h * Initial attempt at trying to obtain reports for all active nodes * Removed duplicates from the full report * Grabbing uptime history * Updating historical uptimes of active nodes * Updated sqlx-data.json * Removed all placeholder foomp owner values * Changed Layer serde behaviour for easier usage * Extended validator api config * Initial (seems working !) integration with network monitor * Added database path configuration to config * Using ValidatorCache in NetworkMonitor * Flag indicating whether validator cache has been initialised * Introduced a locla-only route for reward script to perform daily chores * Flag to save config to a file * Moved spawning of receiving future to run method rather than new * Removed arguments that dont make sense to be configured via CLI * Removed dead code from config file * More dead code removal * Added validator API to CI * Corrected manifest-path arguments * Constructing network monitor by passing config * Combined validator API CI with the main CI file * Using query_as for NodeStatus * Checking if historical uptimes were already calculated on particular day * Making id field NOT NULL * More query_as! action * Updated sqlx-data.json * Removed unused chrono feature * Renamed the migration file * Changed default validator endpoint to point to local validator * Removing unnecessary clone * More appropriate naming * Removed dead code * Lock file updates * Updated network monitor address in contract code * Don't stage node status api if network monitor is disabled * cargo fmt * Updated all license notices to SPDX |