The policy for determining what happens when an application unstakes.
Preceded By:
+
1. Application Unstake
Domain Spaces:
+
1. Application Unstake Space
Followed By:
+
1. Update Application Stake Status
Codomain Spaces:
+
Constraints:
+
Application Delegate to Portal Policy
Policy for determining if application is able to delegate to a portal. The stake_per_app_delegation parameter, current stake of the portal, and current number of delegators will be used in determining if the portal is able to support the addition of this specific delegation.
Preceded By:
1. Application Delegate to Portal
Domain Spaces:
1. Application Delegate to Portal Space
Followed By:
Codomain Spaces:
1. Application Delegate to Portal Space
Constraints:
-
Set Application Parameters Policy
Policy for determining if application parameters should be updated
Preceded By:
+
Submit Relay Request Policy
The policy for determining aspects of the service request.
Preceded By:
+
1. Submit Relay Request
Domain Spaces:
+
1. Submit Relay Request Space
Followed By:
+
Codomain Spaces:
+
Constraints:
+
Policy Options:
+1. Submit Relay Request Policy Option V1
V1 Implementation
Logic: During each Session, the amount of POKT an Application has staked (see Application Protocol for more details) is mapped to "Service Tokens" that represent the amount of work a Servicer can provide using the SessionTokenBucketCoefficient governance parameter. The Token Bucket rate limiting algorithm is used to determine the maximum number of requests a Servicer can relay, and be rewarded for, thereby disincentivizing it to process relays for the Application once the cap is reached.
+
+At the beginning of the session, each Servicer initializes: AppSessionTokens = (AppStakeAmount * SessionTokenBucketCoefficient) / NumServicersPerSession. When one of the Servicers in the session is out of session tokens, the Application can continue to use other Servicers until every they are all exhausted.
+
+The mechanism described above enables future iterations of the protocol where different types of request may vary the required number of AppSessionTokens per request.
Set Application Parameters Policy
Policy for determining if application parameters should be updated
Preceded By:
1. Application Stake Policy
Domain Spaces:
1. Application Stake Space
Followed By:
1. Update Application Params
Codomain Spaces:
@@ -611,9 +788,14 @@
Logic:
1. Modify Application POKT Space
State Updates:
1. Application.Staked POKT
Constraints:
Logic:
-
The servicer at DOMAIN[0].application_address has its stake modified by DOMAIN[0].value
Update Application Params
The mechanism which updates application params
Preceded By:
+
The servicer at DOMAIN[0].application_address has its stake modified by DOMAIN[0].value
Update Application Stake Status
The mechanism which updates the staking status and as well the unstaking height for an application.
Preceded By:
+
1. Application Unstake Policy
Domain Spaces:
+
1. Application Stake Status Space
State Updates:
+
1. Application.Stake Status
2. Application.Unstaking Height
Constraints:
+
Logic:
+
The application at DOMAIN[0].address has its unstaking_height variable updated to DOMAIN[0].height which will be none if it is staking. It will also have its stake status set to DOMAIN[0].status.
Update Application Params
The mechanism which updates application params
Preceded By:
1. Set Application Parameters Policy
Domain Spaces:
1. Application Param Update Space
State Updates:
-
1. Application.Relay Chains
2. Application.GeoZone
3. Application.Number of Servicers
Constraints:
+
1. Application.Services
2. Application.GeoZone
3. Application.Number of Servicers
Constraints:
Logic:
-
The application at DOMAIN[0].public_key has its params updated
Parameters
stake_per_app_delegation
minimum_servicers_per_session
maximum_servicers_per_session
minimum_application_stake
\ No newline at end of file
+
The application at DOMAIN[0].public_key has its params updated
Parameters
minimum_servicers_per_session
minimum_application_stake
session_token_bucket_coefficient
maximum_servicers_per_session
stake_per_app_delegation
\ No newline at end of file
diff --git a/reports/entities/DAO.html b/reports/entities/DAO.html
index 4e0574a..56d2dbc 100644
--- a/reports/entities/DAO.html
+++ b/reports/entities/DAO.html
@@ -513,30 +513,30 @@
-
{current_height: Block Height, block_producer: Public Key}
Behavioral Action Space
Policies
Block Reward Policy Aggregate
The aggregate policy for creating the total amount of block reward and also splitting it between different groups.
There are two components that are aggregated here, one for fees and one for general block rewards. Based upon the numerous parameters, the total reward for each group is determined. For a more detailed version of the policy, one can look here: https://docs.google.com/spreadsheets/d/1QYe6NzuiyimsXs5cT1BSM-UT1DtX_K38cOZsEFJOtdA/edit#gid=242780369
Preceded By:
1. Mint Block Rewards
Domain Spaces:
1. Mint Block Rewards Space
Followed By:
1. Mint POKT Mechanism
2. Assign Servicer Salary Policy
3. Validator Block Reward Policy
4. DAO Block Reward Policy
Codomain Spaces:
1. Mint POKT Mechanism Space
2. Assign Servicer Salary Space
3. Validator Block Reward Space
Constraints:
-
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(RelayChain, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
+
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(Service, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
A Servicer must accumulate `MinimumTestScoreThreshold` TestScores before it is eligible for salary distribution. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either `TestScoreExpiration` is passed or the TestScore FIFO queue exceeds `MaxTestScores`.
-Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(RelayChain, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
+Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(Service, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
For example, a 100% ReportCard results in zero burning of the `maxServicerReward`, while a 80% ReportCard results in 20% burning of the maxServicerReward. The rate of decrease continues linearly until the `MinimumReportCardThreshold` is reached. Below the MinimumReportCardThreshold no reward is given to prevent cheap Sybil attacks and freeloading nodes. Unstaking causes the Servicer's ReportCard to be cleared and start from scratch.
The following is pseudo-code to illustrate this business logic:
```go
-// Called for each (relayChain, geoZone) pair every SessionBlockFrequency
-func DistributeRewards(relayChain, geoZone, height):
- totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(relayChain, geoZone, height)
+// Called for each (Service, geoZone) pair every SessionBlockFrequency
+func DistributeRewards(Service, geoZone, height):
+ totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(Service, geoZone, height)
totalAvailableReward = totalVolumeUsage * GovParams.UsageToRewardCoefficient(height)
- allServicers = WorldState.RetrieveEligibleServicers(relayChain, geoZone, height)
+ allServicers = WorldState.RetrieveEligibleServicers(Service, geoZone, height)
eligibleServicers = filterServicers(allServicers, GovParams.MinimumTestScoreThreshold(height))
maxServicerReward = totalAvailableReward / len(eligibleServicers)
@@ -549,7 +549,7 @@
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each
burnAmount = burnPercent * maxServicerReward
awardTokens(servicers, maxServicerReward - burnAmount)
- burnTokens(relayChain, geoZone, burnAmount)
+ burnTokens(Service, geoZone, burnAmount)
}
```
Preceded By:
1. Block Reward Policy Aggregate
Domain Spaces:
@@ -591,4 +591,4 @@
Logic:
1. Modify DAO POKT Space
State Updates:
1. DAO.POKT Holdings
Constraints:
Logic:
-
The DAO has its holdings increased by the value
Parameters
minimum_test_score_threshold
validator_fee_percentage
max_bootstrap_servicer_cost_per_relay
dao_fee_percentage
block_proposer_allocation
maturity_relay_charge
gateway_bootstrap_unwind_end
application_fee_per_relay
minimum_report_card_threshold
portal_fee_per_relay
min_bootstrap_gateway_fee_per_relay
gateway_bootstrap_unwind_start
relays_to_tokens_multiplier
maturity_relay_cost
servicer_bootstrap_unwind_start
servicer_bootstrap_end
transaction_fee
\ No newline at end of file
+
The DAO has its holdings increased by the value
Parameters
maturity_relay_cost
gateway_bootstrap_unwind_end
validator_fee_percentage
transaction_fee
block_proposer_allocation
servicer_bootstrap_unwind_start
gateway_bootstrap_unwind_start
minimum_test_score_threshold
dao_fee_percentage
portal_fee_per_relay
servicer_bootstrap_end
minimum_report_card_threshold
relays_to_tokens_multiplier
min_bootstrap_gateway_fee_per_relay
application_fee_per_relay
max_bootstrap_servicer_cost_per_relay
maturity_relay_charge
\ No newline at end of file
diff --git a/reports/entities/Fisherman.html b/reports/entities/Fisherman.html
index 8f798db..167a803 100644
--- a/reports/entities/Fisherman.html
+++ b/reports/entities/Fisherman.html
@@ -202,7 +202,7 @@
State
Local States
Servicer State
Type
Symbol
Domain
-
Public key
The identifier of the node
Public Key
Servicer Salary
A ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequency
uPOKT
Report Card
The report card used when determing salary for a servicer. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either TestScoreExpiration is passed or the TestScore FIFO queue exceeds MaxTestScores.
Service Report Card
Test Scores
The QoS test scores
Service Test Scores
POKT Holdings
The personal holdings of the servicer in uPOKT
uPOKT
Staked POKT
The amount that is staked by the servicer currently in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Relay Chains
The flavor(s) of Web3 hosted by this Servicer
List[Relay Chain]
GeoZone
The physical geo-location identifier this Servicer registered in. There is no formal requirement or validation (e.g. IP verification) for an actor to be physically located in the GeoZone it registers in. However, crypto-economic incentives drive actors to be registered close to where they are physically located to receive and provide the best service possible. The number of GeoZones an actor can stake for is limited to one to incentivize real geographic distribution.
GeoZone
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Pause Height
The height for which a servicer has been paused at
Block Height
Stake Status
The status of staking for the actor
StakeStatusType
Fisherman State
+
Public key
The identifier of the node
Public Key
Servicer Salary
A ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequency
uPOKT
Report Card
The report card used when determing salary for a servicer. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either TestScoreExpiration is passed or the TestScore FIFO queue exceeds MaxTestScores.
Service Report Card
Test Scores
The QoS test scores
Service Test Scores
POKT Holdings
The personal holdings of the servicer in uPOKT
uPOKT
Staked POKT
The amount that is staked by the servicer currently in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Services
The flavor(s) of Web3 hosted by this Servicer
List[Service]
GeoZone
The physical geo-location identifier this Servicer registered in. There is no formal requirement or validation (e.g. IP verification) for an actor to be physically located in the GeoZone it registers in. However, crypto-economic incentives drive actors to be registered close to where they are physically located to receive and provide the best service possible. The number of GeoZones an actor can stake for is limited to one to incentivize real geographic distribution.
GeoZone
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Pause Height
The height for which a servicer has been paused at
Block Height
Stake Status
The status of staking for the actor
StakeStatusType
Unstaking Height
The height for which a servicer has begun unstaking at or none to represent no unstaking
The physical geo-location identifier this Servicer registered in
GeoZone
Number of Servicers
The number of servicers an application would prefer, if available, for a session.
int
Stake Status
The status of staking for the actor
StakeStatusType
Unstaking Height
The height for which a servicer has begun unstaking at or none to represent no unstaking
Block Height
Portal State
Name
Description
Type
Symbol
Domain
-
Public key
The identifier of the application
Public Key
POKT Holdings
The personal holdings of the application in uPOKT
uPOKT
Staked POKT
The staked amount of the application in uPOKT
uPOKT
Relay Chains
The flavor(s) of Web3 hosted by this Servicer
List[Relay Chain]
GeoZone
The physical geo-location identifier this Servicer registered in
GeoZone
Number of Servicers
The number of servicers an application would prefer, if available, for a session.
int
Stake Status
The status of staking for the actor
StakeStatusType
Spaces
Submit Relay Request Space
{payload: dict, meta: dict, proof: dict, application_address: Public Key}
Portal Registration Space
{public_key: Public Key, stake_amount: uPOKT, service_url: Service URL}
Portal Unregistration Space
{public_key: Public Key}
Portal Relay Request Space
{}
Behavioral Action Space
Portal Unregistration
A Portal is able to submit an UnstakeMsg to exit and remove itself from the network. After a successful UnstakeMsg, the Portal is no eligible sign relays on behalf of an Application. On-chain delegation from existing Applications will be removed from the world state. After the PortalUnstakingTime unbonding time elapses, the remaining stake is returned to the Portal's address.
Called By:
+
Stake Status
The status of staking for the actor
StakeStatusType
Spaces
Portal Unregistration Space
{public_key: Public Key}
Submit Relay Request Space
{payload: dict, meta: dict, proof: dict, application_address: Public Key}
Portal Relay Request Space
{}
Portal Registration Space
{public_key: Public Key, stake_amount: uPOKT, service_url: Service URL}
Behavioral Action Space
Submit Relay Request
An application or the portal acting on its behalf submits a Relay Request, or an API requests to be routed to any Service
Called By:
+
1. Application
2. Portal
Constraints:
+
Portal Unregistration
A Portal is able to submit an UnstakeMsg to exit and remove itself from the network. After a successful UnstakeMsg, the Portal is no eligible sign relays on behalf of an Application. On-chain delegation from existing Applications will be removed from the world state. After the PortalUnstakingTime unbonding time elapses, the remaining stake is returned to the Portal's address.
Called By:
1. Portal
Constraints:
Submit Relay Request (Portal)
Portal submitting a relay request on behalf of an application.
Called By:
1. Portal
Constraints:
Portal Registration
Registration differs from staking in the sense that the pubKey is known but there are no economic benefits/penalties in this stage of the protocol's progression. The Portal must register on-chain in order for the Servicer to accept its signature as part of the ring. Future versions of the protocol may include on-chain rewards or penalties for the Portal, but the current iteration will incentivize Portals to provide a high quality, highly trusted service through free market economics.
Called By:
1. Portal
Constraints:
-
Submit Relay Request
An application or the portal acting on its behalf submits a Relay Request, or an API requests to be routed to any Relay Chain
Called By:
-
1. Application
2. Portal
Constraints:
-
Policies
Submit Relay Request (Portal) Policy
Policy which handles the logic of portal relay requests and fees
Preceded By:
+
Policies
Submit Relay Request Policy
The policy for determining aspects of the service request.
Preceded By:
+
1. Submit Relay Request
Domain Spaces:
+
1. Submit Relay Request Space
Followed By:
+
Codomain Spaces:
+
Constraints:
+
Policy Options:
+1. Submit Relay Request Policy Option V1
V1 Implementation
Logic: During each Session, the amount of POKT an Application has staked (see Application Protocol for more details) is mapped to "Service Tokens" that represent the amount of work a Servicer can provide using the SessionTokenBucketCoefficient governance parameter. The Token Bucket rate limiting algorithm is used to determine the maximum number of requests a Servicer can relay, and be rewarded for, thereby disincentivizing it to process relays for the Application once the cap is reached.
+
+At the beginning of the session, each Servicer initializes: AppSessionTokens = (AppStakeAmount * SessionTokenBucketCoefficient) / NumServicersPerSession. When one of the Servicers in the session is out of session tokens, the Application can continue to use other Servicers until every they are all exhausted.
+
+The mechanism described above enables future iterations of the protocol where different types of request may vary the required number of AppSessionTokens per request.
Submit Relay Request (Portal) Policy
Policy which handles the logic of portal relay requests and fees
Action for Service moving to be added to the system.
Called By:
+
1. Service
Constraints:
+
Service Leave
Action for Service moving to leave the system.
Called By:
+
1. Service
Constraints:
Policies
Mechanisms
Parameters
\ No newline at end of file
diff --git a/reports/entities/Service.html b/reports/entities/Service.html
new file mode 100644
index 0000000..6d7b75e
--- /dev/null
+++ b/reports/entities/Service.html
@@ -0,0 +1,99 @@
+
For explanations of generalized dynamical systems as well as how the mathematical specification library works in detail, please consult the documentation here
Graph Legend: Cylinder: Entity Orange Diamond: Boundary Action Red Square: Policy Blue Circle: Mechanism Transparent Circle: State Variable
A ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequency
uPOKT
Report Card
The report card used when determing salary for a servicer. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either TestScoreExpiration is passed or the TestScore FIFO queue exceeds MaxTestScores.
Service Report Card
Test Scores
The QoS test scores
Service Test Scores
POKT Holdings
The personal holdings of the servicer in uPOKT
uPOKT
Staked POKT
The amount that is staked by the servicer currently in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Relay Chains
The flavor(s) of Web3 hosted by this Servicer
List[Relay Chain]
GeoZone
The physical geo-location identifier this Servicer registered in. There is no formal requirement or validation (e.g. IP verification) for an actor to be physically located in the GeoZone it registers in. However, crypto-economic incentives drive actors to be registered close to where they are physically located to receive and provide the best service possible. The number of GeoZones an actor can stake for is limited to one to incentivize real geographic distribution.
GeoZone
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Pause Height
The height for which a servicer has been paused at
Block Height
Stake Status
The status of staking for the actor
StakeStatusType
Validator State
+
Public key
The identifier of the validator
Public Key
POKT Holdings
The personal holdings of the validator in uPOKT
uPOKT
Staked POKT
The staked amount of the validator in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Stake Status
The status of staking for the actor
StakeStatusType
Servicer State
Name
Description
Type
Symbol
Domain
-
Public key
The identifier of the validator
Public Key
POKT Holdings
The personal holdings of the validator in uPOKT
uPOKT
Staked POKT
The staked amount of the validator in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Stake Status
The status of staking for the actor
StakeStatusType
Fisherman State
+
Public key
The identifier of the node
Public Key
Servicer Salary
A ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequency
uPOKT
Report Card
The report card used when determing salary for a servicer. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either TestScoreExpiration is passed or the TestScore FIFO queue exceeds MaxTestScores.
Service Report Card
Test Scores
The QoS test scores
Service Test Scores
POKT Holdings
The personal holdings of the servicer in uPOKT
uPOKT
Staked POKT
The amount that is staked by the servicer currently in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Services
The flavor(s) of Web3 hosted by this Servicer
List[Service]
GeoZone
The physical geo-location identifier this Servicer registered in. There is no formal requirement or validation (e.g. IP verification) for an actor to be physically located in the GeoZone it registers in. However, crypto-economic incentives drive actors to be registered close to where they are physically located to receive and provide the best service possible. The number of GeoZones an actor can stake for is limited to one to incentivize real geographic distribution.
GeoZone
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Pause Height
The height for which a servicer has been paused at
Block Height
Stake Status
The status of staking for the actor
StakeStatusType
Unstaking Height
The height for which a servicer has begun unstaking at or none to represent no unstaking
Block Height
Fisherman State
Name
Description
Type
Symbol
Domain
-
Stake Status
The status of staking for the actor
StakeStatusType
Spaces
Servicer Stake Space
{public_key: Public Key, stake_amount: uPOKT, service_url: Service URL, relay_chains: List[Relay Chain], geo_zone: GeoZone, operator_public_key: Public Key}
{public_key: Public Key, number_of_relays: int, usage_to_reward_coeffecient: float}
Behavioral Action Space
Servicer Stake
In order to participate as a Servicer in Pocket Network, each actor is required to bond a certain amount of tokens in escrow while they are providing Web3 access. These tokens may be burnt or removed from the actor as a result of breaking the Protocol’s Service Level Agreement, a DAO defined set of requirements for the minimum quality of service.
{public_key: Public Key, number_of_relays: int, usage_to_reward_coeffecient: float}
Behavioral Action Space
Servicer Unpause
When a Servicer is paused, they are able resume service by submitting an `UnpauseMsg` after the `MinPauseTime` has elapsed. After a `UnpauseMsg` is validated and the World State is updated, the Servicer is eligible to continue providing Web3 service to Applications, and receive rewards.
Called By:
1. Servicer
Constraints:
-
Servicer Relay
A Servicer ‘services’ the Application, by routing the Relay Request to the Relay Chain and forwarding the response to the Application.
Called By:
-
1. Servicer
Constraints:
-
Servicer Pause
Servicers are able to gracefully pause their service (e.g. for maintenance reasons) without the need to unstake or face downtime penalization. In addition to an Operator initiated `PauseMsg`, Fishermen are also able to temporarily pause a Servicer if a faulty or malicious process is detected during sampling.
Called By:
-
1. Servicer
2. Fisherman
Constraints:
-
Servicer Unpause
When a Servicer is paused, they are able resume service by submitting an `UnpauseMsg` after the `MinPauseTime` has elapsed. After a `UnpauseMsg` is validated and the World State is updated, the Servicer is eligible to continue providing Web3 service to Applications, and receive rewards.
Called By:
+
Servicer Unstake
The action of unstaking from the network for a servicer
Called By:
1. Servicer
Constraints:
Unjail Node
Process of a node submitting to be unjailed.
Called By:
1. Servicer
2. Validator
Constraints:
-
Servicer Unstake
The action of unstaking from the network for a servicer
Called By:
+
Servicer Stake
In order to participate as a Servicer in Pocket Network, each actor is required to bond a certain amount of tokens in escrow while they are providing Web3 access. These tokens may be burnt or removed from the actor as a result of breaking the Protocol’s Service Level Agreement, a DAO defined set of requirements for the minimum quality of service.
Called By:
+
1. Servicer
Constraints:
+
Servicer Relay
A Servicer ‘services’ the Application, by routing the Relay Request to the Service and forwarding the response to the Application.
Called By:
1. Servicer
Constraints:
-
Policies
Servicer Block Reward Policy
Policy which determines block rewards for servicers. The formula breaks down into the following:
+
Servicer Pause
Servicers are able to gracefully pause their service (e.g. for maintenance reasons) without the need to unstake or face downtime penalization. In addition to an Operator initiated `PauseMsg`, Fishermen are also able to temporarily pause a Servicer if a faulty or malicious process is detected during sampling.
Called By:
+
1. Servicer
2. Fisherman
Constraints:
+
Policies
Servicer Unpause Policy
The policy which determines if an unpause can take place
Preceded By:
+
1. Servicer Unpause
Domain Spaces:
+
1. Servicer Unpause Space
Followed By:
+
1. Servicer Unpause Mechanism
Codomain Spaces:
+
1. Servicer Unpause Space 2
Constraints:
+
Servicer Unstake Policy
The policy which determines any behaviors around servicers unstaking.
Preceded By:
+
1. Servicer Unstake
Domain Spaces:
+
1. Servicer Unstake Space
Followed By:
+
1. Update Servicer Stake Status
Codomain Spaces:
+
1. Servicer Stake Status Space
Constraints:
+
Block Reward Policy Aggregate
The aggregate policy for creating the total amount of block reward and also splitting it between different groups.
+
+There are two components that are aggregated here, one for fees and one for general block rewards. Based upon the numerous parameters, the total reward for each group is determined. For a more detailed version of the policy, one can look here: https://docs.google.com/spreadsheets/d/1QYe6NzuiyimsXs5cT1BSM-UT1DtX_K38cOZsEFJOtdA/edit#gid=242780369
Preceded By:
+
1. Mint Block Rewards
Domain Spaces:
+
1. Mint Block Rewards Space
Followed By:
+
1. Mint POKT Mechanism
2. Assign Servicer Salary Policy
3. Validator Block Reward Policy
4. DAO Block Reward Policy
Codomain Spaces:
+
1. Mint POKT Mechanism Space
2. Assign Servicer Salary Space
3. Validator Block Reward Space
Constraints:
+
Servicer Block Reward Policy
Policy which determines block rewards for servicers. The formula breaks down into the following:
1. reward_amount = INPUTS[0].number_of_relays * relays_to_tokens_multiplier
2. bin_number = (min(servicer_stake, servicer_stake_weight_ceiling) - stake_minimum) // servicer_stake_floor_multiplier + 1
3. reward_amount = reward_amount * bin_number ** servicer_stake_floor_multiplier_exponent / servicer_stake_weight_multiplier
@@ -1454,13 +1603,6 @@
Policies
Servicer Block Reward Policy
Policy which determines
1. Servicer Block Reward Space
Followed By:
1. Modify Servicer POKT Holdings
2. Mint POKT Mechanism
Codomain Spaces:
1. Modify Servicer POKT Space
2. Mint POKT Mechanism Space
Constraints:
-
Block Reward Policy Aggregate
The aggregate policy for creating the total amount of block reward and also splitting it between different groups.
-
-There are two components that are aggregated here, one for fees and one for general block rewards. Based upon the numerous parameters, the total reward for each group is determined. For a more detailed version of the policy, one can look here: https://docs.google.com/spreadsheets/d/1QYe6NzuiyimsXs5cT1BSM-UT1DtX_K38cOZsEFJOtdA/edit#gid=242780369
Preceded By:
-
1. Mint Block Rewards
Domain Spaces:
-
1. Mint Block Rewards Space
Followed By:
-
1. Mint POKT Mechanism
2. Assign Servicer Salary Policy
3. Validator Block Reward Policy
4. DAO Block Reward Policy
Codomain Spaces:
-
1. Mint POKT Mechanism Space
2. Assign Servicer Salary Space
3. Validator Block Reward Space
Constraints:
Servicer Stake Policy
Policy which takes care of actions to occur after a servicer attempts to stake
Preceded By:
1. Servicer Stake
Domain Spaces:
1. Servicer Stake Space
Followed By:
@@ -1468,9 +1610,9 @@
Servicer Stake Policy
Policy which takes care of actions to occur aft
1. Servicer Stake Space
2. Modify Servicer POKT Space
3. Modify Servicer POKT Space
Constraints:
1. DOMAIN[0].public_key must not be null
2. DOMAIN[0].amount > 0
-
3. LEN(DOMAIN[0].relay_chains) > 0
-
4. All chains in DOMAIN[0].relay_chains must be valid
-
The policy which determines what happens with a servicer relay including the fees.
Preceded By:
1. Servicer Relay
Domain Spaces:
1. Servicer Relay Space
Followed By:
@@ -1481,28 +1623,23 @@
Servicer Pause Policy
The policy which determines if a servicer will
1. Servicer Pause Space
Followed By:
1. Servicer Update Pause Height
Codomain Spaces:
1. Servicer Pause Space 2
Constraints:
-
Servicer Unpause Policy
The policy which determines if an unpause can take place
Preceded By:
-
1. Servicer Unpause
Domain Spaces:
-
1. Servicer Unpause Space
Followed By:
-
1. Servicer Unpause Mechanism
Codomain Spaces:
-
1. Servicer Unpause Space 2
Constraints:
-
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(RelayChain, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
+
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(Service, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
A Servicer must accumulate `MinimumTestScoreThreshold` TestScores before it is eligible for salary distribution. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either `TestScoreExpiration` is passed or the TestScore FIFO queue exceeds `MaxTestScores`.
-Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(RelayChain, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
+Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(Service, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
For example, a 100% ReportCard results in zero burning of the `maxServicerReward`, while a 80% ReportCard results in 20% burning of the maxServicerReward. The rate of decrease continues linearly until the `MinimumReportCardThreshold` is reached. Below the MinimumReportCardThreshold no reward is given to prevent cheap Sybil attacks and freeloading nodes. Unstaking causes the Servicer's ReportCard to be cleared and start from scratch.
The following is pseudo-code to illustrate this business logic:
```go
-// Called for each (relayChain, geoZone) pair every SessionBlockFrequency
-func DistributeRewards(relayChain, geoZone, height):
- totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(relayChain, geoZone, height)
+// Called for each (Service, geoZone) pair every SessionBlockFrequency
+func DistributeRewards(Service, geoZone, height):
+ totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(Service, geoZone, height)
totalAvailableReward = totalVolumeUsage * GovParams.UsageToRewardCoefficient(height)
- allServicers = WorldState.RetrieveEligibleServicers(relayChain, geoZone, height)
+ allServicers = WorldState.RetrieveEligibleServicers(Service, geoZone, height)
eligibleServicers = filterServicers(allServicers, GovParams.MinimumTestScoreThreshold(height))
maxServicerReward = totalAvailableReward / len(eligibleServicers)
@@ -1515,7 +1652,7 @@
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each
burnAmount = burnPercent * maxServicerReward
awardTokens(servicers, maxServicerReward - burnAmount)
- burnTokens(relayChain, geoZone, burnAmount)
+ burnTokens(Service, geoZone, burnAmount)
}
```
Preceded By:
1. Block Reward Policy Aggregate
Domain Spaces:
@@ -1538,17 +1675,27 @@
Set Servicer Parameters Policy
Policy for determining the impact of s
1. Prune Servicer QoS
2. Update Servicer Params
Codomain Spaces:
1. Servicer Param Update Space
2. Servicer Param Update Space
Constraints:
Policy Options:
-1. Set Servicer Parameters Policy V1
This policy determines if the parameters of a servicer should be updated and if so executes on it.
Logic: As long as the servicer has a staking amount equal to or greater than the current staked amount, the servicer will have its parameters all updated. In addition, the Servicer's historical QoS (TestScores, ReportCard, etc...) will be pruned from the state.
Mechanisms
Modify Servicer POKT Holdings
The mechanism to update the personal holdings of a servicer
Preceded By:
-
1. Servicer Stake Policy
2. Servicer Block Reward Policy
3. Assign Servicer Salary Policy
Domain Spaces:
-
1. Modify Servicer POKT Space
State Updates:
-
1. Servicer.POKT Holdings
Constraints:
+1. Set Servicer Parameters Policy V1
This policy determines if the parameters of a servicer should be updated and if so executes on it.
Logic: As long as the servicer has a staking amount equal to or greater than the current staked amount, the servicer will have its parameters all updated. In addition, the Servicer's historical QoS (TestScores, ReportCard, etc...) will be pruned from the state.
Mechanisms
Servicer Unpause Mechanism
The mechanism which unpauses a servicer
Preceded By:
+
1. Servicer Unpause Policy
Domain Spaces:
+
1. Servicer Unpause Space 2
State Updates:
+
1. Servicer.Pause Height
Constraints:
Logic:
-
The servicer at DOMAIN[0].servicer_address has its POKT Holdings modified by DOMAIN[0].value
Mint POKT Mechanism
The mechanism which has the treasury minting POKT
Preceded By:
+
The servicer at DOMAIN[0].address has its pause_height variable updated to None
Update Servicer Stake Status
The mechanism which updates the staking status and as well the unstaking height.
Preceded By:
+
1. Servicer Unstake Policy
Domain Spaces:
+
1. Servicer Stake Status Space
State Updates:
+
1. Servicer.Stake Status
2. Servicer.Unstaking Height
Constraints:
+
Logic:
+
The servicer at DOMAIN[0].address has its unstaking_height variable updated to DOMAIN[0].height which will be none if it is staking. It will also have its stake status set to DOMAIN[0].status.
Mint POKT Mechanism
The mechanism which has the treasury minting POKT
Preceded By:
1. Servicer Block Reward Policy
2. Block Reward Policy Aggregate
Domain Spaces:
1. Mint POKT Mechanism Space
State Updates:
1. Treasury.Floating Supply
Constraints:
Logic:
-
The floating supply increases by the POKT amount
Modify Servicer Stake
The mechanism to update the stake of a servicer
Preceded By:
+
The floating supply increases by the POKT amount
Modify Servicer POKT Holdings
The mechanism to update the personal holdings of a servicer
Preceded By:
+
1. Servicer Stake Policy
2. Servicer Block Reward Policy
3. Assign Servicer Salary Policy
Domain Spaces:
+
1. Modify Servicer POKT Space
State Updates:
+
1. Servicer.POKT Holdings
Constraints:
+
Logic:
+
The servicer at DOMAIN[0].servicer_address has its POKT Holdings modified by DOMAIN[0].value
Modify Servicer Stake
The mechanism to update the stake of a servicer
Preceded By:
1. Servicer Stake Policy
Domain Spaces:
1. Modify Servicer POKT Space
State Updates:
1. Servicer.Staked POKT
Constraints:
@@ -1558,12 +1705,7 @@
Logic:
1. Servicer Pause Space 2
State Updates:
1. Servicer.Pause Height
Constraints:
Logic:
-
The servicer at DOMAIN[0].address has its pause_height variable updated to DOMAIN[0].height
Servicer Unpause Mechanism
The mechanism which unpauses a servicer
Preceded By:
-
1. Servicer Unpause Policy
Domain Spaces:
-
1. Servicer Unpause Space 2
State Updates:
-
1. Servicer.Pause Height
Constraints:
-
Logic:
-
The servicer at DOMAIN[0].address has its pause_height variable updated to None
Burn POKT Mechanism
The mechanism which has the treasury burning POKT
Preceded By:
+
The servicer at DOMAIN[0].address has its pause_height variable updated to DOMAIN[0].height
Burn POKT Mechanism
The mechanism which has the treasury burning POKT
Preceded By:
1. Assign Servicer Salary Policy
Domain Spaces:
1. Burn POKT Mechanism Space
State Updates:
1. Treasury.Floating Supply
Constraints:
@@ -1586,6 +1728,6 @@
Logic:
The servicer at DOMAIN[0].public_key has its QoS metrics pruned
Update Servicer Params
The mechanism which updates servicer params
Preceded By:
1. Set Servicer Parameters Policy
Domain Spaces:
1. Servicer Param Update Space
State Updates:
-
1. Servicer.Service URL
2. Servicer.Relay Chains
3. Servicer.GeoZone
4. Servicer.Operator Public Key
Constraints:
+
1. Servicer.Service URL
2. Servicer.Services
3. Servicer.GeoZone
4. Servicer.Operator Public Key
Constraints:
Logic:
-
The servicer at DOMAIN[0].public_key has its params updated with the latest stake, assuming the stake was greater than the prior stake
Parameters
dao_fee_percentage
maturity_relay_charge
gateway_bootstrap_unwind_end
downtime_jail_duration
servicer_bootstrap_end
minimum_test_score_threshold
validator_fee_percentage
application_fee_per_relay
portal_fee_per_relay
relays_to_tokens_multiplier
maturity_relay_cost
minimum_stake_servicer
minimum_pause_time
max_bootstrap_servicer_cost_per_relay
servicer_stake_weight_ceiling
max_chains_servicer
servicer_bootstrap_unwind_start
transaction_fee
block_proposer_allocation
minimum_report_card_threshold
servicer_stake_floor_multiplier
min_bootstrap_gateway_fee_per_relay
gateway_bootstrap_unwind_start
servicer_stake_weight_multiplier
servicer_stake_floor_multiplier_exponent
\ No newline at end of file
+
The servicer at DOMAIN[0].public_key has its params updated with the latest stake, assuming the stake was greater than the prior stake
Parameters
maturity_relay_cost
relays_to_tokens_multiplier
min_bootstrap_gateway_fee_per_relay
max_bootstrap_servicer_cost_per_relay
validator_fee_percentage
transaction_fee
minimum_test_score_threshold
portal_fee_per_relay
servicer_stake_weight_ceiling
application_fee_per_relay
minimum_stake_servicer
maturity_relay_charge
servicer_stake_floor_multiplier
gateway_bootstrap_unwind_end
block_proposer_allocation
servicer_bootstrap_unwind_start
gateway_bootstrap_unwind_start
downtime_jail_duration
max_chains_servicer
dao_fee_percentage
minimum_report_card_threshold
servicer_stake_weight_multiplier
minimum_pause_time
servicer_stake_floor_multiplier_exponent
servicer_bootstrap_end
\ No newline at end of file
diff --git a/reports/entities/Treasury.html b/reports/entities/Treasury.html
index 841ec13..d61ad60 100644
--- a/reports/entities/Treasury.html
+++ b/reports/entities/Treasury.html
@@ -636,7 +636,7 @@
{public_key: Public Key, number_of_relays: int, usage_to_reward_coeffecient: float}
Modify Servicer POKT Space
{public_key: Public Key, amount: uPOKT}
Burn POKT Space
{burn_amount: uPOKT, block_height: Block Height}
Mint Block Rewards Space
{current_height: Block Height, block_producer: Public Key}
Behavioral Action Space
Burn POKT
Treasury burning supply of POKT
Called By:
1. Treasury
Constraints:
Policies
Servicer Block Reward Policy
Policy which determines block rewards for servicers. The formula breaks down into the following:
1. reward_amount = INPUTS[0].number_of_relays * relays_to_tokens_multiplier
@@ -655,23 +655,23 @@
Block Reward Policy Aggregate
The aggregate policy for creating the t
1. Mint Block Rewards Space
Followed By:
1. Mint POKT Mechanism
2. Assign Servicer Salary Policy
3. Validator Block Reward Policy
4. DAO Block Reward Policy
Codomain Spaces:
1. Mint POKT Mechanism Space
2. Assign Servicer Salary Space
3. Validator Block Reward Space
Constraints:
-
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(RelayChain, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
+
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(Service, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
A Servicer must accumulate `MinimumTestScoreThreshold` TestScores before it is eligible for salary distribution. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either `TestScoreExpiration` is passed or the TestScore FIFO queue exceeds `MaxTestScores`.
-Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(RelayChain, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
+Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(Service, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
For example, a 100% ReportCard results in zero burning of the `maxServicerReward`, while a 80% ReportCard results in 20% burning of the maxServicerReward. The rate of decrease continues linearly until the `MinimumReportCardThreshold` is reached. Below the MinimumReportCardThreshold no reward is given to prevent cheap Sybil attacks and freeloading nodes. Unstaking causes the Servicer's ReportCard to be cleared and start from scratch.
The following is pseudo-code to illustrate this business logic:
```go
-// Called for each (relayChain, geoZone) pair every SessionBlockFrequency
-func DistributeRewards(relayChain, geoZone, height):
- totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(relayChain, geoZone, height)
+// Called for each (Service, geoZone) pair every SessionBlockFrequency
+func DistributeRewards(Service, geoZone, height):
+ totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(Service, geoZone, height)
totalAvailableReward = totalVolumeUsage * GovParams.UsageToRewardCoefficient(height)
- allServicers = WorldState.RetrieveEligibleServicers(relayChain, geoZone, height)
+ allServicers = WorldState.RetrieveEligibleServicers(Service, geoZone, height)
eligibleServicers = filterServicers(allServicers, GovParams.MinimumTestScoreThreshold(height))
maxServicerReward = totalAvailableReward / len(eligibleServicers)
@@ -684,7 +684,7 @@
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each
burnAmount = burnPercent * maxServicerReward
awardTokens(servicers, maxServicerReward - burnAmount)
- burnTokens(relayChain, geoZone, burnAmount)
+ burnTokens(Service, geoZone, burnAmount)
}
```
Preceded By:
1. Block Reward Policy Aggregate
Domain Spaces:
@@ -726,4 +726,4 @@
Logic:
1. Modify DAO POKT Space
State Updates:
1. DAO.POKT Holdings
Constraints:
Logic:
-
The DAO has its holdings increased by the value
Parameters
dao_fee_percentage
maturity_relay_charge
gateway_bootstrap_unwind_end
servicer_bootstrap_end
minimum_test_score_threshold
validator_fee_percentage
application_fee_per_relay
portal_fee_per_relay
relays_to_tokens_multiplier
maturity_relay_cost
max_bootstrap_servicer_cost_per_relay
servicer_stake_weight_ceiling
servicer_bootstrap_unwind_start
transaction_fee
block_proposer_allocation
minimum_report_card_threshold
servicer_stake_floor_multiplier
min_bootstrap_gateway_fee_per_relay
gateway_bootstrap_unwind_start
servicer_stake_weight_multiplier
servicer_stake_floor_multiplier_exponent
\ No newline at end of file
+
The DAO has its holdings increased by the value
Parameters
maturity_relay_cost
relays_to_tokens_multiplier
min_bootstrap_gateway_fee_per_relay
max_bootstrap_servicer_cost_per_relay
validator_fee_percentage
transaction_fee
minimum_test_score_threshold
portal_fee_per_relay
servicer_stake_weight_ceiling
application_fee_per_relay
maturity_relay_charge
servicer_stake_floor_multiplier
gateway_bootstrap_unwind_end
block_proposer_allocation
servicer_bootstrap_unwind_start
gateway_bootstrap_unwind_start
dao_fee_percentage
minimum_report_card_threshold
servicer_stake_weight_multiplier
servicer_stake_floor_multiplier_exponent
servicer_bootstrap_end
\ No newline at end of file
diff --git a/reports/entities/Validator.html b/reports/entities/Validator.html
index 298e495..dffa6fb 100644
--- a/reports/entities/Validator.html
+++ b/reports/entities/Validator.html
@@ -577,21 +577,21 @@
-
State
Local States
Servicer State
+
State
Local States
Validator State
Name
Description
Type
Symbol
Domain
-
Public key
The identifier of the node
Public Key
Servicer Salary
A ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequency
uPOKT
Report Card
The report card used when determing salary for a servicer. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either TestScoreExpiration is passed or the TestScore FIFO queue exceeds MaxTestScores.
Service Report Card
Test Scores
The QoS test scores
Service Test Scores
POKT Holdings
The personal holdings of the servicer in uPOKT
uPOKT
Staked POKT
The amount that is staked by the servicer currently in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Relay Chains
The flavor(s) of Web3 hosted by this Servicer
List[Relay Chain]
GeoZone
The physical geo-location identifier this Servicer registered in. There is no formal requirement or validation (e.g. IP verification) for an actor to be physically located in the GeoZone it registers in. However, crypto-economic incentives drive actors to be registered close to where they are physically located to receive and provide the best service possible. The number of GeoZones an actor can stake for is limited to one to incentivize real geographic distribution.
GeoZone
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Pause Height
The height for which a servicer has been paused at
Block Height
Stake Status
The status of staking for the actor
StakeStatusType
Validator State
+
Public key
The identifier of the validator
Public Key
POKT Holdings
The personal holdings of the validator in uPOKT
uPOKT
Staked POKT
The staked amount of the validator in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Stake Status
The status of staking for the actor
StakeStatusType
Servicer State
Name
Description
Type
Symbol
Domain
-
Public key
The identifier of the validator
Public Key
POKT Holdings
The personal holdings of the validator in uPOKT
uPOKT
Staked POKT
The staked amount of the validator in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Stake Status
The status of staking for the actor
StakeStatusType
Spaces
Mint POKT Mechanism Space
{mint_amount: uPOKT}
Unjail Node Space
{node_address: Public Key, block_height: Block Height}
{public_key: Public Key, block_height: Block Height, reward_amount: uPOKT}
Mint Block Rewards Space
{current_height: Block Height, block_producer: Public Key}
Burn POKT Mechanism Space
{burn_amount: uPOKT}
Modify Servicer POKT Space
{public_key: Public Key, amount: uPOKT}
Behavioral Action Space
Unjail Node
Process of a node submitting to be unjailed.
Called By:
+
Public key
The identifier of the node
Public Key
Servicer Salary
A ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequency
uPOKT
Report Card
The report card used when determing salary for a servicer. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either TestScoreExpiration is passed or the TestScore FIFO queue exceeds MaxTestScores.
Service Report Card
Test Scores
The QoS test scores
Service Test Scores
POKT Holdings
The personal holdings of the servicer in uPOKT
uPOKT
Staked POKT
The amount that is staked by the servicer currently in uPOKT
uPOKT
Service URL
The API endpoint where the Web3 service is provided
Service URL
Services
The flavor(s) of Web3 hosted by this Servicer
List[Service]
GeoZone
The physical geo-location identifier this Servicer registered in. There is no formal requirement or validation (e.g. IP verification) for an actor to be physically located in the GeoZone it registers in. However, crypto-economic incentives drive actors to be registered close to where they are physically located to receive and provide the best service possible. The number of GeoZones an actor can stake for is limited to one to incentivize real geographic distribution.
GeoZone
Operator Public Key
OPTIONAL; The non-custodial pubKey operating this node
Public Key
Pause Height
The height for which a servicer has been paused at
Block Height
Stake Status
The status of staking for the actor
StakeStatusType
Unstaking Height
The height for which a servicer has begun unstaking at or none to represent no unstaking
Block Height
Spaces
Burn POKT Mechanism Space
{burn_amount: uPOKT}
Validator Block Reward Space
{public_key: Public Key, block_height: Block Height, reward_amount: uPOKT}
{node_address: Public Key, block_height: Block Height}
Modify Servicer POKT Space
{public_key: Public Key, amount: uPOKT}
Mint Block Rewards Space
{current_height: Block Height, block_producer: Public Key}
Behavioral Action Space
Unjail Node
Process of a node submitting to be unjailed.
Called By:
1. Servicer
2. Validator
Constraints:
Policies
Block Reward Policy Aggregate
The aggregate policy for creating the total amount of block reward and also splitting it between different groups.
@@ -600,23 +600,23 @@
Policies
Block Reward Policy Aggregate
The aggregate policy f
1. Mint Block Rewards Space
Followed By:
1. Mint POKT Mechanism
2. Assign Servicer Salary Policy
3. Validator Block Reward Policy
4. DAO Block Reward Policy
Codomain Spaces:
1. Mint POKT Mechanism Space
2. Assign Servicer Salary Space
3. Validator Block Reward Space
Constraints:
-
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(RelayChain, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
+
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(Service, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
A Servicer must accumulate `MinimumTestScoreThreshold` TestScores before it is eligible for salary distribution. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either `TestScoreExpiration` is passed or the TestScore FIFO queue exceeds `MaxTestScores`.
-Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(RelayChain, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
+Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(Service, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
For example, a 100% ReportCard results in zero burning of the `maxServicerReward`, while a 80% ReportCard results in 20% burning of the maxServicerReward. The rate of decrease continues linearly until the `MinimumReportCardThreshold` is reached. Below the MinimumReportCardThreshold no reward is given to prevent cheap Sybil attacks and freeloading nodes. Unstaking causes the Servicer's ReportCard to be cleared and start from scratch.
The following is pseudo-code to illustrate this business logic:
```go
-// Called for each (relayChain, geoZone) pair every SessionBlockFrequency
-func DistributeRewards(relayChain, geoZone, height):
- totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(relayChain, geoZone, height)
+// Called for each (Service, geoZone) pair every SessionBlockFrequency
+func DistributeRewards(Service, geoZone, height):
+ totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(Service, geoZone, height)
totalAvailableReward = totalVolumeUsage * GovParams.UsageToRewardCoefficient(height)
- allServicers = WorldState.RetrieveEligibleServicers(relayChain, geoZone, height)
+ allServicers = WorldState.RetrieveEligibleServicers(Service, geoZone, height)
eligibleServicers = filterServicers(allServicers, GovParams.MinimumTestScoreThreshold(height))
maxServicerReward = totalAvailableReward / len(eligibleServicers)
@@ -629,7 +629,7 @@
Assign Servicer Salary Policy
A `ServicerSalary` is assigned to each
burnAmount = burnPercent * maxServicerReward
awardTokens(servicers, maxServicerReward - burnAmount)
- burnTokens(relayChain, geoZone, burnAmount)
+ burnTokens(Service, geoZone, burnAmount)
}
```
Preceded By:
1. Block Reward Policy Aggregate
Domain Spaces:
@@ -671,4 +671,4 @@
Logic:
1. Modify DAO POKT Space
State Updates:
1. DAO.POKT Holdings
Constraints:
Logic:
-
The DAO has its holdings increased by the value
Parameters
minimum_test_score_threshold
validator_fee_percentage
max_bootstrap_servicer_cost_per_relay
dao_fee_percentage
block_proposer_allocation
maturity_relay_charge
gateway_bootstrap_unwind_end
application_fee_per_relay
minimum_report_card_threshold
portal_fee_per_relay
min_bootstrap_gateway_fee_per_relay
gateway_bootstrap_unwind_start
downtime_jail_duration
relays_to_tokens_multiplier
maturity_relay_cost
servicer_bootstrap_unwind_start
servicer_bootstrap_end
transaction_fee
\ No newline at end of file
+
The DAO has its holdings increased by the value
Parameters
maturity_relay_cost
gateway_bootstrap_unwind_end
validator_fee_percentage
transaction_fee
block_proposer_allocation
servicer_bootstrap_unwind_start
gateway_bootstrap_unwind_start
minimum_test_score_threshold
downtime_jail_duration
dao_fee_percentage
portal_fee_per_relay
servicer_bootstrap_end
minimum_report_card_threshold
relays_to_tokens_multiplier
min_bootstrap_gateway_fee_per_relay
application_fee_per_relay
max_bootstrap_servicer_cost_per_relay
maturity_relay_charge
\ No newline at end of file
diff --git a/src/ActionTransmissionChannels/Application.py b/src/ActionTransmissionChannels/Application.py
index c0a83b2..577f246 100644
--- a/src/ActionTransmissionChannels/Application.py
+++ b/src/ActionTransmissionChannels/Application.py
@@ -1,4 +1,6 @@
-from ..Spaces import application_stake_space, modify_application_pokt_space, application_param_update_space, application_delegate_to_portal_space
+from ..Spaces import (application_stake_space, modify_application_pokt_space,
+ application_param_update_space, application_delegate_to_portal_space,
+ application_unstake_space, application_stake_status_space, submit_relay_request_space)
application_transmission_channels = []
@@ -34,3 +36,17 @@
"space": application_delegate_to_portal_space,
"optional": False})
+application_transmission_channels.append({"origin": "Application Unstake",
+ "target": "Application Unstake Policy",
+ "space": application_unstake_space,
+ "optional": False})
+
+application_transmission_channels.append({"origin": "Application Unstake Policy",
+ "target": "Update Application Stake Status",
+ "space": application_stake_status_space,
+ "optional": False})
+
+application_transmission_channels.append({"origin": "Submit Relay Request",
+ "target": "Submit Relay Request Policy",
+ "space": submit_relay_request_space,
+ "optional": False})
diff --git a/src/ActionTransmissionChannels/Servicer.py b/src/ActionTransmissionChannels/Servicer.py
index 1647dd8..f7a42a3 100644
--- a/src/ActionTransmissionChannels/Servicer.py
+++ b/src/ActionTransmissionChannels/Servicer.py
@@ -1,7 +1,8 @@
from ..Spaces import (servicer_stake_space, modify_servicer_pokt_space, servicer_param_update_space,
servicer_unpause_space, servicer_unpause_space2, servicer_pause_space,
servicer_pause_space2, servicer_block_reward_space,
- mint_pokt_mechanism_space, servicer_relay_space, servicer_stake_burn_space)
+ mint_pokt_mechanism_space, servicer_relay_space, servicer_stake_burn_space,
+ servicer_unstake_space, servicer_stake_status_space)
servicer_transmission_channels = []
@@ -78,4 +79,12 @@
"space": servicer_stake_burn_space,
"optional": False})
+servicer_transmission_channels.append({"origin": "Servicer Unstake",
+ "target": "Servicer Unstake Policy",
+ "space": servicer_unstake_space,
+ "optional": False})
+servicer_transmission_channels.append({"origin": "Servicer Unstake Policy",
+ "target": "Update Servicer Stake Status",
+ "space": servicer_stake_status_space,
+ "optional": False})
diff --git a/src/BoundaryActions/Application.py b/src/BoundaryActions/Application.py
index 4ace1e1..29f2de8 100644
--- a/src/BoundaryActions/Application.py
+++ b/src/BoundaryActions/Application.py
@@ -4,7 +4,7 @@
application_stake = {
"name": "Application Stake",
- "description": "In order to participate as a Application in Pocket Network, each actor is required to bond a certain amount of tokens in escrow while they are consuming the Web3 access. Upon registration, the Application is required to provide information necessary to create applicable Sessions (GeoZone(s), RelayChain(s), etc...).",
+ "description": "In order to participate as a Application in Pocket Network, each actor is required to bond a certain amount of tokens in escrow while they are consuming the Web3 access. Upon registration, the Application is required to provide information necessary to create applicable Sessions (GeoZone(s), Service(s), etc...).",
"constraints": [],
"boundary_action_options": [],
"called_by": ["Application"],
@@ -44,7 +44,7 @@
submit_relay_request = {
"name": "Submit Relay Request",
- "description": "An application or the portal acting on its behalf submits a Relay Request, or an API requests to be routed to any Relay Chain",
+ "description": "An application or the portal acting on its behalf submits a Relay Request, or an API requests to be routed to any Service",
"constraints": [],
"boundary_action_options": [],
"called_by": ["Application", "Portal"],
diff --git a/src/BoundaryActions/RelayChain.py b/src/BoundaryActions/RelayChain.py
deleted file mode 100644
index 2814463..0000000
--- a/src/BoundaryActions/RelayChain.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from ..Spaces import (relay_chain_join_space, relay_chain_leave_space)
-
-relay_chain_join = {
- "name": "Relay Chain Join",
- "description": "Action for relay chain moving to be added to the system.",
- "constraints": [],
- "boundary_action_options": [],
- "called_by": ["Relay Chain"],
- "codomain": [relay_chain_join_space],
- "parameters_used": [],
-}
-
-relay_chain_leave = {
- "name": "Relay Chain Leave",
- "description": "Action for relay chain moving to leave the system.",
- "constraints": [],
- "boundary_action_options": [],
- "called_by": ["Relay Chain"],
- "codomain": [relay_chain_leave_space],
- "parameters_used": [],
-}
\ No newline at end of file
diff --git a/src/BoundaryActions/Service.py b/src/BoundaryActions/Service.py
new file mode 100644
index 0000000..3de4673
--- /dev/null
+++ b/src/BoundaryActions/Service.py
@@ -0,0 +1,21 @@
+from ..Spaces import (service_join_space, service_leave_space)
+
+service_join = {
+ "name": "Service Join",
+ "description": "Action for Service moving to be added to the system.",
+ "constraints": [],
+ "boundary_action_options": [],
+ "called_by": ["Service"],
+ "codomain": [service_join_space],
+ "parameters_used": [],
+}
+
+service_leave = {
+ "name": "Service Leave",
+ "description": "Action for Service moving to leave the system.",
+ "constraints": [],
+ "boundary_action_options": [],
+ "called_by": ["Service"],
+ "codomain": [service_leave_space],
+ "parameters_used": [],
+}
\ No newline at end of file
diff --git a/src/BoundaryActions/Servicer.py b/src/BoundaryActions/Servicer.py
index 726f96a..428fa1c 100644
--- a/src/BoundaryActions/Servicer.py
+++ b/src/BoundaryActions/Servicer.py
@@ -41,11 +41,17 @@
"parameters_used": [],
}
+servicer_relay_v1_option = {"name": "Servicer Relay V1",
+ "description": "Version 1 of selection policy for servicers to be using with relay.",
+ "logic": """The Servicer(s) that are paired to service an Application in a Session are equally distributed among all of the Servicers in the network.
+More logic can be found here: https://github.com/pokt-network/pocket-network-protocol/blob/main/utility/README.md#311-actor-selection-dispatch
+"""}
+
servicer_relay = {
"name": "Servicer Relay",
- "description": "A Servicer ‘services’ the Application, by routing the Relay Request to the Relay Chain and forwarding the response to the Application.",
+ "description": "A Servicer ‘services’ the Application, by routing the Relay Request to the Service and forwarding the response to the Application.",
"constraints": [],
- "boundary_action_options": [],
+ "boundary_action_options": [servicer_relay_v1_option],
"called_by": ["Servicer"],
"codomain": [servicer_relay_space],
"parameters_used": [],
diff --git a/src/BoundaryActions/__init__.py b/src/BoundaryActions/__init__.py
index 866eb13..faad7cd 100644
--- a/src/BoundaryActions/__init__.py
+++ b/src/BoundaryActions/__init__.py
@@ -6,7 +6,7 @@
from .Portal import portal_registration, portal_unregistration, submit_relay_request_portal
from .Treasury import (burn_pokt)
from .Node import (unjail_node)
-from .RelayChain import (relay_chain_join, relay_chain_leave)
+from .Service import (service_join, service_leave)
boundary_actions = {
"Servicer Stake": servicer_stake,
@@ -28,7 +28,7 @@
"Servicer Relay": servicer_relay,
"Burn POKT": burn_pokt,
"Unjail Node": unjail_node,
- "Relay Chain Join": relay_chain_join,
- "Relay Chain Leave": relay_chain_leave,
+ "Service Join": service_join,
+ "Service Leave": service_leave,
"Submit Relay Request (Portal)": submit_relay_request_portal
}
diff --git a/src/Entities/RelayChain.py b/src/Entities/RelayChain.py
deleted file mode 100644
index f55265d..0000000
--- a/src/Entities/RelayChain.py
+++ /dev/null
@@ -1,3 +0,0 @@
-relay_chain_entity = {"name": "Relay Chain",
- "notes": "Entity representing relay chains in the pocket network. A RelayChain is an identifier of the specified Web3 data source (i.e. a blockchain) being interacted with for that session. For example, 0021 represents Ethereum Mainnet in Pocket Network V0.",
- "state": "Relay Chain"}
\ No newline at end of file
diff --git a/src/Entities/Service.py b/src/Entities/Service.py
new file mode 100644
index 0000000..a0e67bb
--- /dev/null
+++ b/src/Entities/Service.py
@@ -0,0 +1,3 @@
+service_entity = {"name": "Service",
+ "notes": "Entity representing Services in the pocket network. A Service is an identifier of the specified Web3 data source (i.e. a blockchain) being interacted with for that session. For example, 0021 represents Ethereum Mainnet in Pocket Network V0.",
+ "state": "Service"}
\ No newline at end of file
diff --git a/src/Entities/__init__.py b/src/Entities/__init__.py
index 2f7942a..cee72c7 100644
--- a/src/Entities/__init__.py
+++ b/src/Entities/__init__.py
@@ -4,7 +4,7 @@
from .Validator import validator_entity
from .Portal import portal_entity
from .Treasury import treasury_entity
-from .RelayChain import relay_chain_entity
+from .Service import service_entity
from .Global import global_entity
from .DAO import dao_entity
@@ -14,7 +14,7 @@
"Validator": validator_entity,
"Portal": portal_entity,
"Treasury": treasury_entity,
- "Relay Chain": relay_chain_entity,
+ "Service": service_entity,
"Global": global_entity,
"DAO": dao_entity}
diff --git a/src/Mechanisms/Application.py b/src/Mechanisms/Application.py
index 91c1448..9c269a5 100644
--- a/src/Mechanisms/Application.py
+++ b/src/Mechanisms/Application.py
@@ -1,4 +1,4 @@
-from ..Spaces import modify_application_pokt_space, application_param_update_space
+from ..Spaces import modify_application_pokt_space, application_param_update_space, application_stake_status_space
modify_application_pokt_holdings = {"name": "Modify Application POKT Holdings",
@@ -23,3 +23,9 @@
"domain": [application_param_update_space],
"parameters_used": []}
+update_application_stake_status = {"name": "Update Application Stake Status",
+ "description": "The mechanism which updates the staking status and as well the unstaking height for an application.",
+ "constraints": [],
+ "logic": "The application at DOMAIN[0].address has its unstaking_height variable updated to DOMAIN[0].height which will be none if it is staking. It will also have its stake status set to DOMAIN[0].status.",
+ "domain": [application_stake_status_space],
+ "parameters_used": []}
\ No newline at end of file
diff --git a/src/Mechanisms/Servicer.py b/src/Mechanisms/Servicer.py
index add0752..2cf6c6e 100644
--- a/src/Mechanisms/Servicer.py
+++ b/src/Mechanisms/Servicer.py
@@ -1,4 +1,5 @@
-from ..Spaces import modify_servicer_pokt_space, servicer_param_update_space, servicer_unpause_space2, servicer_pause_space2
+from ..Spaces import (modify_servicer_pokt_space, servicer_param_update_space, servicer_unpause_space2,
+ servicer_pause_space2, servicer_stake_status_space)
modify_servicer_pokt_holdings = {"name": "Modify Servicer POKT Holdings",
@@ -41,4 +42,12 @@
"constraints": [],
"logic": "The servicer at DOMAIN[0].address has its pause_height variable updated to DOMAIN[0].height",
"domain": [servicer_pause_space2],
- "parameters_used": []}
\ No newline at end of file
+ "parameters_used": []}
+
+update_servicer_stake_status = {"name": "Update Servicer Stake Status",
+ "description": "The mechanism which updates the staking status and as well the unstaking height.",
+ "constraints": [],
+ "logic": "The servicer at DOMAIN[0].address has its unstaking_height variable updated to DOMAIN[0].height which will be none if it is staking. It will also have its stake status set to DOMAIN[0].status.",
+ "domain": [servicer_stake_status_space],
+ "parameters_used": []}
+
diff --git a/src/Mechanisms/__init__.py b/src/Mechanisms/__init__.py
index ecfb37f..1dfb191 100644
--- a/src/Mechanisms/__init__.py
+++ b/src/Mechanisms/__init__.py
@@ -1,6 +1,8 @@
from .Servicer import (modify_servicer_pokt_holdings, modify_servicer_stake, update_servicer_params,
- prune_servicer_qos, servicer_unpause_mechanism, servicer_update_pause_height)
-from .Application import modify_application_pokt_holdings, modify_application_stake, update_application_params
+ prune_servicer_qos, servicer_unpause_mechanism, servicer_update_pause_height,
+ update_servicer_stake_status)
+from .Application import (modify_application_pokt_holdings, modify_application_stake,
+ update_application_params, update_application_stake_status)
#from .Validator import modify_validator_pokt_holdings, modify_validator_stake, update_validator_params
from .Validator import modify_validator_pokt_holdings
from .Treasury import mint_pokt_mechanism, burn_pokt_mechanism
@@ -20,4 +22,6 @@
#"Update Validator Params": update_validator_params,
"Mint POKT Mechanism": mint_pokt_mechanism,
"Burn POKT Mechanism": burn_pokt_mechanism,
-"Modify DAO POKT Holdings": modify_dao_pokt_holdings}
\ No newline at end of file
+"Modify DAO POKT Holdings": modify_dao_pokt_holdings,
+"Update Servicer Stake Status": update_servicer_stake_status,
+"Update Application Stake Status": update_application_stake_status}
\ No newline at end of file
diff --git a/src/Parameters/Application.py b/src/Parameters/Application.py
index 2c4ffa5..4b6727c 100644
--- a/src/Parameters/Application.py
+++ b/src/Parameters/Application.py
@@ -30,7 +30,7 @@
"name": "minimum_application_stake",
"description": "The minimum stake needed for applications.",
"symbol": None,
- "domain": None}
+ "domain": None},
]}
diff --git a/src/Parameters/Servicer.py b/src/Parameters/Servicer.py
index 8988fa9..6889cc8 100644
--- a/src/Parameters/Servicer.py
+++ b/src/Parameters/Servicer.py
@@ -21,7 +21,7 @@
"domain": None},
{"variable_type": int,
"name": "max_chains_servicer",
- "description": "When staking as a servicer, every servicer must register their stake for the relay chains that they support. Currently, servicers can register each stake to apply to their work in up to 15 different blockchains, which is the maximum number that can be chosen. ",
+ "description": "When staking as a servicer, every servicer must register their stake for the Services that they support. Currently, servicers can register each stake to apply to their work in up to 15 different blockchains, which is the maximum number that can be chosen. ",
"symbol": None,
"domain": None},
{"variable_type": NumberOfBlocksType,
diff --git a/src/Parameters/Sessions.py b/src/Parameters/Sessions.py
index e228385..01350bb 100644
--- a/src/Parameters/Sessions.py
+++ b/src/Parameters/Sessions.py
@@ -7,4 +7,10 @@
"description": "The number of blocks a session can extend over",
"symbol": None,
"domain": None
- },]}
+ },
+ {"variable_type": float,
+ "name": "session_token_bucket_coefficient",
+ "description": "Parameter for converting application stake to service tokens",
+ "symbol": None,
+ "domain": None
+ }]}
diff --git a/src/Policies/Application.py b/src/Policies/Application.py
index 3093716..610e6ae 100644
--- a/src/Policies/Application.py
+++ b/src/Policies/Application.py
@@ -1,11 +1,11 @@
-from ..Spaces import application_stake_space, modify_application_pokt_space, application_param_update_space, application_delegate_to_portal_space
+from ..Spaces import application_stake_space, modify_application_pokt_space, application_param_update_space, application_delegate_to_portal_space, application_unstake_space, submit_relay_request_space
application_stake_policy = {"name": "Application Stake Policy",
"description": "The policy which takes care of whether an application can stake and if it should update parameters.",
"constraints": ["DOMAIN[0].public_key must not be null",
"DOMAIN[0].amount > 0",
- "LEN(DOMAIN[0].relay_chains) > 0",
- "All chains in DOMAIN[0].relay_chains must be valid",
+ "LEN(DOMAIN[0].services) > 0",
+ "All chains in DOMAIN[0].services must be valid",
"DOMAIN[0].number_servicers >= PARAMS.MinServicersPerSession",
"DOMAIN[0].number_servicers <= PARAMS.MaxServicersPerSession"],
"policy_options": [],
@@ -34,4 +34,31 @@
"policy_options": [],
"domain": [application_delegate_to_portal_space],
"codomain": [application_delegate_to_portal_space],
- "parameters_used": ["stake_per_app_delegation"]}
\ No newline at end of file
+ "parameters_used": ["stake_per_app_delegation"]}
+
+application_unstake_policy = {
+ "name": "Application Unstake Policy",
+ "description": "The policy for determining what happens when an application unstakes.",
+ "constraints": [],
+ "policy_options": [],
+ "domain": [application_unstake_space],
+ "codomain": [],
+ "parameters_used": []}
+
+submit_relay_request_policy_option_v1 = {"name": "Submit Relay Request Policy Option V1",
+ "description": "V1 Implementation",
+ "logic": """During each Session, the amount of POKT an Application has staked (see Application Protocol for more details) is mapped to "Service Tokens" that represent the amount of work a Servicer can provide using the SessionTokenBucketCoefficient governance parameter. The Token Bucket rate limiting algorithm is used to determine the maximum number of requests a Servicer can relay, and be rewarded for, thereby disincentivizing it to process relays for the Application once the cap is reached.
+
+At the beginning of the session, each Servicer initializes: AppSessionTokens = (AppStakeAmount * SessionTokenBucketCoefficient) / NumServicersPerSession. When one of the Servicers in the session is out of session tokens, the Application can continue to use other Servicers until every they are all exhausted.
+
+The mechanism described above enables future iterations of the protocol where different types of request may vary the required number of AppSessionTokens per request."""
+ }
+
+submit_relay_request_policy = {
+ "name": "Submit Relay Request Policy",
+ "description": "The policy for determining aspects of the service request.",
+ "constraints": [],
+ "policy_options": [submit_relay_request_policy_option_v1],
+ "domain": [submit_relay_request_space],
+ "codomain": [],
+ "parameters_used": ["session_token_bucket_coefficient"]}
\ No newline at end of file
diff --git a/src/Policies/Servicer.py b/src/Policies/Servicer.py
index 4d4d1e1..61587c7 100644
--- a/src/Policies/Servicer.py
+++ b/src/Policies/Servicer.py
@@ -2,15 +2,16 @@
servicer_unpause_space, servicer_unpause_space2, servicer_pause_space, servicer_pause_space2,
assign_servicer_salary_space, servicer_block_reward_space,
mint_pokt_mechanism_space, modify_servicer_pokt_space, burn_pokt_mechanism_space,
- servicer_relay_space, servicer_stake_burn_space)
+ servicer_relay_space, servicer_stake_burn_space, servicer_unstake_space,
+ servicer_stake_status_space)
servicer_stake_policy = {"name": "Servicer Stake Policy",
"description": "Policy which takes care of actions to occur after a servicer attempts to stake",
"constraints": ["DOMAIN[0].public_key must not be null",
"DOMAIN[0].amount > 0",
- "LEN(DOMAIN[0].relay_chains) > 0",
- "All chains in DOMAIN[0].relay_chains must be valid",
- "LEN(DOMAIN[0].relay_chains) <= PARAMS.max_chains_servicer"],
+ "LEN(DOMAIN[0].services) > 0",
+ "All chains in DOMAIN[0].services must be valid",
+ "LEN(DOMAIN[0].services) <= PARAMS.max_chains_servicer"],
"policy_options": [],
"domain": [servicer_stake_space],
"codomain": [servicer_stake_space, modify_servicer_pokt_space, modify_servicer_pokt_space],
@@ -47,23 +48,23 @@
"parameters_used": []}
assign_servicer_salary_policy = {"name": "Assign Servicer Salary Policy",
- "description": """A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(RelayChain, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
+ "description": """A `ServicerSalary` is assigned to each individual Servicer based on their specific `ReportCard`, and is distributed every `SalaryBlockFrequency`. Salaries are distributed from the `TotalAvailableReward` pool, whose inflation is governed by Application volume of each `(Service, GeoZone)` pair and scaled by the `UsageToRewardCoefficient` governance parameter.
A Servicer must accumulate `MinimumTestScoreThreshold` TestScores before it is eligible for salary distribution. A ReportCard can be viewed as a rolling average of the Servicer's performance, where TestScores are removed when either `TestScoreExpiration` is passed or the TestScore FIFO queue exceeds `MaxTestScores`.
-Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(RelayChain, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
+Salary distribution is accomplished by aggregating the total volume estimated (see above) for a specific `(Service, GeoZone)` pair (i.e. `TotalVolumeUsage`), multiplied by `UsageToRewardCoefficient`, and evenly divided into buckets per Servicer that exceed the minimum threshold (i.e. the `MinimumReportCardThreshold`). Each Servicer's reward is scaled proportionally to both their stake and their ReportCard. Tokens that are not allocated to a servicer are burnt.
For example, a 100% ReportCard results in zero burning of the `maxServicerReward`, while a 80% ReportCard results in 20% burning of the maxServicerReward. The rate of decrease continues linearly until the `MinimumReportCardThreshold` is reached. Below the MinimumReportCardThreshold no reward is given to prevent cheap Sybil attacks and freeloading nodes. Unstaking causes the Servicer's ReportCard to be cleared and start from scratch.
The following is pseudo-code to illustrate this business logic:
```go
-// Called for each (relayChain, geoZone) pair every SessionBlockFrequency
-func DistributeRewards(relayChain, geoZone, height):
- totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(relayChain, geoZone, height)
+// Called for each (Service, geoZone) pair every SessionBlockFrequency
+func DistributeRewards(Service, geoZone, height):
+ totalVolumeUsage = WorldState.RetrieveTotalVolumeEstimate(Service, geoZone, height)
totalAvailableReward = totalVolumeUsage * GovParams.UsageToRewardCoefficient(height)
- allServicers = WorldState.RetrieveEligibleServicers(relayChain, geoZone, height)
+ allServicers = WorldState.RetrieveEligibleServicers(Service, geoZone, height)
eligibleServicers = filterServicers(allServicers, GovParams.MinimumTestScoreThreshold(height))
maxServicerReward = totalAvailableReward / len(eligibleServicers)
@@ -76,7 +77,7 @@
burnAmount = burnPercent * maxServicerReward
awardTokens(servicers, maxServicerReward - burnAmount)
- burnTokens(relayChain, geoZone, burnAmount)
+ burnTokens(Service, geoZone, burnAmount)
}
```""",
"constraints": [],
@@ -120,4 +121,13 @@
"policy_options": [],
"domain": [servicer_stake_burn_space],
"codomain": [],
- "parameters_used": ["slash_fraction_downtime", "replay_attack_burn_multiplier"]}
\ No newline at end of file
+ "parameters_used": ["slash_fraction_downtime", "replay_attack_burn_multiplier"]}
+
+servicer_unstake_policy = {
+ "name": "Servicer Unstake Policy",
+ "description": "The policy which determines any behaviors around servicers unstaking.",
+ "constraints": [],
+ "policy_options": [],
+ "domain": [servicer_unstake_space],
+ "codomain": [servicer_stake_status_space],
+ "parameters_used": []}
\ No newline at end of file
diff --git a/src/Policies/__init__.py b/src/Policies/__init__.py
index 3a52a76..cf7bf30 100644
--- a/src/Policies/__init__.py
+++ b/src/Policies/__init__.py
@@ -1,7 +1,9 @@
from .Servicer import (servicer_stake_policy, set_servicer_parameters_policy, servicer_unpause_policy,
servicer_pause_policy, assign_servicer_salary_policy, servicer_block_reward_policy,
- servicer_relay_policy, servicer_stake_burn_policy)
-from .Application import application_stake_policy, set_application_parameters_policy, application_delegate_to_portal_policy
+ servicer_relay_policy, servicer_stake_burn_policy, servicer_unstake_policy)
+from .Application import (application_stake_policy, set_application_parameters_policy,
+ application_delegate_to_portal_policy, application_unstake_policy,
+ submit_relay_request_policy)
#from .Validator import validator_stake_policy, set_validator_parameters_policy, validator_unpause_policy, validator_block_reward_policy
from .Validator import validator_block_reward_policy
from .Treasury import block_reward_policy_aggregate
@@ -27,5 +29,8 @@
"Submit Relay Request (Portal) Policy": submit_relay_request_portal_policy,
"Servicer Relay Policy": servicer_relay_policy,
"Servicer Stake Burn Policy": servicer_stake_burn_policy,
- "Portal Registration Policy": portal_registration_policy
+ "Portal Registration Policy": portal_registration_policy,
+ "Servicer Unstake Policy": servicer_unstake_policy,
+ "Application Unstake Policy": application_unstake_policy,
+ "Submit Relay Request Policy": submit_relay_request_policy
}
diff --git a/src/Spaces/Application.py b/src/Spaces/Application.py
index 95991db..9e1642b 100644
--- a/src/Spaces/Application.py
+++ b/src/Spaces/Application.py
@@ -1,9 +1,9 @@
from typing import TypedDict, List
-from ..Types import PublicKeyType, uPOKTType, RelayChainType, GeoZoneType, ActorType, AddressType
+from ..Types import PublicKeyType, uPOKTType, ServiceType, GeoZoneType, ActorType, AddressType, BlockHeightType, StakeStatusType
application_stake_space = TypedDict("Application Stake Space", {"public_key": PublicKeyType, # The public cryptographic id of the Application
"stake_amount": uPOKTType, # The amount of uPOKT in escrow (i.e. a security deposit)
- "relay_chains": List[RelayChainType], # The flavor(s) of Web3 hosted by this Servicer
+ "services": List[ServiceType], # The flavor(s) of Web3 hosted by this Servicer
"geo_zone": GeoZoneType, # The physical geo-location identifier this Servicer registered in
"number_servicers": int, # The number of Servicers requested per session
})
@@ -15,7 +15,7 @@
application_param_update_space = TypedDict("Application Param Update Space", {"public_key": PublicKeyType, # The public cryptographic id of the Application
- "relay_chains": List[RelayChainType], # The flavor(s) of Web3 hosted by this Servicer
+ "services": List[ServiceType], # The flavor(s) of Web3 hosted by this Servicer
"geo_zone": GeoZoneType, # The physical geo-location identifier this Servicer registered in
"number_servicers": int, # The number of Servicers requested per session
})
@@ -38,4 +38,9 @@
"meta": dict, # metadata for the relay request
"proof": dict, # the authentication scheme needed for work
"application_address": PublicKeyType
- })
\ No newline at end of file
+ })
+
+application_stake_status_space = TypedDict("Application Stake Status Space", {"address": PublicKeyType, # address of the unstaking application
+ "height": BlockHeightType,
+ "status": StakeStatusType
+ })
\ No newline at end of file
diff --git a/src/Spaces/RelayChain.py b/src/Spaces/RelayChain.py
deleted file mode 100644
index f93f95b..0000000
--- a/src/Spaces/RelayChain.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from typing import TypedDict
-
-relay_chain_join_space = TypedDict("Relay Chain Join Space", {"name": str,
- "portal_api_prefix": str,
- "relay_chain_id": str})
-relay_chain_leave_space = TypedDict("Relay Chain Leave Space", {"relay_chain_id": str})
-
-
diff --git a/src/Spaces/Service.py b/src/Spaces/Service.py
new file mode 100644
index 0000000..9a4fe28
--- /dev/null
+++ b/src/Spaces/Service.py
@@ -0,0 +1,8 @@
+from typing import TypedDict
+
+service_join_space = TypedDict("Service Join Space", {"name": str,
+ "portal_api_prefix": str,
+ "service_id": str})
+service_leave_space = TypedDict("Service Leave Space", {"service_id": str})
+
+
diff --git a/src/Spaces/Servicer.py b/src/Spaces/Servicer.py
index 8ee68a9..91b3c0f 100644
--- a/src/Spaces/Servicer.py
+++ b/src/Spaces/Servicer.py
@@ -1,10 +1,12 @@
-from ..Types import PublicKeyType, uPOKTType, ServiceURLType, RelayChainType, GeoZoneType, ActorType, AddressType, BlockHeightType
+from ..Types import (PublicKeyType, uPOKTType, ServiceURLType, ServiceType,
+ GeoZoneType, ActorType, AddressType, BlockHeightType, StakeStatusType, ServicerEntityType,
+ ApplicationEntityType, SessionType, ServicerGroupType)
from typing import TypedDict, List
servicer_stake_space = TypedDict("Servicer Stake Space", {"public_key": PublicKeyType, # The public cryptographic id of the custodial account
"stake_amount": uPOKTType, # The amount of uPOKT in escrow (i.e. a security deposit)
"service_url": ServiceURLType, # The API endpoint where the Web3 service is provided
- "relay_chains": List[RelayChainType], # The flavor(s) of Web3 hosted by this Servicer
+ "services": List[ServiceType], # The flavor(s) of Web3 hosted by this Servicer
"geo_zone": GeoZoneType, # The physical geo-location identifier this Servicer registered in
"operator_public_key": PublicKeyType # OPTIONAL; The non-custodial pubKey operating this node
})
@@ -17,7 +19,7 @@
servicer_param_update_space = TypedDict("Servicer Param Update Space", {"public_key": PublicKeyType, # The public cryptographic id of the custodial account
"service_url": ServiceURLType, # The API endpoint where the Web3 service is provided
- "relay_chains": List[RelayChainType], # The flavor(s) of Web3 hosted by this Servicer
+ "services": List[ServiceType], # The flavor(s) of Web3 hosted by this Servicer
"geo_zone": GeoZoneType, # The physical geo-location identifier this Servicer registered in
"operator_public_key": PublicKeyType # OPTIONAL; The non-custodial pubKey operating this node
})
@@ -48,7 +50,7 @@
assign_servicer_salary_space = TypedDict("Assign Servicer Salary Space", {"geo_zone": GeoZoneType, # The physical geo-location identifier
- "relay_chain": RelayChainType,
+ "service": ServiceType,
"height": BlockHeightType})
@@ -61,9 +63,20 @@
})
servicer_forced_unstake_space = TypedDict("Servicer Forced Unstaked Space", {"public_key": PublicKeyType, # The key of the servicer that is being force unstaked
})
+
+servicer_stake_status_space = TypedDict("Servicer Stake Status Space", {"address": PublicKeyType, # address of the unstaking servicer
+ "height": BlockHeightType,
+ "status": StakeStatusType
+ })
+
+
+servicer_relay_space = TypedDict("Servicer Relay Space", {"servicers": ServicerGroupType, # Addresses of servicers serviving during a session
+ "applications": ApplicationEntityType,
+ "session": SessionType})
+
#TODO
-servicer_relay_space = TypedDict("Servicer Relay Space", {})
+
servicer_stake_burn_space = TypedDict("Servicer Stake Burn Space", {})
\ No newline at end of file
diff --git a/src/Spaces/Validator.py b/src/Spaces/Validator.py
index b0ff389..af20d71 100644
--- a/src/Spaces/Validator.py
+++ b/src/Spaces/Validator.py
@@ -1,4 +1,4 @@
-from ..Types import PublicKeyType, uPOKTType, ServiceURLType, RelayChainType, GeoZoneType, ActorType, AddressType, BlockHeightType
+from ..Types import PublicKeyType, uPOKTType, ServiceURLType, ServiceType, GeoZoneType, ActorType, AddressType, BlockHeightType
from typing import TypedDict, List
validator_stake_space = TypedDict("Validator Stake Space", {"public_key": PublicKeyType, # The public cryptographic id of the custodial account
diff --git a/src/Spaces/__init__.py b/src/Spaces/__init__.py
index 40fd242..785f469 100644
--- a/src/Spaces/__init__.py
+++ b/src/Spaces/__init__.py
@@ -2,11 +2,11 @@
assign_servicer_salary_space, modify_servicer_pokt_space, servicer_param_update_space, servicer_unstake_space,
servicer_unpause_space2, servicer_pause_space2, servicer_relay_space,
return_servicer_stake_space, servicer_block_reward_space, servicer_stake_burn_space,
- servicer_forced_unstake_space)
+ servicer_forced_unstake_space, servicer_stake_status_space)
from .Application import (application_stake_space, modify_application_pokt_space, application_param_update_space,
application_unstake_space, application_delegate_to_portal_space,
application_undelegation_space, submit_relay_request_space,
- return_application_stake_space)
+ return_application_stake_space, application_stake_status_space)
from .Validator import (validator_stake_space, modify_validator_pokt_space, validator_param_update_space,
validator_pause_space, validator_stake_burning_space, validator_unstake_space,
validator_unpause_space, validator_jail_space, become_validator_space,
@@ -15,7 +15,7 @@
from .Treasury import (mint_block_rewards_space, burn_pokt_space, jail_node_space, mint_pokt_mechanism_space,
burn_pokt_mechanism_space)
from .Node import unjail_node_space
-from .RelayChain import relay_chain_join_space, relay_chain_leave_space
+from .Service import service_join_space, service_leave_space
from .DAO import (dao_block_reward_space, modify_dao_pokt_space)
spaces = {"Servicer Stake Space": servicer_stake_space,
@@ -52,8 +52,8 @@
"Jail Node Space": jail_node_space,
"Unjail Node Space": unjail_node_space,
"Return Servicer Stake Space": return_servicer_stake_space,
- "Relay Chain Join Space": relay_chain_join_space,
- "Relay Chain Leave Space": relay_chain_leave_space,
+ "Service Join Space": service_join_space,
+ "Service Leave Space": service_leave_space,
"Return Application Stake Space": return_application_stake_space,
"Servicer Block Reward Space": servicer_block_reward_space,
"Mint POKT Mechanism Space": mint_pokt_mechanism_space,
@@ -62,7 +62,9 @@
"Modify DAO POKT Space": modify_dao_pokt_space,
"Portal Relay Request Space": portal_relay_request_space,
"Servicer Stake Burn Space": servicer_stake_burn_space,
- "Servicer Forced Unstake Space": servicer_forced_unstake_space}
+ "Servicer Forced Unstake Space": servicer_forced_unstake_space,
+ "Servicer Stake Status Space": servicer_stake_status_space,
+ "Application Stake Status Space": application_stake_status_space}
diff --git a/src/State/Application.py b/src/State/Application.py
index 3ba7d7d..99d4245 100644
--- a/src/State/Application.py
+++ b/src/State/Application.py
@@ -1,4 +1,4 @@
-from ..Types import uPOKTType, PublicKeyType, GeoZoneType, RelayChainType, StakeStatusType
+from ..Types import uPOKTType, PublicKeyType, GeoZoneType, ServiceType, StakeStatusType, BlockHeightType
from typing import List
@@ -19,8 +19,8 @@
"description": "The staked amount of the application in uPOKT",
"symbol": None,
"domain": None},
- {"type": List[RelayChainType],
- "name": "Relay Chains",
+ {"type": List[ServiceType],
+ "name": "Services",
"description": "The flavor(s) of Web3 hosted by this Servicer",
"symbol": None,
"domain": None},
@@ -38,6 +38,11 @@
"name": "Stake Status",
"description": "The status of staking for the actor",
"symbol": None,
+ "domain": None},
+ {"type": BlockHeightType,
+ "name": "Unstaking Height",
+ "description": "The height for which a servicer has begun unstaking at or none to represent no unstaking",
+ "symbol": None,
"domain": None}
]}
diff --git a/src/State/Global.py b/src/State/Global.py
index 1e8e8ce..605a20c 100644
--- a/src/State/Global.py
+++ b/src/State/Global.py
@@ -1,11 +1,11 @@
from typing import List
-from ..Types import RelayChainEntityType, SessionType
+from ..Types import ServiceEntityType, SessionType
global_state = {"name": "Global State",
"notes": "",
- "variables": [{"type": List[RelayChainEntityType],
- "name": "Relay Chains",
- "description": "The relay chains active in the system",
+ "variables": [{"type": List[ServiceEntityType],
+ "name": "Services",
+ "description": "The services active in the system",
"symbol": None,
"domain": None},
{"type": List[SessionType],
diff --git a/src/State/RelayChain.py b/src/State/Service.py
similarity index 79%
rename from src/State/RelayChain.py
rename to src/State/Service.py
index d8407da..6a4116f 100644
--- a/src/State/RelayChain.py
+++ b/src/State/Service.py
@@ -1,8 +1,8 @@
-relay_chain_state = {"name": "Relay Chain State",
+service_state = {"name": "Service State",
"notes": "",
"variables": [{"type": str,
"name": "Name",
- "description": "The name of the relay chain",
+ "description": "The name of the service",
"symbol": None,
"domain": None},
{"type": str,
@@ -11,7 +11,7 @@
"symbol": None,
"domain": None},
{"type": str,
- "name": "Relay Chain ID",
+ "name": "Service ID",
"description": "The identifier used for the chain",
"symbol": None,
"domain": None}]}
\ No newline at end of file
diff --git a/src/State/Servicer.py b/src/State/Servicer.py
index b0e2aec..0e1ce45 100644
--- a/src/State/Servicer.py
+++ b/src/State/Servicer.py
@@ -1,4 +1,4 @@
-from ..Types import uPOKTType, ServicerReportCardType, ServicerTestScoresType, PublicKeyType, GeoZoneType, RelayChainType, ServiceURLType, BlockHeightType, StakeStatusType
+from ..Types import uPOKTType, ServicerReportCardType, ServicerTestScoresType, PublicKeyType, GeoZoneType, ServiceType, ServiceURLType, BlockHeightType, StakeStatusType
from typing import List
servicer_state = {"name": "Servicer State",
@@ -38,8 +38,8 @@
"description": "The API endpoint where the Web3 service is provided",
"symbol": None,
"domain": None},
- {"type": List[RelayChainType],
- "name": "Relay Chains",
+ {"type": List[ServiceType],
+ "name": "Services",
"description": "The flavor(s) of Web3 hosted by this Servicer",
"symbol": None,
"domain": None},
@@ -62,5 +62,10 @@
"name": "Stake Status",
"description": "The status of staking for the actor",
"symbol": None,
+ "domain": None},
+ {"type": BlockHeightType,
+ "name": "Unstaking Height",
+ "description": "The height for which a servicer has begun unstaking at or none to represent no unstaking",
+ "symbol": None,
"domain": None}
]}
diff --git a/src/State/Treasury.py b/src/State/Treasury.py
index 5697b3c..2b6ffa4 100644
--- a/src/State/Treasury.py
+++ b/src/State/Treasury.py
@@ -1,4 +1,4 @@
-from ..Types import uPOKTType, ServicerReportCardType, ServicerTestScoresType, PublicKeyType, GeoZoneType, RelayChainType, ServiceURLType, BlockHeightType
+from ..Types import uPOKTType, ServicerReportCardType, ServicerTestScoresType, PublicKeyType, GeoZoneType, ServiceType, ServiceURLType, BlockHeightType
from typing import List
treasury_state = {"name": "Treasury State",
diff --git a/src/State/__init__.py b/src/State/__init__.py
index 1707c9d..1e145d2 100644
--- a/src/State/__init__.py
+++ b/src/State/__init__.py
@@ -4,7 +4,7 @@
from .Validator import validator_state
from .Portal import portal_state
from .Treasury import treasury_state
-from .RelayChain import relay_chain_state
+from .Service import service_state
from .Global import global_state
from .DAO import dao_state
@@ -15,5 +15,5 @@
"Validator": validator_state,
"Portal": portal_state,
"Treasury": treasury_state,
- "Relay Chain": relay_chain_state,
+ "Service": service_state,
"DAO": dao_state}
diff --git a/src/StateUpdateTransmissionChannels/Application.py b/src/StateUpdateTransmissionChannels/Application.py
index cbf74d7..99cd696 100644
--- a/src/StateUpdateTransmissionChannels/Application.py
+++ b/src/StateUpdateTransmissionChannels/Application.py
@@ -12,7 +12,7 @@
application_transmission_channels.append({"origin": "Update Application Params",
"entity": "Application",
- "variable": "Relay Chains",
+ "variable": "Services",
"optional": False})
application_transmission_channels.append({"origin": "Update Application Params",
@@ -25,4 +25,12 @@
"variable": "Number of Servicers",
"optional": False})
+application_transmission_channels.append({"origin": "Update Application Stake Status",
+ "entity": "Application",
+ "variable": "Stake Status",
+ "optional": False})
+application_transmission_channels.append({"origin": "Update Application Stake Status",
+ "entity": "Application",
+ "variable": "Unstaking Height",
+ "optional": False})
diff --git a/src/StateUpdateTransmissionChannels/Servicer.py b/src/StateUpdateTransmissionChannels/Servicer.py
index 5a30ffc..5da9611 100644
--- a/src/StateUpdateTransmissionChannels/Servicer.py
+++ b/src/StateUpdateTransmissionChannels/Servicer.py
@@ -27,7 +27,7 @@
servicer_transmission_channels.append({"origin": "Update Servicer Params",
"entity": "Servicer",
- "variable": "Relay Chains",
+ "variable": "Services",
"optional": False})
servicer_transmission_channels.append({"origin": "Update Servicer Params",
@@ -48,4 +48,17 @@
servicer_transmission_channels.append({"origin": "Servicer Update Pause Height",
"entity": "Servicer",
"variable": "Pause Height",
- "optional": False})
\ No newline at end of file
+ "optional": False})
+
+servicer_transmission_channels.append({"origin": "Update Servicer Stake Status",
+ "entity": "Servicer",
+ "variable": "Stake Status",
+ "optional": False})
+
+servicer_transmission_channels.append({"origin": "Update Servicer Stake Status",
+ "entity": "Servicer",
+ "variable": "Unstaking Height",
+ "optional": False})
+
+
+
diff --git a/src/Types/Data.py b/src/Types/Data.py
index 0dd70b6..6ee90a0 100644
--- a/src/Types/Data.py
+++ b/src/Types/Data.py
@@ -1,12 +1,12 @@
from typing import NewType, TypedDict, List
-from .Entity import RelayChainEntityType, ApplicationEntityType, ServicerEntityType, FishermanEntityType
+from .Entity import ServiceEntityType, ApplicationEntityType, ServicerEntityType, FishermanEntityType
from .Primitives import GeoZoneType
SessionType = NewType('Session', TypedDict('Session', {"id": str, # a universally unique ID for the session
"session_number": int, # a monotonically increasing number representing the # on the chain
"session_height": int, # the height at which the session starts
"num_session_blocks": int, # the number of blocks the session is valid from
- "relay_chain": RelayChainEntityType, # the relay chain the session is valid for
+ "service": ServiceEntityType, # the service the session is valid for
"geo_zone": GeoZoneType, # the target geographic region where the actors are present
"application": ApplicationEntityType, # the application that is being served
"servicers": List[ServicerEntityType], # the set of servicers that are serving the application
diff --git a/src/Types/Entity.py b/src/Types/Entity.py
index 8515b21..859c98a 100644
--- a/src/Types/Entity.py
+++ b/src/Types/Entity.py
@@ -1,6 +1,7 @@
-from typing import NewType
+from typing import NewType, List
+ServiceEntityType = NewType('Service Entity', object)
-RelayChainEntityType = NewType('Relay Chain Entity', object)
-ApplicationEntityType = NewType('Relay Chain Entity', object)
-ServicerEntityType = NewType('Relay Chain Entity', object)
-FishermanEntityType = NewType('Relay Chain Entity', object)
\ No newline at end of file
+ApplicationEntityType = NewType('Application Entity', object)
+ServicerEntityType = NewType('Servicer Entity', object)
+ServicerGroupType = NewType("Servicer Group",List[ServicerEntityType])
+FishermanEntityType = NewType('Fisherman Entity', object)
\ No newline at end of file
diff --git a/src/Types/Primitives.py b/src/Types/Primitives.py
index a724b22..d0ff5bc 100644
--- a/src/Types/Primitives.py
+++ b/src/Types/Primitives.py
@@ -17,7 +17,7 @@
# A URL for an api end point
ServiceURLType = NewType('Service URL', str)
-RelayChainType = NewType('Relay Chain', str)
+ServiceType = NewType('Service', str)
# The physical geo-location identifier this Servicer registered in
GeoZoneType = NewType('GeoZone', str)
diff --git a/src/Types/__init__.py b/src/Types/__init__.py
index 922419c..e48873d 100644
--- a/src/Types/__init__.py
+++ b/src/Types/__init__.py
@@ -1,8 +1,8 @@
from .Primitives import (PublicKeyType, uPOKTType, ServiceURLType,
- RelayChainType, GeoZoneType, ServicerReportCardType,
+ ServiceType, GeoZoneType, ServicerReportCardType,
ServicerTestScoresType, POKTType, Days, AddressType,
BlockHeightType, NumberOfBlocksType, PercentType,
USDType, NumberRelaysPerDayType, NanoSecondsType)
from .Actor import ActorType, StakeStatusType
-from .Entity import RelayChainEntityType
+from .Entity import ServiceEntityType, ServicerEntityType, ApplicationEntityType, ServicerGroupType
from .Data import SessionType
\ No newline at end of file