How-To Propose Regional/Geographic Multipliers
This is far from a point-and-click process so my intention is to walk through the process and provide sample commands and sample output that can be used to compare what you do and see. Most of this is already documented so this attempts to show a more fluid way which will hopefully encourage others to take the reins and propose updates regularly or as often as the network requires.
Note: Previously the historical data required to make use of the multiplier_calculator.py
script was provided in a static file. Changes have been made to the Multiplier Calculator script so it now gathers the required data from our servers and can be run weekly or monthly without the need for the team to provide a static historical data file.
I make use of the following resources in this How-To if you wish to get familiar with them before you start.
- Regional Multipliers for MainNet documentation: Regional Multipliers for MainNet - xx network wiki
- Large Democracy Proposal documentation: Large Democracy Proposal - xx network wiki
- multiplier-calculator repository: elixxir / multiplier-calculator · GitLab
- scripts-py repository: GitHub - xx-labs/scripts-py: Examples of interactions with xx network blockchain using python.
1. Calculate New Regional Multipliers
Follow the steps listed in Running the Multiplier Calculator
The terminal commands shown in the wiki and below specify a date range set via --lower-bound
and --upper-bound
. Generally using one month of data to determine multipliers is a good place to start but if you wish to base the multipliers on a specific range, adjust the variables accordingly.
Below the date range of August 01, 2022 through August 31, 2022 is used.
Modify the --lower-bound
and --upper-bound
to generate multipliers using your desired date range.
$ python3 ./multiplier_calculator.py --wallet-country-supplement wcm_2col.csv --lower-bound "2022-08-01 00:00" --upper-bound "2022-08-31 23:59"
Sample output of multiplier_calculator.py
Got 9417 lines
Lower: 2022-08-01 00:04:42.148862 [2022-08-01 00:00:00], Upper: 2022-08-31 23:54:55.528556 [2022-08-31 23:59:00]
Multipliers calculated from 2022-08-01 00:00 to 2022-08-31 23:59
Bin | Multiplier | Avg Mult | Max mult | Bin prob | Avg Nodes/bin | Avg Pts/bin
-------------------------------------------------------------------------------------------------------------------------------------
Oceania | 1.30584 | 1.30584 | 1.30584 | 0.09582 | 7 | 0.76579
SouthernAfrica | 1.27863 | 1.27993 | 1.29289 | 0.03875 | 3 | 0.78129
EasternAsia | 1.24784 | 1.25121 | 1.27853 | 0.13087 | 11 | 0.79923
SouthAndCentralAmerica | 1.21337 | 1.22132 | 1.26358 | 0.08483 | 8 | 0.81879
WesternAsia | 1.12088 | 1.14503 | 1.22543 | 0.09482 | 10 | 0.87334
Russia | 1.09037 | 1.12130 | 1.21357 | 0.31423 | 48 | 0.89182
EasternEurope | 1.05115 | 1.09698 | 1.20141 | 0.18778 | 69 | 0.9116
MiddleEast | 1.04124 | 1.09176 | 1.19880 | 0.00521 | 4 | 0.91595
NorthAmerica | 0.95654 | 1.04739 | 1.17661 | 0.04284 | 70 | 0.95476
CentralEurope | 0.87499 | 1.00641 | 1.15613 | 0.00436 | 44 | 0.99363
WesternEurope | 0.86217 | 1.00000 | 1.15292 | 0.00051 | 79 | 1.0
2. Evaluate Multiplier Values With the Community
There is no guarantee the script will generate perfect multipliers for every bin so at this point you may wish to evaluate these values with the community. I strongly suggest that if you involve the community before submitting the proposal, it will be easier to manage and be a more productive debate and discussion if you conduct it either as …
- a new thread in the xx network Discord # democracy channel.
NOTE: First post to #democracy and then hover over your post and create a thread or it will certainly get lost in discussion. - a new topic in the MainNet category of the xx network Forum.
If you prefer, you can postpone this step until after the proposal has been submitted to the blockchain and it can be held on xx.polkassembly.io.
3. Modify the Multiplier Values
Once you are satisfied with the multiplier values …
3a. Clone the scripts-py repository …
$ git clone https://github.com/xx-labs/scripts-py.git
3b. Change into the scripts-py directory …
$ cd scripts-py/
3c. Open and modify the multiplier values of each bin in the editor of your choice …
$ nano set_cmix_variables.py
Ref: Numeric ID of Bins
ID | Bin |
---|---|
0 | NorthAmerica |
1 | SouthAndCentralAmerica |
2 | WesternEurope |
3 | CentralEurope |
4 | EasternEurope |
5 | MiddleEast |
6 | NorthernAfrica |
7 | SouthernAfrica |
8 | Russia |
9 | EasternAsia |
10 | WesternAsia |
11 | Oceania |
Find the section of the script seen below and modify the values.
##########################
# MODIFY ANY VALUES HERE #
##########################
# Example: set all multipliers to 1 (the multiplier value has 3 decimal places)
variables['performance']['multipliers'] = [
[0, int(0.957*multiplier_decimals)],
[1, int(1.213*multiplier_decimals)],
[2, int(0.862*multiplier_decimals)],
[3, int(0.875*multiplier_decimals)],
[4, int(1.051*multiplier_decimals)],
[5, int(1.041*multiplier_decimals)],
[6, int(1*multiplier_decimals)],
[7, int(1.279*multiplier_decimals)],
[8, int(1.090*multiplier_decimals)],
[9, int(1.248*multiplier_decimals)],
[10, int(1.121*multiplier_decimals)],
[11, int(1.306*multiplier_decimals)],
]
#########################
#########################
#########################
4. Generate and Submit a Preimage
The entire process and more information can already be found at Large Democracy Proposal. I will elaborate on a few key steps.
With the set_cmix_variables.py
modified and saved …
4a. Run the following to generate the encoded democracy.notePreimage call as a hex string …
$ python3 set_cmix_variables.py
Sample output of set_cmix_variables.py
0x0d0e750d1e02e0930400000000000a0000001400000082000000e5034249074d4e09544f0b50570b4d5403435a0345520650460b415100464b01494d02424a06534807434c01564901495205554d00414d055053054852044c4b0a54460b435501424c014e4c0251410550470b434b0b5647014553024145055559014c43015447064e4f034a5009415a054547064748064d5206504b0a544a0a4e460b4149015645015054024d480b425201545a074b5009544d0a4e520b5349034158044c42054854014d500b534e064c520643580b535a074244094754014359045452054e5a0b424d01474d065a5707504d01414f075353074c5307464a0b5553004d51014d4b0457460b4b520941550b534a03494c05445a064652025a41075547074749025641035253044e47074b470a425a01474c015a4d074b48094b490b494f0a424f01534b035541045354074543015359054349064746014d5507484b09544c0b49530242410459450545450456550b4c55024954034d5909464d0b50520141440242590441470149510541460a4741074b5a0a555a0a4d560a43430b4c54044c56044d4106504c03434e094d4f095059015358014154034c41095257075954075347094d5707444f01464f024e45064751075344065041014945024c59064b59015643014e50094b4d074744014a4502534d03434607504501424704534c0653420b4b4e01434407564e09474504435606444a06475901484e014753014251014d45045454014d53014b5705455406425607434100415201435701524507525508535201424e0b444503414c045341054d4c065457094253014e49014d4601504e0b494e0a484d0b4157014257075343074e430b41530b474e064d4d09475001444b034a4f054a4d014d430250480b4752044248054d470742540957530b444d01424502524f0454430149440b544b0b4c4903544406454806485503544e06434d074d5a074242014352015356014246064742024348034f4d054e550b47550b475706534f074e4107434f014747024b45074d58004347075448095345034649044d440454560b3000d20301c304027a03037f0304cc0305440406e80307db0408f60309d9040a8d040b30053075000000000000983a000000000000b80b00000000000005e80300005000000000000000e0930400e8030000005c260500000000
4b. Follow the instructions to Submit the preimage
4c. Follow the instructions to Create the Democracy Proposal
5. Verify a Democracy Proposal
Two methods to verify the proposal are shown in the Verify a Democracy Proposal wiki page. The first, via the xx network wallet, is difficult to review. But the second, using a script is much easier. The following walks you through how to do so using the check_cmix_variables_proposal.py
script.
5a. Be sure you are in the scripts-py
directory you cloned with git …
$ pwd
/path/to/scripts-py
5b. Using the preimage hash obtained in Create the Democracy Proposal - Step 3, open and modify the hash in the editor of your choice …
$ nano check_cmix_variables_proposal.py
Find the section of the script seen below and modify the hash.
#############################
# MODIFY PREIMAGE HASH HERE #
#############################
preimage_hash = '0x4bb101c53c20857f233ab6429bb808ab411b1def18b2cbf2603b1ca1232bdc59'
#############################
#############################
#############################
With the check_cmix_variables_proposal.py
modified and saved …
5c. Run the script and check the values …
$ python3 check_cmix_variables_proposal.py
Sample output of check_cmix_variables_proposal.py
Multiplier for `North America` changing from 1.023 to 0.957
Multiplier for `South and Central America` changing from 1.267 to 1.213
Multiplier for `Western Europe` changing from 0.873 to 0.862
Multiplier for `Central Europe` changing from 0.962 to 0.875
Multiplier for `Eastern Europe` changing from 0.905 to 1.051
Multiplier for `Middle East` changing from 0.899 to 1.041
Multiplier for `Northern Africa` changing from 1.381 to 1.0
Multiplier for `Southern Africa` changing from 1.381 to 1.279
Multiplier for `Russia` changing from 0.944 to 1.090
Multiplier for `Eastern Asia` changing from 1.402 to 1.248
Multiplier for `Western Asia` changing from 1.211 to 1.121
Multiplier for `Oceania` changing from 1.457 to 1.306
6. Find and Announce Your Proposal
Last but not least, once you have submitted your proposal, find it on xx.polkassembly.io. Post the link to official channels such as the xx network Telegram channel and #democracy channel of Discord. Get the word out so validators and nominators can learn about it and understand why and how to vote on it!
I hope this give you confidence to jump in!
Keith