Skip to content

Commit

Permalink
update version graph and selection
Browse files Browse the repository at this point in the history
  • Loading branch information
serinko committed Dec 10, 2024
1 parent f76d6e6 commit a908ab8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
36 changes: 24 additions & 12 deletions documentation/docs/pages/operators/tokenomics/mixnet-rewards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The nodes selection to the active set has a new parameter - `config_score`. Conf
**The `config_score` parameter calculation formula:**

<Callout type="info" emoji="📌">
> **config_score = is_tc_accepted \* is_nym-node_binary \* ( 0.8 ^ ( versions_behind ^ 2 ) )**
> **config_score = is_tc_accepted \* is_nym-node_binary \* ( 0.995 ^ ( ( X * versions_behind) ^ 1.65 ) )**
</Callout>
First two points have binary values of either 0 or 1, with a following logic:
Expand All @@ -180,22 +180,34 @@ From release `2024.14-crunch` (`nym-node v1.2.0`), the `config_score` parameter
one marked as `Latest` in our repository. From that one we count the parameter `version_behind`, where every version back the number of `versions_behind` increases by 1 in this formula:

<Callout type="info" emoji="📌">
> **0.8 ^ ( versions_behind ^ 2 )**
> **0.995 ^ ( ( X * versions_behind ) ^ 1.65 )**
>
> where: <br />
> **X = 1; for patches** <br />
> **X = 10; for minor versions** <br />
> **X = 100; for major versions**
</Callout>
| **Version behind** | **Value** |
| :-- | --: |
| 0 (current version) | 1.0 |
| 1 | 0.8 |
| 2 | 0.4096 |
| 3 | 0.1342 |
| 4 | 0.0281 |
| 5 | 0.0038 |
| 6 | 0.0003 |
> The exact parameters are live accessible on `/v1/status/config-score-details`
Our versioning convention is: `major_version . minor_version . patch`

For example `nym-node` on version `1.2.0` is on 1st major version, 2nd minor and 0 patches. See the the table and graph below:

| **Version behind** | **Patches (X = 1)** | **Minor versions (X = 10)** | **Major versions (X = 100)** |
| :-- | --: | --: | --: |
| 0 (current version) | 1.0 | 1.0 | 1.0 |
| 1 | 0.995 | 0.7994 | 0.0000 |
| 2 | 0.9844 | 0.4953 | 0.0000 |
| 3 | 0.9698 | 0.2536 | 0.0000 |
| 4 | 0.9518 | 0.1102 | 0.0000 |
| 5 | 0.9311 | 0.0413 | 0.0000 |


![](/images/operators/tokenomics/reward_version_graph.png)

As you can see on above, the algorithm is designed to give maximum probability (`1`) to the latest version and exponentialy dicrease the probability to non-upgraded nodes. This eliminates any older nodes despite their saturation and performance to take place in the Rewarded set and gives a priority to the operators running up-to-date nodes, ensuring as strong network as possible.
As you can see on above, the algorithm is designed to give maximum probability (`1`) to the latest version and exponentialy dicrease the probability to non-upgraded nodes where the more important version the node is behind, the faster the cliff. This eliminates any older nodes despite their saturation and performance to take place in the Rewarded set and gives a priority to the operators running up-to-date nodes, ensuring as strong network as possible.


#### Performance Calculation

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 14 additions & 8 deletions documentation/scripts/rewards_version_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@

plt.style.use('dark_background')

a = 0.8
b = 2
a = 0.995
b = 1.65

# make data
x = [0,1,2,3,4,5]
y = [a**(n**b) for n in x]
#x2 = np.linspace(0, 10, 25)
#y2 = 4 + 1 * np.sin(2 * x2)
x1 = [0,1,2,3,4,5]
x2 = x1
x3 = x1
x4 = x1

y1 = [a**((v*1)**b) for v in x1]
y2 = [a**((v*10)**b) for v in x1]
y3 = [a**((v*100)**b) for v in x1]
y4 = [a**((11)**b) for v in x1]

f = plt.figure()
f.set_figwidth(12)
f.set_figheight(9)

# plot
#fig, ax = plt.subplots()
plt.plot(x,y, label=f'version_config_score_multiplier = {a} ^ (version_behind ^ {b})')

plt.plot(x1,y1, label=f'Patches behind: config_score_multiplier = {a} ^ ((1 * versions_behind) ^ {b})')
plt.plot(x2,y2, label=f'Minor versions behind: config_score_multiplier = {a} ^ ((10 * versions_behind) ^ {b})')
plt.plot(x3,y3, label=f'Major versions behind: config_score_multiplier = {a} ^ ((100 * versions_behind) ^ {b})')
#ax.plot(x, y, linewidth=2.0)


Expand Down

0 comments on commit a908ab8

Please sign in to comment.