020cad897d
* 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
63 lines
1.9 KiB
Rust
63 lines
1.9 KiB
Rust
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use crate::storage::UnixTimestamp;
|
|
|
|
// Internally used struct to catch results from the database to calculate uptimes for given mixnode/gateway
|
|
pub(crate) struct NodeStatus {
|
|
pub(crate) timestamp: UnixTimestamp,
|
|
pub(crate) up: bool,
|
|
}
|
|
|
|
// Internally used struct to catch results from the database to find active mixnodes/gateways
|
|
pub(crate) struct ActiveNode {
|
|
pub(crate) id: i64,
|
|
pub(crate) identity: String,
|
|
pub(crate) owner: String,
|
|
}
|
|
|
|
pub(crate) struct EpochRewarding {
|
|
#[allow(dead_code)]
|
|
pub(crate) id: i64,
|
|
#[allow(dead_code)]
|
|
pub(crate) epoch_timestamp: i64,
|
|
pub(crate) finished: bool,
|
|
}
|
|
|
|
pub(crate) struct RewardingReport {
|
|
// references particular epoch_rewarding
|
|
pub(crate) epoch_rewarding_id: i64,
|
|
|
|
pub(crate) eligible_mixnodes: i64,
|
|
pub(crate) eligible_gateways: i64,
|
|
|
|
pub(crate) possibly_unrewarded_mixnodes: i64,
|
|
pub(crate) possibly_unrewarded_gateways: i64,
|
|
}
|
|
|
|
pub(crate) struct FailedMixnodeRewardChunk {
|
|
// references particular epoch_rewarding (there can be multiple chunks in a rewarding epoch)
|
|
pub(crate) epoch_rewarding_id: i64,
|
|
pub(crate) error_message: String,
|
|
}
|
|
|
|
pub(crate) struct PossiblyUnrewardedMixnode {
|
|
// references particular FailedMixnodeRewardChunk (there can be multiple nodes in a chunk)
|
|
pub(crate) chunk_id: i64,
|
|
pub(crate) identity: String,
|
|
pub(crate) uptime: u8,
|
|
}
|
|
|
|
pub(crate) struct FailedGatewayRewardChunk {
|
|
// references particular epoch_rewarding (there can be multiple chunks in a rewarding epoch)
|
|
pub(crate) epoch_rewarding_id: i64,
|
|
pub(crate) error_message: String,
|
|
}
|
|
|
|
pub(crate) struct PossiblyUnrewardedGateway {
|
|
// references particular FailedGatewayRewardChunk (there can be multiple nodes in a chunk)
|
|
pub(crate) chunk_id: i64,
|
|
pub(crate) identity: String,
|
|
pub(crate) uptime: u8,
|
|
}
|