diff --git a/Testing.ipynb b/Testing.ipynb index c158269..d8355e3 100644 --- a/Testing.ipynb +++ b/Testing.ipynb @@ -16,23 +16,64 @@ " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n", "\n", - "\n", - "\n", - "\n", - "Servicer Forced Unstake\n", - "\n", - "\n", + "\n", + "\n", + "\n", + "Submit Relay Request\n", + "\n", + "\n", "\n", - "Servicer Stake Burn\n", - "\n", - "Servicer Stake Burn\n", + "Portal\n", + "\n", + "\n", + "Portal\n", + "\n", + "\n", + "\n", + "Submit Relay Request\n", + "\n", + "Submit Relay Request\n", + "\n", + "\n", + "\n", + "Portal->Submit Relay Request\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "Application\n", + "\n", + "\n", + "Application\n", + "\n", + "\n", + "\n", + "Application->Submit Relay Request\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "Submit Relay Request Policy\n", + "\n", + "Submit Relay Request Policy\n", + "\n", + "\n", + "\n", + "Submit Relay Request->Submit Relay Request Policy\n", + "\n", + "\n", + "Submit Relay\n", + "Request\n", + "Space\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -53,7 +94,7 @@ "from src import math_spec_json\n", "ms = load_from_json(deepcopy(math_spec_json))\n", "\n", - "for behavior in [\"Servicer Forced Unstake\"]:\n", + "for behavior in [\"Submit Relay Request\"]:\n", " display(create_action_chains_graph(ms, [behavior], behavior))" ] }, @@ -84,12 +125,12 @@ "│ ├──Validator\n", "│ ├──Portal\n", "│ ├──Treasury\n", - "│ ├──Relay Chain\n", + "│ ├──Service\n", "│ ├──Global\n", "│ ├──DAO\n", "├──State\n", "│ ├──Global\n", - "│ │ ├──Relay Chains\n", + "│ │ ├──Services\n", "│ │ ├──Sessions\n", "│ ├──Servicer\n", "│ │ ├──Public key\n", @@ -99,21 +140,23 @@ "│ │ ├──POKT Holdings\n", "│ │ ├──Staked POKT\n", "│ │ ├──Service URL\n", - "│ │ ├──Relay Chains\n", + "│ │ ├──Services\n", "│ │ ├──GeoZone\n", "│ │ ├──Operator Public Key\n", "│ │ ├──Pause Height\n", "│ │ ├──Stake Status\n", + "│ │ ├──Unstaking Height\n", "│ ├──Fisherman\n", "│ │ ├──Stake Status\n", "│ ├──Application\n", "│ │ ├──Public key\n", "│ │ ├──POKT Holdings\n", "│ │ ├──Staked POKT\n", - "│ │ ├──Relay Chains\n", + "│ │ ├──Services\n", "│ │ ├──GeoZone\n", "│ │ ├──Number of Servicers\n", "│ │ ├──Stake Status\n", + "│ │ ├──Unstaking Height\n", "│ ├──Validator\n", "│ │ ├──Public key\n", "│ │ ├──POKT Holdings\n", @@ -125,10 +168,10 @@ "│ │ ├──Stake Status\n", "│ ├──Treasury\n", "│ │ ├──Floating Supply\n", - "│ ├──Relay Chain\n", + "│ ├──Service\n", "│ │ ├──Name\n", "│ │ ├──Portal API Prefix\n", - "│ │ ├──Relay Chain ID\n", + "│ │ ├──Service ID\n", "│ ├──DAO\n", "│ │ ├──POKT Holdings\n", "├──Spaces\n", @@ -166,8 +209,8 @@ "│ ├──Jail Node Space\n", "│ ├──Unjail Node Space\n", "│ ├──Return Servicer Stake Space\n", - "│ ├──Relay Chain Join Space\n", - "│ ├──Relay Chain Leave Space\n", + "│ ├──Service Join Space\n", + "│ ├──Service Leave Space\n", "│ ├──Return Application Stake Space\n", "│ ├──Servicer Block Reward Space\n", "│ ├──Mint POKT Mechanism Space\n", @@ -177,6 +220,8 @@ "│ ├──Portal Relay Request Space\n", "│ ├──Servicer Stake Burn Space\n", "│ ├──Servicer Forced Unstake Space\n", + "│ ├──Servicer Stake Status Space\n", + "│ ├──Application Stake Status Space\n", "├──Parameters\n", "│ ├──Servicer\n", "│ │ ├──minimum_stake_servicer\n", @@ -210,6 +255,7 @@ "│ │ ├──portal_minimum_stake\n", "│ ├──Session\n", "│ │ ├──session_block_frequency\n", + "│ │ ├──session_token_bucket_coefficient\n", "│ ├──Treasury\n", "│ │ ├──dao_fee_percentage\n", "│ │ ├──validator_fee_percentage\n", @@ -237,8 +283,8 @@ "│ ├──Servicer Relay\n", "│ ├──Burn POKT\n", "│ ├──Unjail Node\n", - "│ ├──Relay Chain Join\n", - "│ ├──Relay Chain Leave\n", + "│ ├──Service Join\n", + "│ ├──Service Leave\n", "│ ├──Submit Relay Request (Portal)\n", "├──Control Actions\n", "│ ├──Mint Block Rewards\n", @@ -265,6 +311,9 @@ "│ ├──Servicer Relay Policy\n", "│ ├──Servicer Stake Burn Policy\n", "│ ├──Portal Registration Policy\n", + "│ ├──Servicer Unstake Policy\n", + "│ ├──Application Unstake Policy\n", + "│ ├──Submit Relay Request Policy\n", "├──Mechanisms\n", "│ ├──Modify Servicer POKT Holdings\n", "│ ├──Modify Servicer Stake\n", @@ -279,6 +328,8 @@ "│ ├──Mint POKT Mechanism\n", "│ ├──Burn POKT Mechanism\n", "│ ├──Modify DAO POKT Holdings\n", + "│ ├──Update Servicer Stake Status\n", + "│ ├──Update Application Stake Status\n", "\n" ] } @@ -340,6 +391,7 @@ "portal_fee_per_relay [] \n", "portal_minimum_stake [] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [] \n", "dao_fee_percentage [] \n", "validator_fee_percentage [] \n", "maturity_relay_cost [] \n", @@ -380,6 +432,7 @@ "portal_fee_per_relay [] \n", "portal_minimum_stake [] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [] \n", "dao_fee_percentage [] \n", "validator_fee_percentage [] \n", "maturity_relay_cost [] \n", @@ -420,6 +473,7 @@ "portal_fee_per_relay [Block Reward Policy Aggregate] \n", "portal_minimum_stake [Portal Registration Policy] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [Submit Relay Request Policy] \n", "dao_fee_percentage [Block Reward Policy Aggregate] \n", "validator_fee_percentage [Block Reward Policy Aggregate] \n", "maturity_relay_cost [Block Reward Policy Aggregate, Submit Relay R... \n", @@ -460,6 +514,7 @@ "portal_fee_per_relay [] \n", "portal_minimum_stake [] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [] \n", "dao_fee_percentage [] \n", "validator_fee_percentage [] \n", "maturity_relay_cost [] \n", @@ -505,6 +560,7 @@ "portal_fee_per_relay [] \n", "portal_minimum_stake [Portal Registration] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [Submit Relay Request] \n", "dao_fee_percentage [] \n", "validator_fee_percentage [] \n", "maturity_relay_cost [Servicer Relay, Submit Relay Request (Portal)] \n", @@ -545,6 +601,7 @@ "portal_fee_per_relay [Mint Block Rewards] \n", "portal_minimum_stake [] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [] \n", "dao_fee_percentage [Mint Block Rewards] \n", "validator_fee_percentage [Mint Block Rewards] \n", "maturity_relay_cost [Mint Block Rewards] \n", @@ -585,6 +642,7 @@ "portal_fee_per_relay [Block Reward Policy Aggregate, DAO Block Rewa... \n", "portal_minimum_stake [Portal Registration Policy] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [Submit Relay Request Policy] \n", "dao_fee_percentage [Block Reward Policy Aggregate, DAO Block Rewa... \n", "validator_fee_percentage [Block Reward Policy Aggregate, DAO Block Rewa... \n", "maturity_relay_cost [Block Reward Policy Aggregate, Submit Relay R... \n", @@ -625,6 +683,7 @@ "portal_fee_per_relay [Modify DAO POKT Holdings, Modify Validator PO... \n", "portal_minimum_stake [] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [] \n", "dao_fee_percentage [Modify DAO POKT Holdings, Modify Validator PO... \n", "validator_fee_percentage [Modify DAO POKT Holdings, Modify Validator PO... \n", "maturity_relay_cost [Modify DAO POKT Holdings, Modify Validator PO... \n", @@ -665,6 +724,7 @@ "portal_fee_per_relay [DAO, Validator, Treasury, Servicer] \n", "portal_minimum_stake [Portal] \n", "session_block_frequency [] \n", + "session_token_bucket_coefficient [Application, Portal] \n", "dao_fee_percentage [DAO, Validator, Treasury, Servicer] \n", "validator_fee_percentage [DAO, Validator, Treasury, Servicer] \n", "maturity_relay_cost [Servicer, Portal, DAO, Validator, Treasury] \n", @@ -697,6 +757,7 @@ "Return Application Stake [application_unstaking_time]\n", "Application Delegate to Portal Policy [stake_per_app_delegation]\n", "Portal Registration Policy [portal_minimum_stake]\n", + "Submit Relay Request Policy [session_token_bucket_coefficient]\n", "Submit Relay Request (Portal) Policy [maturity_relay_cost, maturity_relay_charge, m...\n", "Servicer Relay Policy [maturity_relay_cost, maturity_relay_charge, s...\n", "dtype: object\n", @@ -748,7 +809,9 @@ "Application Delegate to Portal Policy [stake_per_app_delegation]\n", "Portal Registration [portal_minimum_stake]\n", "Portal Registration Policy [portal_minimum_stake]\n", - "Portal [portal_minimum_stake, maturity_relay_cost, ma...\n", + "Portal [portal_minimum_stake, session_token_bucket_co...\n", + "Submit Relay Request [session_token_bucket_coefficient]\n", + "Submit Relay Request Policy [session_token_bucket_coefficient]\n", "Servicer Relay [maturity_relay_cost, maturity_relay_charge, s...\n", "Submit Relay Request (Portal) [maturity_relay_cost, maturity_relay_charge, m...\n", "Submit Relay Request (Portal) Policy [maturity_relay_cost, maturity_relay_charge, m...\n", @@ -792,14 +855,15 @@ }, "outputs": [], "source": [ - "write_action_chain_reports(ms, \"reports/actions\", [\"Servicer Stake\", \"Application Stake\", \"Servicer Pause\", \"Mint Block Rewards\"])\n", + "write_action_chain_reports(ms, \"reports/actions\", [\"Servicer Stake\", \"Application Stake\", \"Servicer Pause\", \"Mint Block Rewards\",\n", + " \"Application Unstake\", \"Servicer Unstake\"])\n", "write_entity_reports(ms, \"reports/entities\", ['Servicer',\n", " 'Fisherman',\n", " 'Application',\n", " 'Validator',\n", " 'Portal',\n", " 'Treasury',\n", - " 'Relay Chain',\n", + " 'Service',\n", " 'Global',\n", " 'DAO'])\n", "write_basic_report_full(ms, \"reports\", \"Basic Report\")" diff --git a/reports/Basic Report.html b/reports/Basic Report.html index 0171d46..c30143f 100644 --- a/reports/Basic Report.html +++ b/reports/Basic Report.html @@ -10,15 +10,15 @@ - + viewBox="0.00 0.00 1319.33 634.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> Servicer Stake - + @@ -26,11 +26,11 @@ Servicer - + - + -Servicer +Servicer @@ -40,9 +40,9 @@ Servicer Stake - + -Servicer Stake +Servicer Stake @@ -52,9 +52,9 @@ Servicer->Servicer Stake - + - + @@ -64,9 +64,9 @@ Servicer Stake Policy - + -Servicer Stake Policy +Servicer Stake Policy @@ -76,13 +76,13 @@ Servicer Stake->Servicer Stake Policy - + - + -Servicer +Servicer -Stake Space +Stake Space @@ -92,9 +92,9 @@ Set Servicer Parameters Policy - + -Set Servicer Parameters Policy +Set Servicer Parameters Policy @@ -104,13 +104,13 @@ Servicer Stake Policy->Set Servicer Parameters Policy - + - + -Servicer +Servicer -Stake Space +Stake Space @@ -120,9 +120,9 @@ Modify Servicer POKT Holdings - + -Modify Servicer POKT Holdings +Modify Servicer POKT Holdings @@ -132,15 +132,15 @@ Servicer Stake Policy->Modify Servicer POKT Holdings - + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space @@ -150,9 +150,9 @@ Modify Servicer Stake - + -Modify Servicer Stake +Modify Servicer Stake @@ -162,15 +162,15 @@ Servicer Stake Policy->Modify Servicer Stake - + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space @@ -192,15 +192,15 @@ Set Servicer Parameters Policy->Prune Servicer QoS - + - + -Servicer +Servicer -Param Update +Param Update -Space +Space @@ -210,9 +210,9 @@ Update Servicer Params - + -Update Servicer Params +Update Servicer Params @@ -222,15 +222,15 @@ Set Servicer Parameters Policy->Update Servicer Params - + - + -Servicer +Servicer -Param Update +Param Update -Space +Space @@ -240,9 +240,9 @@ Servicer.POKT Holdings - + -Servicer.POKT Holdings +Servicer.POKT Holdings @@ -252,9 +252,9 @@ Modify Servicer POKT Holdings->Servicer.POKT Holdings - + - + @@ -264,9 +264,9 @@ Servicer.Staked POKT - + -Servicer.Staked POKT +Servicer.Staked POKT @@ -276,9 +276,9 @@ Modify Servicer Stake->Servicer.Staked POKT - + - + @@ -348,33 +348,33 @@ Update Servicer Params->Servicer.Service URL - + - + - + -Servicer.Relay Chains +Servicer.Services - + -Servicer.Relay Chains +Servicer.Services - + -Update Servicer Params->Servicer.Relay Chains +Update Servicer Params->Servicer.Services - + - + @@ -384,9 +384,9 @@ Servicer.GeoZone - + -Servicer.GeoZone +Servicer.GeoZone @@ -396,9 +396,9 @@ Update Servicer Params->Servicer.GeoZone - + - + @@ -408,9 +408,9 @@ Servicer.Operator Public Key - + -Servicer.Operator Public Key +Servicer.Operator Public Key @@ -420,9 +420,9 @@ Update Servicer Params->Servicer.Operator Public Key - + - + @@ -432,11 +432,11 @@ Servicer_2 - + - + -Servicer +Servicer @@ -446,9 +446,9 @@ Servicer.POKT Holdings->Servicer_2 - + - + @@ -458,9 +458,9 @@ Servicer.Staked POKT->Servicer_2 - + - + @@ -470,9 +470,9 @@ Servicer.Report Card->Servicer_2 - + - + @@ -482,9 +482,9 @@ Servicer.Test Scores->Servicer_2 - + - + @@ -494,21 +494,21 @@ Servicer.Service URL->Servicer_2 - + - + - + -Servicer.Relay Chains->Servicer_2 +Servicer.Services->Servicer_2 - + - + @@ -518,9 +518,9 @@ Servicer.GeoZone->Servicer_2 - + - + @@ -530,9 +530,9 @@ Servicer.Operator Public Key->Servicer_2 - + - + @@ -921,15 +921,15 @@ - + viewBox="0.00 0.00 415.98 497.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Servicer Unstake - + @@ -937,11 +937,11 @@ Servicer - + - + -Servicer +Servicer @@ -951,9 +951,9 @@ Servicer Unstake - + -Servicer Unstake +Servicer Unstake @@ -963,9 +963,155 @@ Servicer->Servicer Unstake - + + + + + + + + + + +Servicer Unstake Policy + + + +Servicer Unstake Policy + + + + + + + +Servicer Unstake->Servicer Unstake Policy + + + + + +Servicer + +Unstake + +Space + + + + + + + +Update Servicer Stake Status + + + +Update Servicer Stake Status + + + + + + + +Servicer Unstake Policy->Update Servicer Stake Status + + + + + +Servicer + +Stake Status + +Space + + + + + + + +Servicer.Stake Status + + + +Servicer.Stake Status + + + + + + + +Update Servicer Stake Status->Servicer.Stake Status + + + + + + + + + + + +Servicer.Unstaking Height + + + +Servicer.Unstaking Height + + + + + + + +Update Servicer Stake Status->Servicer.Unstaking Height + + + + + + + + + + + +Servicer_2 + + - + + +Servicer + + + + + + + +Servicer.Stake Status->Servicer_2 + + + + + + + + + + + +Servicer.Unstaking Height->Servicer_2 + + + + @@ -984,15 +1130,15 @@ - + viewBox="0.00 0.00 929.38 634.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> Application Stake - + @@ -1000,11 +1146,11 @@ Application - + - + -Application +Application @@ -1014,9 +1160,9 @@ Application Stake - + -Application Stake +Application Stake @@ -1026,9 +1172,9 @@ Application->Application Stake - + - + @@ -1038,9 +1184,9 @@ Application Stake Policy - + -Application Stake Policy +Application Stake Policy @@ -1050,13 +1196,13 @@ Application Stake->Application Stake Policy - + - + -Application +Application -Stake Space +Stake Space @@ -1066,9 +1212,9 @@ Set Application Parameters Policy - + -Set Application Parameters Policy +Set Application Parameters Policy @@ -1078,13 +1224,13 @@ Application Stake Policy->Set Application Parameters Policy - + - + -Application +Application -Stake Space +Stake Space @@ -1094,9 +1240,9 @@ Modify Application POKT Holdings - + -Modify Application POKT Holdings +Modify Application POKT Holdings @@ -1106,15 +1252,15 @@ Application Stake Policy->Modify Application POKT Holdings - + - + -Modify +Modify -Application +Application -POKT Space +POKT Space @@ -1124,9 +1270,9 @@ Modify Application Stake - + -Modify Application Stake +Modify Application Stake @@ -1136,15 +1282,15 @@ Application Stake Policy->Modify Application Stake - + - + -Modify +Modify -Application +Application -POKT Space +POKT Space @@ -1154,9 +1300,9 @@ Update Application Params - + -Update Application Params +Update Application Params @@ -1166,15 +1312,15 @@ Set Application Parameters Policy->Update Application Params - + - + -Application +Application -Param Update +Param Update -Space +Space @@ -1184,9 +1330,9 @@ Application.POKT Holdings - + -Application.POKT Holdings +Application.POKT Holdings @@ -1196,9 +1342,9 @@ Modify Application POKT Holdings->Application.POKT Holdings - + - + @@ -1208,9 +1354,9 @@ Application.Staked POKT - + -Application.Staked POKT +Application.Staked POKT @@ -1220,33 +1366,33 @@ Modify Application Stake->Application.Staked POKT - + - + - + -Application.Relay Chains +Application.Services - + -Application.Relay Chains +Application.Services - + -Update Application Params->Application.Relay Chains +Update Application Params->Application.Services - + - + @@ -1256,9 +1402,9 @@ Application.GeoZone - + -Application.GeoZone +Application.GeoZone @@ -1268,9 +1414,9 @@ Update Application Params->Application.GeoZone - + - + @@ -1280,9 +1426,9 @@ Application.Number of Servicers - + -Application.Number of Servicers +Application.Number of Servicers @@ -1292,9 +1438,9 @@ Update Application Params->Application.Number of Servicers - + - + @@ -1304,11 +1450,11 @@ Application_2 - + - + -Application +Application @@ -1318,9 +1464,9 @@ Application.POKT Holdings->Application_2 - + - + @@ -1330,21 +1476,21 @@ Application.Staked POKT->Application_2 - + - + - + -Application.Relay Chains->Application_2 +Application.Services->Application_2 - + - + @@ -1354,9 +1500,9 @@ Application.GeoZone->Application_2 - + - + @@ -1366,9 +1512,9 @@ Application.Number of Servicers->Application_2 - + - + @@ -1387,15 +1533,15 @@ - + viewBox="0.00 0.00 467.98 497.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Application Unstake - + @@ -1403,11 +1549,11 @@ Application - + - + -Application +Application @@ -1417,9 +1563,9 @@ Application Unstake - + -Application Unstake +Application Unstake @@ -1429,9 +1575,155 @@ Application->Application Unstake - + + + + + + + + + + +Application Unstake Policy + + + +Application Unstake Policy + + + + + + + +Application Unstake->Application Unstake Policy + + + + + +Application + +Unstake + +Space + + + + + + + +Update Application Stake Status + + + +Update Application Stake Status + + + + + + + +Application Unstake Policy->Update Application Stake Status + + + + + +Application + +Stake Status + +Space + + + + + + + +Application.Stake Status + + + +Application.Stake Status + + + + + + + +Update Application Stake Status->Application.Stake Status + + + + + + + + + + + +Application.Unstaking Height + + + +Application.Unstaking Height + + + + + + + +Update Application Stake Status->Application.Unstaking Height + + + + + + + + + + + +Application_2 + + + + + +Application + + + + + + - +Application.Stake Status->Application_2 + + + + + + + + + + + +Application.Unstaking Height->Application_2 + + + + @@ -1762,27 +2054,27 @@ - + viewBox="0.00 0.00 269.04 234.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Submit Relay Request - + - + -Application +Portal - + - + -Application +Portal @@ -1792,9 +2084,35 @@ Submit Relay Request - + -Submit Relay Request +Submit Relay Request + + + + + + + +Portal->Submit Relay Request + + + + + + + + + + + +Application + + + + + +Application @@ -1804,35 +2122,39 @@ Application->Submit Relay Request - + - + - - - + -Portal + - +Submit Relay Request Policy - + -Portal +Submit Relay Request Policy - + - + -Portal->Submit Relay Request +Submit Relay Request->Submit Relay Request Policy + + + + - +Submit Relay - +Request + +Space @@ -2092,53 +2414,53 @@ --> - + - + viewBox="0.00 0.00 164.26 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -Relay Chain Join +Service Join - + - + -Relay Chain +Service - + - + -Relay Chain +Service - + -Relay Chain Join +Service Join - + -Relay Chain Join +Service Join - + -Relay Chain->Relay Chain Join +Service->Service Join - + - + @@ -2155,53 +2477,53 @@ --> - + - + viewBox="0.00 0.00 184.48 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -Relay Chain Leave +Service Leave - + - + -Relay Chain +Service - + - + -Relay Chain +Service - + -Relay Chain Leave +Service Leave - + -Relay Chain Leave +Service Leave - + -Relay Chain->Relay Chain Leave +Service->Service Leave - + - + @@ -2308,14 +2630,14 @@

State

Local States

Global State

-
Type Symbol Domain
Relay ChainsThe relay chains active in the systemList[Relay Chain Entity]
SessionsA Session is a time-based mechanism used to regulate the various interactions (Web3 access, monitoring, etc) between protocol actors to enable the Utilitarian economy in a fair and secure manner. A single session may extend multiple Blocks as determined by SessionBlockFrequency.List[Session]

Servicer State

+
ServicesThe services active in the systemList[Service Entity]
SessionsA Session is a time-based mechanism used to regulate the various interactions (Web3 access, monitoring, etc) between protocol actors to enable the Utilitarian economy in a fair and secure manner. A single session may extend multiple Blocks as determined by SessionBlockFrequency.List[Session]

Servicer State

-
Name Description Type Symbol Domain
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType

Fisherman State

+
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Fisherman State

@@ -2329,7 +2651,7 @@

State

Local States

Global State

Name Description
-
Type Symbol Domain
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType

Validator State

+
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Validator State

@@ -2350,21 +2672,21 @@

State

Local States

Global State

Name Description
-
Type Symbol Domain
Floating SupplyThe amount of floating supply in the ecosystemuPOKT

Relay Chain State

+
Floating SupplyThe amount of floating supply in the ecosystemuPOKT

Service State

-
Name Description Type Symbol Domain
NameThe name of the relay chainstr
Portal API PrefixPrefix for the portal APIstr
Relay Chain IDThe identifier used for the chainstr

DAO State

+
NameThe name of the servicestr
Portal API PrefixPrefix for the portal APIstr
Service IDThe identifier used for the chainstr

DAO State

-
Name Description Type Symbol Domain
POKT HoldingsThe holdings of the DAO in uPOKTuPOKT

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}

Servicer Pause Space

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Pause Space 2

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Unpause Space

{actor_type: ActorType,
address: Address,
signer: Address}

Assign Servicer Salary Space

{geo_zone: GeoZone,
relay_chain: Relay Chain,
height: Block Height}

Modify Servicer POKT Space

{public_key: Public Key,
amount: uPOKT}

Servicer Param Update Space

{public_key: Public Key,
service_url: Service URL,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
operator_public_key: Public Key}

Servicer Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Application Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
number_servicers: int}

Servicer Unpause Space 2

{actor_type: ActorType,
address: Address,
signer: Address,
block_height: Block Height}

Modify Application POKT Space

{public_key: Public Key,
amount: uPOKT}

Application Param Update Space

{public_key: Public Key,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
number_servicers: int}

Application Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Application Delegate to Portal Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Validator Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL,
operator_public_key: Public Key}

Modify Validator POKT Space

{public_key: Public Key,
amount: uPOKT}

Validator Param Update Space

{public_key: Public Key,
service_url: Service URL,
operator_public_key: Public Key}

Portal Registration Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL}

Portal Unregistration Space

{public_key: Public Key}

Application Undelegation Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Validator Pause Space

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Validator Stake Burning Space

{}

Validator Unstake Space

{}

Validator Unpause Space

{}

Validator Jail Space

{}

Become Validator Space

{}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Submit Relay Request Space

{payload: dict,
meta: dict,
proof: dict,
application_address: Public Key}

Servicer Relay Space

{}

Mint Block Rewards Space

{current_height: Block Height,
block_producer: Public Key}

Burn POKT Space

{burn_amount: uPOKT,
block_height: Block Height}

Jail Node Space

{node_address: Public Key,
block_height: Block Height,
jailer_address: Public Key}

Unjail Node Space

{node_address: Public Key,
block_height: Block Height}

Return Servicer Stake Space

{public_key: Public Key,
amount: uPOKT}

Relay Chain Join Space

{name: str,
portal_api_prefix: str,
relay_chain_id: str}

Relay Chain Leave Space

{relay_chain_id: str}

Return Application Stake Space

{public_key: Public Key,
amount: uPOKT}

Servicer Block Reward Space

{public_key: Public Key,
number_of_relays: int,
usage_to_reward_coeffecient: float}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Burn POKT Mechanism Space

{burn_amount: uPOKT}

DAO Block Reward Space

{}

Modify DAO POKT Space

{}

Portal Relay Request Space

{}

Servicer Stake Burn Space

{}

Servicer Forced Unstaked Space

{public_key: Public Key}

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.

Called By:

+ POKT HoldingsThe holdings of the DAO in uPOKTuPOKT

Spaces

Servicer Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL,
services: List[Service],
geo_zone: GeoZone,
operator_public_key: Public Key}

Servicer Pause Space

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Pause Space 2

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Unpause Space

{actor_type: ActorType,
address: Address,
signer: Address}

Assign Servicer Salary Space

{geo_zone: GeoZone,
service: Service,
height: Block Height}

Modify Servicer POKT Space

{public_key: Public Key,
amount: uPOKT}

Servicer Param Update Space

{public_key: Public Key,
service_url: Service URL,
services: List[Service],
geo_zone: GeoZone,
operator_public_key: Public Key}

Servicer Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Application Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
services: List[Service],
geo_zone: GeoZone,
number_servicers: int}

Servicer Unpause Space 2

{actor_type: ActorType,
address: Address,
signer: Address,
block_height: Block Height}

Modify Application POKT Space

{public_key: Public Key,
amount: uPOKT}

Application Param Update Space

{public_key: Public Key,
services: List[Service],
geo_zone: GeoZone,
number_servicers: int}

Application Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Application Delegate to Portal Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Validator Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL,
operator_public_key: Public Key}

Modify Validator POKT Space

{public_key: Public Key,
amount: uPOKT}

Validator Param Update Space

{public_key: Public Key,
service_url: Service URL,
operator_public_key: Public Key}

Portal Registration Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL}

Portal Unregistration Space

{public_key: Public Key}

Application Undelegation Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Validator Pause Space

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Validator Stake Burning Space

{}

Validator Unstake Space

{}

Validator Unpause Space

{}

Validator Jail Space

{}

Become Validator Space

{}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Submit Relay Request Space

{payload: dict,
meta: dict,
proof: dict,
application_address: Public Key}

Servicer Relay Space

{servicers: Servicer Group,
applications: Application Entity,
session: Session}

Mint Block Rewards Space

{current_height: Block Height,
block_producer: Public Key}

Burn POKT Space

{burn_amount: uPOKT,
block_height: Block Height}

Jail Node Space

{node_address: Public Key,
block_height: Block Height,
jailer_address: Public Key}

Unjail Node Space

{node_address: Public Key,
block_height: Block Height}

Return Servicer Stake Space

{public_key: Public Key,
amount: uPOKT}

Service Join Space

{name: str,
portal_api_prefix: str,
service_id: str}

Service Leave Space

{service_id: str}

Return Application Stake Space

{public_key: Public Key,
amount: uPOKT}

Servicer Block Reward Space

{public_key: Public Key,
number_of_relays: int,
usage_to_reward_coeffecient: float}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Burn POKT Mechanism Space

{burn_amount: uPOKT}

DAO Block Reward Space

{}

Modify DAO POKT Space

{}

Portal Relay Request Space

{}

Servicer Stake Burn Space

{}

Servicer Forced Unstaked Space

{public_key: Public Key}

Servicer Stake Status Space

{address: Public Key,
height: Block Height,
status: StakeStatusType}

Application Stake Status Space

{address: Public Key,
height: Block Height,
status: StakeStatusType}

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.

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:

@@ -2372,7 +2694,7 @@

Servicer Unpause

When a Servicer is paused, they are able resume serv

1. Servicer

Constraints:

Servicer Unstake

The action of unstaking from the network for a servicer

Called By:

1. Servicer

Constraints:

-

Application Stake

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...).

Called By:

+

Application Stake

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...).

Called By:

1. Application

Constraints:

Application Unstake

The action of unstaking from the network for an application

Called By:

1. Application

Constraints:

@@ -2384,18 +2706,18 @@

Portal Unregistration

A Portal is able to submit an UnstakeMsg to exi

1. Portal

Constraints:

Application Undelegation

If a staked Application wants to stop using a Portal, and prevent the Portal from further signing relays on its behalf, it would simply submit an on-chain UndelegateMsg. Further relays signed by the Portal on behalf of the Application would be rejected by the Servicers.

Called By:

1. Application

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:

+

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:

-

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:

+

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:

Burn POKT

Treasury burning supply of POKT

Called By:

1. Treasury

Constraints:

Unjail Node

Process of a node submitting to be unjailed.

Called By:

1. Servicer

2. Validator

Constraints:

-

Relay Chain Join

Action for relay chain moving to be added to the system.

Called By:

-

1. Relay Chain

Constraints:

-

Relay Chain Leave

Action for relay chain moving to leave the system.

Called By:

-

1. Relay Chain

Constraints:

+

Service Join

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:

Submit Relay Request (Portal)

Portal submitting a relay request on behalf of an application.

Called By:

1. Portal

Constraints:

Policies

Servicer Stake Policy

Policy which takes care of actions to occur after a servicer attempts to stake

Preceded By:

@@ -2405,9 +2727,9 @@

Policies

Servicer Stake Policy

Policy which takes care of act

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 -

5. LEN(DOMAIN[0].relay_chains) <= PARAMS.max_chains_servicer +

3. LEN(DOMAIN[0].services) > 0 +

4. All chains in DOMAIN[0].services must be valid +

5. LEN(DOMAIN[0].services) <= PARAMS.max_chains_servicer

Set Servicer Parameters Policy

Policy for determining the impact of servicer parameter changes

Preceded By:

1. Servicer Stake Policy

Domain Spaces:

1. Servicer Stake Space

Followed By:

@@ -2426,8 +2748,8 @@

Application Stake Policy

The policy which takes care of whether an ap

1. Application Stake Space

2. Modify Application POKT Space

3. Modify Application 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 +

3. LEN(DOMAIN[0].services) > 0 +

4. All chains in DOMAIN[0].services must be valid

5. DOMAIN[0].number_servicers >= PARAMS.MinServicersPerSession

6. DOMAIN[0].number_servicers <= PARAMS.MaxServicersPerSession

Set Application Parameters Policy

Policy for determining if application parameters should be updated

Preceded By:

@@ -2443,23 +2765,23 @@

Application Stake Policy

The policy which takes care of whether an ap

1. Servicer Pause Space

Followed By:

1. Servicer Update Pause Height

Codomain Spaces:

1. Servicer Pause 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) @@ -2472,7 +2794,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:

@@ -2531,7 +2853,27 @@

Portal Registration Policy

Policy which handles the logic of portal r

1. Portal Registration Space

Followed By:

Codomain Spaces:

Constraints:

-

Mechanisms

Modify Servicer POKT Holdings

The mechanism to update the personal holdings of a servicer

Preceded By:

+

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:

+

Application Unstake Policy

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:

+

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.


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:

@@ -2544,7 +2886,7 @@

Logic:

The servicer at DOMAIN[0].servicer_address has its stake modified by DOMAIN[0].value

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

Prune Servicer QoS

The mechanism which prunes historical QoS (TestScores, ReportCard, etc…)

Preceded By:

1. Set Servicer Parameters Policy

Domain Spaces:

@@ -2569,7 +2911,7 @@

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:

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

Servicer Update Pause Height

The mechanism which updates the pause height

Preceded By:

1. Servicer Pause Policy

Domain Spaces:

@@ -2596,4 +2938,14 @@

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_stake_servicer

minimum_stake_period_servicer

minimum_pause_time

max_chains_servicer

salary_block_frequency

minimum_test_score_threshold

minimum_report_card_threshold

servicer_unbounding_period

servicer_stake_floor_multiplier

servicer_stake_weight_ceiling

servicer_stake_floor_multiplier_exponent

servicer_stake_weight_multiplier

relays_to_tokens_multiplier

slash_fraction_downtime

replay_attack_burn_multiplier

max_jailed_blocks

downtime_jail_duration

minimum_servicers_per_session

maximum_servicers_per_session

application_unstaking_time

application_fee_per_relay

minimum_application_stake

block_proposer_allocation

stake_per_app_delegation

portal_fee_per_relay

portal_minimum_stake

session_block_frequency

dao_fee_percentage

validator_fee_percentage

maturity_relay_cost

maturity_relay_charge

min_bootstrap_gateway_fee_per_relay

max_bootstrap_servicer_cost_per_relay

servicer_bootstrap_unwind_start

servicer_bootstrap_end

gateway_bootstrap_unwind_start

gateway_bootstrap_unwind_end

transaction_fee

\ No newline at end of file +

The DAO has its holdings increased by the value

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.

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.

Parameters

minimum_stake_servicer

minimum_stake_period_servicer

minimum_pause_time

max_chains_servicer

salary_block_frequency

minimum_test_score_threshold

minimum_report_card_threshold

servicer_unbounding_period

servicer_stake_floor_multiplier

servicer_stake_weight_ceiling

servicer_stake_floor_multiplier_exponent

servicer_stake_weight_multiplier

relays_to_tokens_multiplier

slash_fraction_downtime

replay_attack_burn_multiplier

max_jailed_blocks

downtime_jail_duration

minimum_servicers_per_session

maximum_servicers_per_session

application_unstaking_time

application_fee_per_relay

minimum_application_stake

block_proposer_allocation

stake_per_app_delegation

portal_fee_per_relay

portal_minimum_stake

session_block_frequency

session_token_bucket_coefficient

dao_fee_percentage

validator_fee_percentage

maturity_relay_cost

maturity_relay_charge

min_bootstrap_gateway_fee_per_relay

max_bootstrap_servicer_cost_per_relay

servicer_bootstrap_unwind_start

servicer_bootstrap_end

gateway_bootstrap_unwind_start

gateway_bootstrap_unwind_end

transaction_fee

\ No newline at end of file diff --git a/reports/actions/Application Stake.html b/reports/actions/Application Stake.html index d73bde1..d868028 100644 --- a/reports/actions/Application Stake.html +++ b/reports/actions/Application Stake.html @@ -10,15 +10,15 @@ - + viewBox="0.00 0.00 929.38 634.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> Application Stake - + @@ -26,11 +26,11 @@ Application - + - + -Application +Application @@ -40,9 +40,9 @@ Application Stake - + -Application Stake +Application Stake @@ -52,9 +52,9 @@ Application->Application Stake - + - + @@ -64,9 +64,9 @@ Application Stake Policy - + -Application Stake Policy +Application Stake Policy @@ -76,13 +76,13 @@ Application Stake->Application Stake Policy - + - + -Application +Application -Stake Space +Stake Space @@ -92,9 +92,9 @@ Set Application Parameters Policy - + -Set Application Parameters Policy +Set Application Parameters Policy @@ -104,13 +104,13 @@ Application Stake Policy->Set Application Parameters Policy - + - + -Application +Application -Stake Space +Stake Space @@ -120,9 +120,9 @@ Modify Application POKT Holdings - + -Modify Application POKT Holdings +Modify Application POKT Holdings @@ -132,15 +132,15 @@ Application Stake Policy->Modify Application POKT Holdings - + - + -Modify +Modify -Application +Application -POKT Space +POKT Space @@ -150,9 +150,9 @@ Modify Application Stake - + -Modify Application Stake +Modify Application Stake @@ -162,15 +162,15 @@ Application Stake Policy->Modify Application Stake - + - + -Modify +Modify -Application +Application -POKT Space +POKT Space @@ -180,9 +180,9 @@ Update Application Params - + -Update Application Params +Update Application Params @@ -192,15 +192,15 @@ Set Application Parameters Policy->Update Application Params - + - + -Application +Application -Param Update +Param Update -Space +Space @@ -210,9 +210,9 @@ Application.POKT Holdings - + -Application.POKT Holdings +Application.POKT Holdings @@ -222,9 +222,9 @@ Modify Application POKT Holdings->Application.POKT Holdings - + - + @@ -234,9 +234,9 @@ Application.Staked POKT - + -Application.Staked POKT +Application.Staked POKT @@ -246,33 +246,33 @@ Modify Application Stake->Application.Staked POKT - + - + - + -Application.Relay Chains +Application.Services - + -Application.Relay Chains +Application.Services - + -Update Application Params->Application.Relay Chains +Update Application Params->Application.Services - + - + @@ -282,9 +282,9 @@ Application.GeoZone - + -Application.GeoZone +Application.GeoZone @@ -294,9 +294,9 @@ Update Application Params->Application.GeoZone - + - + @@ -306,9 +306,9 @@ Application.Number of Servicers - + -Application.Number of Servicers +Application.Number of Servicers @@ -318,9 +318,9 @@ Update Application Params->Application.Number of Servicers - + - + @@ -330,11 +330,11 @@ Application_2 - + - + -Application +Application @@ -344,9 +344,9 @@ Application.POKT Holdings->Application_2 - + - + @@ -356,21 +356,21 @@ Application.Staked POKT->Application_2 - + - + - + -Application.Relay Chains->Application_2 +Application.Services->Application_2 - + - + @@ -380,9 +380,9 @@ Application.GeoZone->Application_2 - + - + @@ -392,9 +392,9 @@ Application.Number of Servicers->Application_2 - + - + @@ -408,7 +408,7 @@

State

Local States

Application State

-
Type Symbol Domain
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType

Spaces

Application Param Update Space

{public_key: Public Key,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
number_servicers: int}

Application Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
number_servicers: int}

Modify Application POKT Space

{public_key: Public Key,
amount: uPOKT}

Behavioral Action Space

Application Stake

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...).

Called By:

+ Public keyThe identifier of the applicationPublic KeyPOKT HoldingsThe personal holdings of the application in uPOKTuPOKTStaked POKTThe staked amount of the application in uPOKTuPOKTServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]GeoZoneThe physical geo-location identifier this Servicer registered inGeoZoneNumber of ServicersThe number of servicers an application would prefer, if available, for a session.intStake StatusThe status of staking for the actorStakeStatusTypeUnstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Spaces

Modify Application POKT Space

{public_key: Public Key,
amount: uPOKT}

Application Param Update Space

{public_key: Public Key,
services: List[Service],
geo_zone: GeoZone,
number_servicers: int}

Application Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
services: List[Service],
geo_zone: GeoZone,
number_servicers: int}

Behavioral Action Space

Application Stake

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...).

Called By:

1. Application

Constraints:

Policies

Application Stake Policy

The policy which takes care of whether an application can stake and if it should update parameters.

Preceded By:

1. Application Stake

Domain Spaces:

@@ -417,8 +417,8 @@

Policies

Application Stake Policy

The policy which takes care

1. Application Stake Space

2. Modify Application POKT Space

3. Modify Application 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 +

3. LEN(DOMAIN[0].services) > 0 +

4. All chains in DOMAIN[0].services must be valid

5. DOMAIN[0].number_servicers >= PARAMS.MinServicersPerSession

6. DOMAIN[0].number_servicers <= PARAMS.MaxServicersPerSession

Set Application Parameters Policy

Policy for determining if application parameters should be updated

Preceded By:

@@ -442,6 +442,6 @@

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:

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

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

maximum_servicers_per_session

\ No newline at end of file diff --git a/reports/actions/Application Unstake.html b/reports/actions/Application Unstake.html new file mode 100644 index 0000000..0f6fcc2 --- /dev/null +++ b/reports/actions/Application Unstake.html @@ -0,0 +1,229 @@ +

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

Action Map

+ + + + + + + + + + + +Application Unstake + + + + + + + +Application + + + + + +Application + + + + + + + +Application Unstake + + + +Application Unstake + + + + + + + +Application->Application Unstake + + + + + + + + + + + +Application Unstake Policy + + + +Application Unstake Policy + + + + + + + +Application Unstake->Application Unstake Policy + + + + + +Application + +Unstake + +Space + + + + + + + +Update Application Stake Status + + + +Update Application Stake Status + + + + + + + +Application Unstake Policy->Update Application Stake Status + + + + + +Application + +Stake Status + +Space + + + + + + + +Application.Stake Status + + + +Application.Stake Status + + + + + + + +Update Application Stake Status->Application.Stake Status + + + + + + + + + + + +Application.Unstaking Height + + + +Application.Unstaking Height + + + + + + + +Update Application Stake Status->Application.Unstaking Height + + + + + + + + + + + +Application_2 + + + + + +Application + + + + + + + +Application.Stake Status->Application_2 + + + + + + + + + + + +Application.Unstaking Height->Application_2 + + + + + + + + + + +

State

Local States

Application State

+ + + + + + +
NameDescriptionTypeSymbolDomain
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Spaces

Application Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Behavioral Action Space

Application Unstake

The action of unstaking from the network for an application

Called By:

+

1. Application

Constraints:

+

Policies

Application Unstake Policy

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:

+

Mechanisms

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.

Parameters

\ No newline at end of file diff --git a/reports/actions/Mint Block Rewards.html b/reports/actions/Mint Block Rewards.html index 476946c..eb802c0 100644 --- a/reports/actions/Mint Block Rewards.html +++ b/reports/actions/Mint Block Rewards.html @@ -513,30 +513,30 @@ -

State

Local States

Spaces

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
relay_chain: Relay Chain,
height: Block Height}

Validator Block Reward Space

{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

Policies

Block Reward Policy Aggregate

The aggregate policy for creating the total amount of block reward and also splitting it between different groups. +

State

Local States

Spaces

Burn POKT Mechanism Space

{burn_amount: uPOKT}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
service: Service,
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

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/actions/Servicer Pause.html b/reports/actions/Servicer Pause.html index ba1dc41..7d63308 100644 --- a/reports/actions/Servicer Pause.html +++ b/reports/actions/Servicer Pause.html @@ -202,7 +202,7 @@

State

Local States

Servicer State

-
Type Symbol Domain
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType

Fisherman State

+
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Fisherman State

diff --git a/reports/actions/Servicer Stake.html b/reports/actions/Servicer Stake.html index ba1d17c..9acdf3a 100644 --- a/reports/actions/Servicer Stake.html +++ b/reports/actions/Servicer Stake.html @@ -10,15 +10,15 @@ - + viewBox="0.00 0.00 1319.33 634.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> Servicer Stake - + @@ -26,11 +26,11 @@ Servicer - + - + -Servicer +Servicer @@ -40,9 +40,9 @@ Servicer Stake - + -Servicer Stake +Servicer Stake @@ -52,9 +52,9 @@ Servicer->Servicer Stake - + - + @@ -64,9 +64,9 @@ Servicer Stake Policy - + -Servicer Stake Policy +Servicer Stake Policy @@ -76,13 +76,13 @@ Servicer Stake->Servicer Stake Policy - + - + -Servicer +Servicer -Stake Space +Stake Space @@ -92,9 +92,9 @@ Set Servicer Parameters Policy - + -Set Servicer Parameters Policy +Set Servicer Parameters Policy @@ -104,13 +104,13 @@ Servicer Stake Policy->Set Servicer Parameters Policy - + - + -Servicer +Servicer -Stake Space +Stake Space @@ -120,9 +120,9 @@ Modify Servicer POKT Holdings - + -Modify Servicer POKT Holdings +Modify Servicer POKT Holdings @@ -132,15 +132,15 @@ Servicer Stake Policy->Modify Servicer POKT Holdings - + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space @@ -150,9 +150,9 @@ Modify Servicer Stake - + -Modify Servicer Stake +Modify Servicer Stake @@ -162,15 +162,15 @@ Servicer Stake Policy->Modify Servicer Stake - + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space @@ -192,15 +192,15 @@ Set Servicer Parameters Policy->Prune Servicer QoS - + - + -Servicer +Servicer -Param Update +Param Update -Space +Space @@ -210,9 +210,9 @@ Update Servicer Params - + -Update Servicer Params +Update Servicer Params @@ -222,15 +222,15 @@ Set Servicer Parameters Policy->Update Servicer Params - + - + -Servicer +Servicer -Param Update +Param Update -Space +Space @@ -240,9 +240,9 @@ Servicer.POKT Holdings - + -Servicer.POKT Holdings +Servicer.POKT Holdings @@ -252,9 +252,9 @@ Modify Servicer POKT Holdings->Servicer.POKT Holdings - + - + @@ -264,9 +264,9 @@ Servicer.Staked POKT - + -Servicer.Staked POKT +Servicer.Staked POKT @@ -276,9 +276,9 @@ Modify Servicer Stake->Servicer.Staked POKT - + - + @@ -348,33 +348,33 @@ Update Servicer Params->Servicer.Service URL - + - + - + -Servicer.Relay Chains +Servicer.Services - + -Servicer.Relay Chains +Servicer.Services - + -Update Servicer Params->Servicer.Relay Chains +Update Servicer Params->Servicer.Services - + - + @@ -384,9 +384,9 @@ Servicer.GeoZone - + -Servicer.GeoZone +Servicer.GeoZone @@ -396,9 +396,9 @@ Update Servicer Params->Servicer.GeoZone - + - + @@ -408,9 +408,9 @@ Servicer.Operator Public Key - + -Servicer.Operator Public Key +Servicer.Operator Public Key @@ -420,9 +420,9 @@ Update Servicer Params->Servicer.Operator Public Key - + - + @@ -432,11 +432,11 @@ Servicer_2 - + - + -Servicer +Servicer @@ -446,9 +446,9 @@ Servicer.POKT Holdings->Servicer_2 - + - + @@ -458,9 +458,9 @@ Servicer.Staked POKT->Servicer_2 - + - + @@ -470,9 +470,9 @@ Servicer.Report Card->Servicer_2 - + - + @@ -482,9 +482,9 @@ Servicer.Test Scores->Servicer_2 - + - + @@ -494,21 +494,21 @@ Servicer.Service URL->Servicer_2 - + - + - + -Servicer.Relay Chains->Servicer_2 +Servicer.Services->Servicer_2 - + - + @@ -518,9 +518,9 @@ Servicer.GeoZone->Servicer_2 - + - + @@ -530,9 +530,9 @@ Servicer.Operator Public Key->Servicer_2 - + - + @@ -546,7 +546,7 @@

State

Local States

Servicer State

Name Description
-
Type Symbol Domain
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType

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}

Servicer Param Update Space

{public_key: Public Key,
service_url: Service URL,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
operator_public_key: Public Key}

Modify Servicer POKT Space

{public_key: Public Key,
amount: uPOKT}

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.

Called By:

+ Public keyThe identifier of the nodePublic KeyServicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKTReport CardThe 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 CardTest ScoresThe QoS test scoresService Test ScoresPOKT HoldingsThe personal holdings of the servicer in uPOKTuPOKTStaked POKTThe amount that is staked by the servicer currently in uPOKTuPOKTService URLThe API endpoint where the Web3 service is providedService URLServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]GeoZoneThe 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.GeoZoneOperator Public KeyOPTIONAL; The non-custodial pubKey operating this nodePublic KeyPause HeightThe height for which a servicer has been paused atBlock HeightStake StatusThe status of staking for the actorStakeStatusTypeUnstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Spaces

Servicer Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL,
services: List[Service],
geo_zone: GeoZone,
operator_public_key: Public Key}

Modify Servicer POKT Space

{public_key: Public Key,
amount: uPOKT}

Servicer Param Update Space

{public_key: Public Key,
service_url: Service URL,
services: List[Service],
geo_zone: GeoZone,
operator_public_key: Public Key}

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.

Called By:

1. Servicer

Constraints:

Policies

Servicer Stake Policy

Policy which takes care of actions to occur after a servicer attempts to stake

Preceded By:

1. Servicer Stake

Domain Spaces:

@@ -555,9 +555,9 @@

Policies

Servicer Stake Policy

Policy which takes care of act

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 -

5. LEN(DOMAIN[0].relay_chains) <= PARAMS.max_chains_servicer +

3. LEN(DOMAIN[0].services) > 0 +

4. All chains in DOMAIN[0].services must be valid +

5. LEN(DOMAIN[0].services) <= PARAMS.max_chains_servicer

Set Servicer Parameters Policy

Policy for determining the impact of servicer parameter changes

Preceded By:

1. Servicer Stake Policy

Domain Spaces:

1. Servicer Stake Space

Followed By:

@@ -582,6 +582,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

max_chains_servicer

minimum_stake_servicer

\ 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

minimum_stake_servicer

max_chains_servicer

\ No newline at end of file diff --git a/reports/actions/Servicer Unstake.html b/reports/actions/Servicer Unstake.html new file mode 100644 index 0000000..3a01bcc --- /dev/null +++ b/reports/actions/Servicer Unstake.html @@ -0,0 +1,229 @@ +

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

Action Map

+ + + + + + + + + + + +Servicer Unstake + + + + + + + +Servicer + + + + + +Servicer + + + + + + + +Servicer Unstake + + + +Servicer Unstake + + + + + + + +Servicer->Servicer Unstake + + + + + + + + + + + +Servicer Unstake Policy + + + +Servicer Unstake Policy + + + + + + + +Servicer Unstake->Servicer Unstake Policy + + + + + +Servicer + +Unstake + +Space + + + + + + + +Update Servicer Stake Status + + + +Update Servicer Stake Status + + + + + + + +Servicer Unstake Policy->Update Servicer Stake Status + + + + + +Servicer + +Stake Status + +Space + + + + + + + +Servicer.Stake Status + + + +Servicer.Stake Status + + + + + + + +Update Servicer Stake Status->Servicer.Stake Status + + + + + + + + + + + +Servicer.Unstaking Height + + + +Servicer.Unstaking Height + + + + + + + +Update Servicer Stake Status->Servicer.Unstaking Height + + + + + + + + + + + +Servicer_2 + + + + + +Servicer + + + + + + + +Servicer.Stake Status->Servicer_2 + + + + + + + + + + + +Servicer.Unstaking Height->Servicer_2 + + + + + + + + + + +

State

Local States

Servicer State

+ + + + + + +
NameDescriptionTypeSymbolDomain
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Spaces

Servicer Stake Status Space

{address: Public Key,
height: Block Height,
status: StakeStatusType}

Servicer Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Behavioral Action Space

Servicer Unstake

The action of unstaking from the network for a servicer

Called By:

+

1. Servicer

Constraints:

+

Policies

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:

+

Mechanisms

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.

Parameters

\ No newline at end of file diff --git a/reports/entities/Application.html b/reports/entities/Application.html index 2e19575..4db3d83 100644 --- a/reports/entities/Application.html +++ b/reports/entities/Application.html @@ -10,173 +10,173 @@ - + viewBox="0.00 0.00 1548.00 667.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Application - + - + -Application +Portal - + - + -Application +Portal - + - + -Application Undelegation +Submit Relay Request - + -Application Undelegation +Submit Relay Request - + - + -Application->Application Undelegation +Portal->Submit Relay Request - + - + - - - - -Submit Relay Request - - - -Submit Relay Request - - + - + - +Application -Application->Submit Relay Request + - + - +Application - + Application Stake - + -Application Stake +Application Stake - + Application->Application Stake - + - + - + Application Unstake - + -Application Unstake +Application Unstake - + Application->Application Unstake - + - + - + Application Delegate to Portal - + -Application Delegate to Portal +Application Delegate to Portal - + Application->Application Delegate to Portal - + - + - + - + -Portal +Application Undelegation + + + +Application Undelegation + + + + - + + +Application->Application Undelegation - + -Portal + - + - + -Portal->Submit Relay Request +Application->Submit Relay Request - + - + @@ -186,397 +186,559 @@ Application Stake Policy - + -Application Stake Policy +Application Stake Policy - + Application Stake->Application Stake Policy - + - + -Application +Application -Stake Space +Stake Space - + +Application Unstake Policy + + + +Application Unstake Policy + + + + + + + +Application Unstake->Application Unstake Policy + + + + + +Application + +Unstake + +Space + + + + + + + Application Delegate to Portal Policy - + -Application Delegate to Portal Policy +Application Delegate to Portal Policy - + Application Delegate to Portal->Application Delegate to Portal Policy - + + + - +Application + +Delegate to + +Portal Space + + + + + + -Application +Submit Relay Request Policy -Delegate to + -Portal Space +Submit Relay Request Policy + + + + + + + +Submit Relay Request->Submit Relay Request Policy + + + + + +Submit Relay + +Request + +Space - + Set Application Parameters Policy - + -Set Application Parameters Policy +Set Application Parameters Policy - + Application Stake Policy->Set Application Parameters Policy - + - + -Application +Application -Stake Space +Stake Space - + Modify Application POKT Holdings - + -Modify Application POKT Holdings +Modify Application POKT Holdings - + Application Stake Policy->Modify Application POKT Holdings - + - + -Modify +Modify -Application +Application -POKT Space +POKT Space - + Modify Application Stake - + -Modify Application Stake +Modify Application Stake - + Application Stake Policy->Modify Application Stake - + + + + +Modify + +Application + +POKT Space - + + + + + -Modify +Update Application Stake Status -Application + -POKT Space +Update Application Stake Status + + + + + + + +Application Unstake Policy->Update Application Stake Status + + + + + +Application + +Stake Status + +Space - + Update Application Params - + -Update Application Params +Update Application Params - + Set Application Parameters Policy->Update Application Params - + - + -Application +Application -Param Update +Param Update -Space +Space - + Application.POKT Holdings - + -Application.POKT Holdings +Application.POKT Holdings - + Modify Application POKT Holdings->Application.POKT Holdings - + - + - + Application.Staked POKT - + -Application.Staked POKT +Application.Staked POKT - + Modify Application Stake->Application.Staked POKT - + - + - + - + -Application.Relay Chains +Application.Stake Status - + -Application.Relay Chains +Application.Stake Status - + - + -Update Application Params->Application.Relay Chains +Update Application Stake Status->Application.Stake Status - + - + + + + + + + + +Application.Unstaking Height + + + +Application.Unstaking Height + + + + + + + +Update Application Stake Status->Application.Unstaking Height + + + + + + + + + + + +Application.Services + + + +Application.Services + + + + + + + +Update Application Params->Application.Services + + + + - + Application.GeoZone - + -Application.GeoZone +Application.GeoZone - + Update Application Params->Application.GeoZone - + - + - + Application.Number of Servicers - + -Application.Number of Servicers +Application.Number of Servicers - + Update Application Params->Application.Number of Servicers - + - + - + Application_2 - + - + -Application +Application - + Application.POKT Holdings->Application_2 - + - + - + Application.Staked POKT->Application_2 - + - + - + - + + +Application.Stake Status->Application_2 + + + + + + + + -Application.Relay Chains->Application_2 + - +Application.Unstaking Height->Application_2 - + + + + + + + + + + +Application.Services->Application_2 + + + + - + Application.GeoZone->Application_2 - + - + - + Application.Number of Servicers->Application_2 - + - + -

State

Local States

Portal State

+

State

Local States

Application State

-
Name Description Type Symbol Domain
Stake StatusThe status of staking for the actorStakeStatusType

Application State

+
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Portal State

-
Name Description Type Symbol Domain
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType

Spaces

Application Param Update Space

{public_key: Public Key,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
number_servicers: int}

Modify Application POKT Space

{public_key: Public Key,
amount: uPOKT}

Submit Relay Request Space

{payload: dict,
meta: dict,
proof: dict,
application_address: Public Key}

Application Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
number_servicers: int}

Application Undelegation Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Application Delegate to Portal Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Application Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Behavioral Action Space

Application Undelegation

If a staked Application wants to stop using a Portal, and prevent the Portal from further signing relays on its behalf, it would simply submit an on-chain UndelegateMsg. Further relays signed by the Portal on behalf of the Application would be rejected by the Servicers.

Called By:

-

1. Application

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:

-

Application Stake

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...).

Called By:

+ Stake StatusThe status of staking for the actorStakeStatusType

Spaces

Modify Application POKT Space

{public_key: Public Key,
amount: uPOKT}

Submit Relay Request Space

{payload: dict,
meta: dict,
proof: dict,
application_address: Public Key}

Application Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
services: List[Service],
geo_zone: GeoZone,
number_servicers: int}

Application Undelegation Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Application Delegate to Portal Space

{application_public_key: Public Key,
portal_public_key: Public Key}

Application Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Application Param Update Space

{public_key: Public Key,
services: List[Service],
geo_zone: GeoZone,
number_servicers: int}

Behavioral Action Space

Application Stake

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...).

Called By:

1. Application

Constraints:

Application Unstake

The action of unstaking from the network for an application

Called By:

1. Application

Constraints:

Application Delegate to Portal

An action where the application delegates to a portal to control their on-chain actions

Called By:

1. Application

Constraints:

+

Application Undelegation

If a staked Application wants to stop using a Portal, and prevent the Portal from further signing relays on its behalf, it would simply submit an on-chain UndelegateMsg. Further relays signed by the Portal on behalf of the Application would be rejected by the Servicers.

Called By:

+

1. Application

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 Service

Called By:

+

1. Application

2. Portal

Constraints:

Policies

Application Stake Policy

The policy which takes care of whether an application can stake and if it should update parameters.

Preceded By:

1. Application Stake

Domain Spaces:

1. Application Stake Space

Followed By:

@@ -584,16 +746,31 @@

Policies

Application Stake Policy

The policy which takes care

1. Application Stake Space

2. Modify Application POKT Space

3. Modify Application 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 +

3. LEN(DOMAIN[0].services) > 0 +

4. All chains in DOMAIN[0].services must be valid

5. DOMAIN[0].number_servicers >= PARAMS.MinServicersPerSession

6. DOMAIN[0].number_servicers <= PARAMS.MaxServicersPerSession -

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:

+

Application Unstake Policy

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 @@ -

State

Local States

Spaces

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
relay_chain: Relay Chain,
height: Block Height}

Validator Block Reward Space

{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

Policies

Block Reward Policy Aggregate

The aggregate policy for creating the total amount of block reward and also splitting it between different groups. +

State

Local States

Spaces

Burn POKT Mechanism Space

{burn_amount: uPOKT}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
service: Service,
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

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 keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType

Fisherman State

+
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Fisherman State

diff --git a/reports/entities/Portal.html b/reports/entities/Portal.html index 4e5ed23..974f862 100644 --- a/reports/entities/Portal.html +++ b/reports/entities/Portal.html @@ -12,236 +12,276 @@ + viewBox="0.00 0.00 1139.69 234.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> Portal - + - + -Application +Portal - + - + -Application +Portal - + Submit Relay Request - + -Submit Relay Request +Submit Relay Request - - - - -Application->Submit Relay Request - - - - - - - - - - + -Portal + - +Portal->Submit Relay Request - + -Portal + - + Portal Unregistration - + -Portal Unregistration +Portal Unregistration - + Portal->Portal Unregistration - + - + - + Submit Relay Request (Portal) - + -Submit Relay Request (Portal) +Submit Relay Request (Portal) - + Portal->Submit Relay Request (Portal) - + - + - + Portal Registration - + -Portal Registration +Portal Registration - + Portal->Portal Registration - + - + - + - + -Portal->Submit Relay Request +Application + + - + - +Application - + + + + +Application->Submit Relay Request + + + + + + + + +Submit Relay Request Policy + + + +Submit Relay Request Policy + + + + + + + +Submit Relay Request->Submit Relay Request Policy + + + + + +Submit Relay + +Request + +Space + + + + + + + Submit Relay Request (Portal) Policy - + -Submit Relay Request (Portal) Policy +Submit Relay Request (Portal) Policy - + Submit Relay Request (Portal)->Submit Relay Request (Portal) Policy - + - + -Portal Relay +Portal Relay -Request +Request -Space +Space - + Portal Registration Policy - + -Portal Registration Policy +Portal Registration Policy - + Portal Registration->Portal Registration Policy - + - + -Portal +Portal -Registration +Registration -Space +Space -

State

Local States

Portal State

Name Description
+

State

Local States

Application State

-
Name Description Type Symbol Domain
Stake StatusThe status of staking for the actorStakeStatusType

Application State

+
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Portal State

-
Name Description Type Symbol Domain
Public keyThe identifier of the applicationPublic Key
POKT HoldingsThe personal holdings of the application in uPOKTuPOKT
Staked POKTThe staked amount of the application in uPOKTuPOKT
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe physical geo-location identifier this Servicer registered inGeoZone
Number of ServicersThe number of servicers an application would prefer, if available, for a session.int
Stake StatusThe status of staking for the actorStakeStatusType

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 StatusThe status of staking for the actorStakeStatusType

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

Preceded By:

1. Submit Relay Request (Portal)

Domain Spaces:

1. Portal Relay Request Space

Followed By:

Codomain Spaces:

@@ -251,4 +291,4 @@

Portal Registration Policy

Policy which handles the logic of portal r

1. Portal Registration Space

Followed By:

Codomain Spaces:

Constraints:

-

Mechanisms

Parameters

maturity_relay_charge

gateway_bootstrap_unwind_end

min_bootstrap_gateway_fee_per_relay

gateway_bootstrap_unwind_start

maturity_relay_cost

portal_minimum_stake

\ No newline at end of file +

Mechanisms

Parameters

maturity_relay_cost

gateway_bootstrap_unwind_end

portal_minimum_stake

gateway_bootstrap_unwind_start

session_token_bucket_coefficient

min_bootstrap_gateway_fee_per_relay

maturity_relay_charge

\ No newline at end of file diff --git a/reports/entities/Relay Chain.html b/reports/entities/Relay Chain.html index c5efa57..1bfc20b 100644 --- a/reports/entities/Relay Chain.html +++ b/reports/entities/Relay Chain.html @@ -8,7 +8,7 @@ --> - + -Relay Chain +Service - + -Relay Chain +Service -Relay Chain +Service - + -Relay Chain Join +Service Join -Relay Chain Join +Service Join - + -Relay Chain->Relay Chain Join +Service->Service Join @@ -58,23 +58,23 @@ - + -Relay Chain Leave +Service Leave -Relay Chain Leave +Service Leave - + -Relay Chain->Relay Chain Leave +Service->Service Leave @@ -85,15 +85,15 @@ -

State

Local States

Relay Chain State

+

State

Local States

Service State

-
Name Description Type Symbol Domain
NameThe name of the relay chainstr
Portal API PrefixPrefix for the portal APIstr
Relay Chain IDThe identifier used for the chainstr

Spaces

Relay Chain Join Space

{name: str,
portal_api_prefix: str,
relay_chain_id: str}

Relay Chain Leave Space

{relay_chain_id: str}

Behavioral Action Space

Relay Chain Join

Action for relay chain moving to be added to the system.

Called By:

-

1. Relay Chain

Constraints:

-

Relay Chain Leave

Action for relay chain moving to leave the system.

Called By:

-

1. Relay Chain

Constraints:

+ NameThe name of the ServicestrPortal API PrefixPrefix for the portal APIstrService IDThe identifier used for the chainstr

Spaces

Service Join Space

{name: str,
portal_api_prefix: str,
service_id: str}

Service Leave Space

{service_id: str}

Behavioral Action Space

Service Join

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

Action Map

+ + + + + + + + + + + +Service + + + + + + + +Service + + + + + +Service + + + + + + + +Service Leave + + + +Service Leave + + + + + + + +Service->Service Leave + + + + + + + + + + + +Service Join + + + +Service Join + + + + + + + +Service->Service Join + + + + + + + + + + +

State

Local States

Service State

+ + + + + + +
NameDescriptionTypeSymbolDomain
NameThe name of the servicestr
Portal API PrefixPrefix for the portal APIstr
Service IDThe identifier used for the chainstr

Spaces

Service Leave Space

{service_id: str}

Service Join Space

{name: str,
portal_api_prefix: str,
service_id: str}

Behavioral Action Space

Service Leave

Action for Service moving to leave the system.

Called By:

+

1. Service

Constraints:

+

Service Join

Action for Service moving to be added to the system.

Called By:

+

1. Service

Constraints:

+

Policies

Mechanisms

Parameters

\ No newline at end of file diff --git a/reports/entities/Servicer.html b/reports/entities/Servicer.html index 2487d37..d5c6714 100644 --- a/reports/entities/Servicer.html +++ b/reports/entities/Servicer.html @@ -10,15 +10,15 @@ - + viewBox="0.00 0.00 3153.98 711.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Servicer - + @@ -26,155 +26,155 @@ Servicer - + - + -Servicer +Servicer - + -Servicer Stake +Servicer Unpause - + -Servicer Stake +Servicer Unpause - + -Servicer->Servicer Stake +Servicer->Servicer Unpause - + - + - + -Servicer Relay +Servicer Unstake - + -Servicer Relay +Servicer Unstake - + -Servicer->Servicer Relay +Servicer->Servicer Unstake - + - + - + -Servicer Pause +Unjail Node - + -Servicer Pause +Unjail Node - + -Servicer->Servicer Pause +Servicer->Unjail Node - + - + - + -Servicer Unpause +Servicer Stake - + -Servicer Unpause +Servicer Stake - + - + -Servicer->Servicer Unpause +Servicer->Servicer Stake - + - + - + -Unjail Node +Servicer Relay - + -Unjail Node +Servicer Relay - + - + -Servicer->Unjail Node +Servicer->Servicer Relay - + - + - + -Servicer Unstake +Servicer Pause - + -Servicer Unstake +Servicer Pause - + - + -Servicer->Servicer Unstake +Servicer->Servicer Pause - + - + @@ -184,23 +184,23 @@ Validator - + - + -Validator +Validator - + Validator->Unjail Node - + - + @@ -210,203 +210,191 @@ Fisherman - + - + -Fisherman +Fisherman - + Fisherman->Servicer Pause - + - + - + - + -Servicer Stake Policy +Servicer Unpause Policy - + -Servicer Stake Policy +Servicer Unpause Policy - + -Servicer Stake->Servicer Stake Policy +Servicer Unpause->Servicer Unpause Policy - + - + -Servicer +Servicer -Stake Space +Unpause + +Space - + - + -Servicer Relay Policy +Servicer Unstake Policy - + -Servicer Relay Policy +Servicer Unstake Policy - + -Servicer Relay->Servicer Relay Policy +Servicer Unstake->Servicer Unstake Policy + + - + - +Servicer -Servicer +Unstake -Relay Space +Space - + -Servicer Pause Policy +Servicer Stake Policy - + -Servicer Pause Policy +Servicer Stake Policy - + - + -Servicer Pause->Servicer Pause Policy +Servicer Stake->Servicer Stake Policy - + - + -Servicer +Servicer -Pause Space +Stake Space - + -Servicer Unpause Policy +Servicer Relay Policy - + -Servicer Unpause Policy +Servicer Relay Policy - - - - -Servicer Unpause->Servicer Unpause Policy - - - - - -Servicer - -Unpause - -Space + - + - +Servicer Relay->Servicer Relay Policy - + -Servicer Block Reward + - +Servicer -Servicer Block Reward +Relay Space - + - + -Servicer Block Reward Policy +Servicer Pause Policy - + -Servicer Block Reward Policy +Servicer Pause Policy - + -Servicer Block Reward->Servicer Block Reward Policy - - +Servicer Pause->Servicer Pause Policy - + -Servicer + -Block Reward +Servicer -Space +Pause Space - + Mint Block Rewards - + -Mint Block Rewards +Mint Block Rewards - + Block Reward Policy Aggregate - + -Block Reward Policy Aggregate +Block Reward Policy Aggregate @@ -416,1035 +404,1196 @@ Mint Block Rewards->Block Reward Policy Aggregate - + - + -Mint Block +Mint Block -Rewards +Rewards -Space +Space - + - + -Modify Servicer POKT Holdings +Servicer Block Reward - + -Modify Servicer POKT Holdings +Servicer Block Reward - + + + + +Servicer Block Reward Policy + + + +Servicer Block Reward Policy + + + + -Servicer Block Reward Policy->Modify Servicer POKT Holdings +Servicer Block Reward->Servicer Block Reward Policy - + - + -Modify +Servicer -Servicer +Block Reward -POKT Space +Space - + -Mint POKT Mechanism +Servicer Unpause Mechanism - + -Mint POKT Mechanism +Servicer Unpause Mechanism - + -Servicer Block Reward Policy->Mint POKT Mechanism +Servicer Unpause Policy->Servicer Unpause Mechanism - + - + -Mint POKT +Servicer -Mechanism +Unpause -Space +Space 2 + + + + + + + +Update Servicer Stake Status + + + +Update Servicer Stake Status + + + + + + + +Servicer Unstake Policy->Update Servicer Stake Status + + + + + +Servicer + +Stake Status + +Space - + Assign Servicer Salary Policy - + -Assign Servicer Salary Policy +Assign Servicer Salary Policy - + Block Reward Policy Aggregate->Assign Servicer Salary Policy - + - + -Assign +Assign -Servicer +Servicer -Salary Space +Salary Space - + Validator Block Reward Policy - + -Validator Block Reward Policy +Validator Block Reward Policy - + Block Reward Policy Aggregate->Validator Block Reward Policy - + - + -Validator +Validator -Block Reward +Block Reward -Space +Space - + DAO Block Reward Policy - + -DAO Block Reward Policy +DAO Block Reward Policy - + Block Reward Policy Aggregate->DAO Block Reward Policy - + + + + +DAO Block + +Reward Space - + + + + + + +Mint POKT Mechanism -DAO Block + -Reward Space +Mint POKT Mechanism - + Block Reward Policy Aggregate->Mint POKT Mechanism - + - + -Mint POKT +Mint POKT -Mechanism +Mechanism -Space +Space - + - + -Set Servicer Parameters Policy +Servicer Block Reward Policy->Mint POKT Mechanism - + -Set Servicer Parameters Policy + - +Mint POKT - +Mechanism - +Space -Servicer Stake Policy->Set Servicer Parameters Policy + - + + + - +Modify Servicer POKT Holdings -Servicer + -Stake Space +Modify Servicer POKT Holdings - + -Servicer Stake Policy->Modify Servicer POKT Holdings +Servicer Block Reward Policy->Modify Servicer POKT Holdings - + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space - + - + -Modify Servicer Stake +Set Servicer Parameters Policy - + -Modify Servicer Stake +Set Servicer Parameters Policy - + - + -Servicer Stake Policy->Modify Servicer Stake +Servicer Stake Policy->Set Servicer Parameters Policy + + + + + +Servicer + +Stake Space + + - + + + + +Servicer Stake Policy->Modify Servicer POKT Holdings + + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space - + - + -Servicer Update Pause Height +Modify Servicer Stake - + -Servicer Update Pause Height +Modify Servicer Stake - + - + -Servicer Pause Policy->Servicer Update Pause Height +Servicer Stake Policy->Modify Servicer Stake - + - + -Servicer +Modify -Pause Space +Servicer -2 +POKT Space - + - + -Servicer Unpause Mechanism +Servicer Update Pause Height - + -Servicer Unpause Mechanism +Servicer Update Pause Height - + - + -Servicer Unpause Policy->Servicer Unpause Mechanism +Servicer Pause Policy->Servicer Update Pause Height - + - + -Servicer +Servicer -Unpause +Pause Space -Space 2 +2 - + Assign Servicer Salary Policy->Modify Servicer POKT Holdings - + - + -Modify +Modify -Servicer +Servicer -POKT Space +POKT Space - + Burn POKT Mechanism - + -Burn POKT Mechanism +Burn POKT Mechanism - + Assign Servicer Salary Policy->Burn POKT Mechanism - + - + -Burn POKT +Burn POKT -Mechanism +Mechanism -Space +Space - + Modify Validator POKT Holdings - + -Modify Validator POKT Holdings +Modify Validator POKT Holdings - + Validator Block Reward Policy->Modify Validator POKT Holdings - + - + -Modify +Modify -Validator +Validator -POKT Space +POKT Space - + Modify DAO POKT Holdings - + -Modify DAO POKT Holdings +Modify DAO POKT Holdings - + DAO Block Reward Policy->Modify DAO POKT Holdings - + - + -Modify DAO +Modify DAO -POKT Space +POKT Space - + Prune Servicer QoS - + -Prune Servicer QoS +Prune Servicer QoS - + Set Servicer Parameters Policy->Prune Servicer QoS - + - + -Servicer +Servicer -Param Update +Param Update -Space +Space - + Update Servicer Params - + -Update Servicer Params +Update Servicer Params - + Set Servicer Parameters Policy->Update Servicer Params - + - + -Servicer +Servicer -Param Update +Param Update -Space +Space - + - + -Servicer.POKT Holdings +Servicer.Pause Height - + -Servicer.POKT Holdings +Servicer.Pause Height - + - + -Modify Servicer POKT Holdings->Servicer.POKT Holdings +Servicer Unpause Mechanism->Servicer.Pause Height + + + + + + + + + + + +Servicer.Stake Status + + + +Servicer.Stake Status + + - + - + + +Update Servicer Stake Status->Servicer.Stake Status + + + + + + + + + + + +Servicer.Unstaking Height + + + +Servicer.Unstaking Height + + + + + + + +Update Servicer Stake Status->Servicer.Unstaking Height + + + + - + Treasury.Floating Supply - + -Treasury.Floating Supply +Treasury.Floating Supply - + Mint POKT Mechanism->Treasury.Floating Supply - + - + - + - + -Servicer.Staked POKT +Servicer.POKT Holdings - + -Servicer.Staked POKT +Servicer.POKT Holdings - + - + -Modify Servicer Stake->Servicer.Staked POKT +Modify Servicer POKT Holdings->Servicer.POKT Holdings - + - + - + - + -Servicer.Pause Height +Servicer.Staked POKT - + -Servicer.Pause Height +Servicer.Staked POKT - + - + -Servicer Update Pause Height->Servicer.Pause Height +Modify Servicer Stake->Servicer.Staked POKT - + - + - + - + -Servicer Unpause Mechanism->Servicer.Pause Height +Servicer Update Pause Height->Servicer.Pause Height - + - + - + Burn POKT Mechanism->Treasury.Floating Supply - + - + - + Validator.POKT Holdings - + -Validator.POKT Holdings +Validator.POKT Holdings - + Modify Validator POKT Holdings->Validator.POKT Holdings - + - + - + DAO.POKT Holdings - + -DAO.POKT Holdings +DAO.POKT Holdings - + Modify DAO POKT Holdings->DAO.POKT Holdings - + - + - + Servicer.Report Card - + -Servicer.Report Card +Servicer.Report Card - + Prune Servicer QoS->Servicer.Report Card - + - + - + Servicer.Test Scores - + -Servicer.Test Scores +Servicer.Test Scores - + Prune Servicer QoS->Servicer.Test Scores - + - + - + Servicer.Service URL - + -Servicer.Service URL +Servicer.Service URL - + Update Servicer Params->Servicer.Service URL - + - + - + - + -Servicer.Relay Chains +Servicer.Services - + -Servicer.Relay Chains +Servicer.Services - + - + -Update Servicer Params->Servicer.Relay Chains +Update Servicer Params->Servicer.Services - + - + - + Servicer.GeoZone - + -Servicer.GeoZone +Servicer.GeoZone - + Update Servicer Params->Servicer.GeoZone - + - + - + Servicer.Operator Public Key - + -Servicer.Operator Public Key +Servicer.Operator Public Key - + Update Servicer Params->Servicer.Operator Public Key - + - + - + Servicer_2 - + - + -Servicer +Servicer - + Treasury_2 - + - + -Treasury +Treasury - + Validator_2 - + - + -Validator +Validator - + DAO_2 - + - + -DAO +DAO - + - + -Servicer.POKT Holdings->Servicer_2 +Servicer.Pause Height->Servicer_2 + + + + + + + + + + + +Servicer.Stake Status->Servicer_2 + + - + - + + + + + + +Servicer.Unstaking Height->Servicer_2 + + + + - + Treasury.Floating Supply->Treasury_2 - + - + - + - + -Servicer.Staked POKT->Servicer_2 +Servicer.POKT Holdings->Servicer_2 - + - + - + - + -Servicer.Pause Height->Servicer_2 +Servicer.Staked POKT->Servicer_2 - + - + - + Validator.POKT Holdings->Validator_2 - + - + - + DAO.POKT Holdings->DAO_2 - + - + - + Servicer.Report Card->Servicer_2 - + - + - + Servicer.Test Scores->Servicer_2 - + - + - + Servicer.Service URL->Servicer_2 - + - + - + - + -Servicer.Relay Chains->Servicer_2 +Servicer.Services->Servicer_2 - + - + - + Servicer.GeoZone->Servicer_2 - + - + - + Servicer.Operator Public Key->Servicer_2 - + - + -

State

Local States

Servicer State

+

State

Local States

Validator State

-
Name Description Type Symbol Domain
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType

Validator State

+
Public keyThe identifier of the validatorPublic Key
POKT HoldingsThe personal holdings of the validator in uPOKTuPOKT
Staked POKTThe staked amount of the validator in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Operator Public KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Stake StatusThe status of staking for the actorStakeStatusType

Servicer State

-
Name Description Type Symbol Domain
Public keyThe identifier of the validatorPublic Key
POKT HoldingsThe personal holdings of the validator in uPOKTuPOKT
Staked POKTThe staked amount of the validator in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Operator Public KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Stake StatusThe status of staking for the actorStakeStatusType

Fisherman State

+
Public keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
ServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType
Unstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Fisherman State

-
Name Description Type Symbol Domain
Stake StatusThe status of staking for the actorStakeStatusType

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}

Servicer Unpause Space

{actor_type: ActorType,
address: Address,
signer: Address}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Unjail Node Space

{node_address: Public Key,
block_height: Block Height}

Assign Servicer Salary Space

{geo_zone: GeoZone,
relay_chain: Relay Chain,
height: Block Height}

Servicer Pause Space

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Servicer Param Update Space

{public_key: Public Key,
service_url: Service URL,
relay_chains: List[Relay Chain],
geo_zone: GeoZone,
operator_public_key: Public Key}

Burn POKT Mechanism Space

{burn_amount: uPOKT}

Servicer Pause Space 2

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Relay Space

{}

Mint Block Rewards Space

{current_height: Block Height,
block_producer: Public Key}

Servicer Unpause Space 2

{actor_type: ActorType,
address: Address,
signer: Address,
block_height: Block Height}

Modify Servicer POKT Space

{public_key: Public Key,
amount: uPOKT}

Servicer Block Reward Space

{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.

Called By:

+ Stake StatusThe status of staking for the actorStakeStatusType

Spaces

Servicer Unpause Space

{actor_type: ActorType,
address: Address,
signer: Address}

Mint Block Rewards Space

{current_height: Block Height,
block_producer: Public Key}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Burn POKT Mechanism Space

{burn_amount: uPOKT}

Servicer Param Update Space

{public_key: Public Key,
service_url: Service URL,
services: List[Service],
geo_zone: GeoZone,
operator_public_key: Public Key}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
service: Service,
height: Block Height}

Servicer Unstake Space

{actor_type: ActorType,
address: Address,
signer: Address}

Servicer Relay Space

{servicers: Servicer Group,
applications: Application Entity,
session: Session}

Servicer Pause Space 2

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Unjail Node Space

{node_address: Public Key,
block_height: Block Height}

Servicer Stake Status Space

{address: Public Key,
height: Block Height,
status: StakeStatusType}

Modify Servicer POKT Space

{public_key: Public Key,
amount: uPOKT}

Servicer Pause Space

{actor_type: ActorType,
address: Address,
caller_address: Address,
signer: Address}

Servicer Stake Space

{public_key: Public Key,
stake_amount: uPOKT,
service_url: Service URL,
services: List[Service],
geo_zone: GeoZone,
operator_public_key: Public Key}

Servicer Unpause Space 2

{actor_type: ActorType,
address: Address,
signer: Address,
block_height: Block Height}

Servicer Block Reward Space

{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 -

5. LEN(DOMAIN[0].relay_chains) <= PARAMS.max_chains_servicer +

3. LEN(DOMAIN[0].services) > 0 +

4. All chains in DOMAIN[0].services must be valid +

5. LEN(DOMAIN[0].services) <= PARAMS.max_chains_servicer

Servicer Relay Policy

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 @@

State

Local States

Treasury State

-
Type Symbol Domain
Floating SupplyThe amount of floating supply in the ecosystemuPOKT

Spaces

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
relay_chain: Relay Chain,
height: Block Height}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Burn POKT Space

{burn_amount: uPOKT,
block_height: Block Height}

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}

Servicer Block Reward Space

{public_key: Public Key,
number_of_relays: int,
usage_to_reward_coeffecient: float}

Behavioral Action Space

Burn POKT

Treasury burning supply of POKT

Called By:

+ Floating SupplyThe amount of floating supply in the ecosystemuPOKT

Spaces

Burn POKT Mechanism Space

{burn_amount: uPOKT}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
service: Service,
height: Block Height}

Servicer Block Reward Space

{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 keyThe identifier of the nodePublic Key
Servicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKT
Report CardThe 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 ScoresThe QoS test scoresService Test Scores
POKT HoldingsThe personal holdings of the servicer in uPOKTuPOKT
Staked POKTThe amount that is staked by the servicer currently in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Relay ChainsThe flavor(s) of Web3 hosted by this ServicerList[Relay Chain]
GeoZoneThe 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 KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Pause HeightThe height for which a servicer has been paused atBlock Height
Stake StatusThe status of staking for the actorStakeStatusType

Validator State

+
Public keyThe identifier of the validatorPublic Key
POKT HoldingsThe personal holdings of the validator in uPOKTuPOKT
Staked POKTThe staked amount of the validator in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Operator Public KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Stake StatusThe status of staking for the actorStakeStatusType

Servicer State

-
Name Description Type Symbol Domain
Public keyThe identifier of the validatorPublic Key
POKT HoldingsThe personal holdings of the validator in uPOKTuPOKT
Staked POKTThe staked amount of the validator in uPOKTuPOKT
Service URLThe API endpoint where the Web3 service is providedService URL
Operator Public KeyOPTIONAL; The non-custodial pubKey operating this nodePublic Key
Stake StatusThe status of staking for the actorStakeStatusType

Spaces

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Unjail Node Space

{node_address: Public Key,
block_height: Block Height}

Assign Servicer Salary Space

{geo_zone: GeoZone,
relay_chain: Relay Chain,
height: Block Height}

Validator Block Reward Space

{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 keyThe identifier of the nodePublic KeyServicer SalaryA ServicerSalary is assigned to each individual Servicer based on their specific ReportCard, and is distributed every SalaryBlockFrequencyuPOKTReport CardThe 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 CardTest ScoresThe QoS test scoresService Test ScoresPOKT HoldingsThe personal holdings of the servicer in uPOKTuPOKTStaked POKTThe amount that is staked by the servicer currently in uPOKTuPOKTService URLThe API endpoint where the Web3 service is providedService URLServicesThe flavor(s) of Web3 hosted by this ServicerList[Service]GeoZoneThe 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.GeoZoneOperator Public KeyOPTIONAL; The non-custodial pubKey operating this nodePublic KeyPause HeightThe height for which a servicer has been paused atBlock HeightStake StatusThe status of staking for the actorStakeStatusTypeUnstaking HeightThe height for which a servicer has begun unstaking at or none to represent no unstakingBlock Height

Spaces

Burn POKT Mechanism Space

{burn_amount: uPOKT}

Validator Block Reward Space

{public_key: Public Key,
block_height: Block Height,
reward_amount: uPOKT}

Mint POKT Mechanism Space

{mint_amount: uPOKT}

Assign Servicer Salary Space

{geo_zone: GeoZone,
service: Service,
height: Block Height}

Unjail Node Space

{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