51b511b27e
WIP; rebasing Another branch squash Squashing the v3 branch changing min pledge amounts logic for adding new nymnode into the contract converting mixnode/gateway bonding into nym-node bonding logic for migrating gateways into nymnodes ibid for mixnodes further nym-node work + fixed most existing unit tests forbid nymnode migration with pending cost params changes preassign nodeid for gateways changing role assignment and epoch progression changing role assignment and epoch progression optional custom http port logic for unbonding a nym-node updating Delegation struct logic for increasing pledge of either mixnode or nymnode logic for decreasing pledge of either mixnode or a nym node logic for changing cost params of either mixnode or a nym node wip initialise nymnodes storage fixing transaction tests fixed naive family tests reward-compatibility related works resolving delegation events introduced rewarded set metadata another iteration of restoring old tests updated rewarding part of nym-api parking the branch unparking the branch wip purged families added 'ExitGateway' role passing explicit work factor for rewarding function remove legacy layers storage wip: node description queries added announced ports to self-described api step1 in gruelling journey of adding node_id to gateways ensure epoch work never goes above 1.0 changed active set to contain role distribution [theoretically] sending rewarding messages for the new rewarded set [theoretically] assigning new rewarded set reimplementing more nym-api features remove legacy types re-implement legacy network monitor restoring further routes + minor refactor of NodeStatusCache skimmed routes now return legacy nodes alongside nym-nodes seemingly restored all functionalities in nym-api removing more legacy things from the contract initial contract cleanup added nym-api endpoints to return generic annotations regardless of type updated simulator to use new rewarding parameters more contract cleanup made existing mixnet contract tests compile extra validation of nym-node bonding parameters fixed additional compilation issues fixed nym-api v3 database migration failure added additional nym-node contract queries updated the schema made additional delegation/rewards queries compatible with both legacy mixnodes and nym-nodes fixing existing unit tests in mixnet contract wip resolved first batch of 500 compiler errors re-deprecating routes making wallet's rust backend compile fixed non-determinism in contract + nym-api build fixes to the build populating cotracts-cache with nym-nodes data more missing nymnodes queries temp mixnet contract methods + restored result submission in nym-api allow deprecated routes submitting correct results for mixnode results removed deprecated re-export of AxumAppState and removed smurf naming moved axum modules into support::http cleaning up nym-api warnings determine entry gateways before exits exposed transaction to update nym-node config missing memo for updating node config new routes added routes to swagger and fixed relative paths fixed some macro derivations added nym-node commands to nym-cli
156 lines
5.4 KiB
JSON
156 lines
5.4 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "RewardingParams",
|
|
"description": "Parameters used for reward calculation.",
|
|
"type": "object",
|
|
"required": [
|
|
"interval",
|
|
"rewarded_set"
|
|
],
|
|
"properties": {
|
|
"interval": {
|
|
"description": "Parameters that should remain unchanged throughout an interval.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/IntervalRewardParams"
|
|
}
|
|
]
|
|
},
|
|
"rewarded_set": {
|
|
"$ref": "#/definitions/RewardedSetParams"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"definitions": {
|
|
"Decimal": {
|
|
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
|
|
"type": "string"
|
|
},
|
|
"IntervalRewardParams": {
|
|
"description": "Parameters required by the mix-mining reward distribution that do not change during an interval.",
|
|
"type": "object",
|
|
"required": [
|
|
"active_set_work_factor",
|
|
"epoch_reward_budget",
|
|
"interval_pool_emission",
|
|
"reward_pool",
|
|
"stake_saturation_point",
|
|
"staking_supply",
|
|
"staking_supply_scale_factor",
|
|
"sybil_resistance"
|
|
],
|
|
"properties": {
|
|
"active_set_work_factor": {
|
|
"description": "Current active set work factor. It is not really expected to be changing very often. As a matter of fact, unless there's a very specific reason, it should remain constant.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
}
|
|
]
|
|
},
|
|
"epoch_reward_budget": {
|
|
"description": "Current value of the computed reward budget per epoch, per node. It is expected to be constant throughout the interval.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
}
|
|
]
|
|
},
|
|
"interval_pool_emission": {
|
|
"description": "Current maximum interval pool emission. Assuming all nodes in the rewarded set are fully saturated and have 100% performance, this % of the reward pool would get distributed in rewards to all operators and its delegators. It is not really expected to be changing very often. As a matter of fact, unless there's a very specific reason, it should remain constant.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Percent"
|
|
}
|
|
]
|
|
},
|
|
"reward_pool": {
|
|
"description": "Current value of the rewarding pool. It is expected to be constant throughout the interval.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
}
|
|
]
|
|
},
|
|
"stake_saturation_point": {
|
|
"description": "Current value of the stake saturation point. It is expected to be constant throughout the interval.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
}
|
|
]
|
|
},
|
|
"staking_supply": {
|
|
"description": "Current value of the staking supply. It is expected to be constant throughout the interval.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
}
|
|
]
|
|
},
|
|
"staking_supply_scale_factor": {
|
|
"description": "Defines the percentage of stake needed to reach saturation for all of the nodes in the rewarded set. Also known as `beta`.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Percent"
|
|
}
|
|
]
|
|
},
|
|
"sybil_resistance": {
|
|
"description": "Current value of the sybil resistance percent (`alpha`). It is not really expected to be changing very often. As a matter of fact, unless there's a very specific reason, it should remain constant.",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Percent"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"Percent": {
|
|
"description": "Percent represents a value between 0 and 100% (i.e. between 0.0 and 1.0)",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/Decimal"
|
|
}
|
|
]
|
|
},
|
|
"RewardedSetParams": {
|
|
"type": "object",
|
|
"required": [
|
|
"entry_gateways",
|
|
"exit_gateways",
|
|
"mixnodes",
|
|
"standby"
|
|
],
|
|
"properties": {
|
|
"entry_gateways": {
|
|
"description": "The expected number of nodes assigned entry gateway role (i.e. [`Role::EntryGateway`])",
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"exit_gateways": {
|
|
"description": "The expected number of nodes assigned exit gateway role (i.e. [`Role::ExitGateway`])",
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"mixnodes": {
|
|
"description": "The expected number of nodes assigned the 'mixnode' role, i.e. total of [`Role::Layer1`], [`Role::Layer2`] and [`Role::Layer3`].",
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"standby": {
|
|
"description": "Number of nodes in the 'standby' set. (i.e. [`Role::Standby`])",
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
}
|