Skip to content
Snippets Groups Projects
Commit ad5ddf28 authored by Jonah Husson's avatar Jonah Husson
Browse files

Merge branch 'avg-mult' into 'master'

Node multiplier should be average of theirs & max for round

See merge request !2
parents 019d40cf 4e807870
Branches
No related tags found
1 merge request!2Node multiplier should be average of theirs & max for round
......@@ -205,17 +205,19 @@ def round_point_computation(point_info, round_info, active_nodes):
# NOTE: Weirdness can result here from nodes going offline between eras. Should be reviewed.
multipliers = [node_multipliers[bytes(node_id)] for node_id in topology
if node_multipliers.get(bytes(node_id))]
multiplier = max(multipliers)
points = success_points * multiplier
raw_points = success_points
max_multiplier = max(multipliers)
# Assign points to wallets
for node_id in topology:
if node_multipliers.get(bytes(node_id)):
node_mult = (max_multiplier + node_multipliers[bytes(node_id)]) / 2
points = success_points * node_mult
# NOTE: Weirdness can result here from nodes going offline between eras. Should be reviewed.
wallet = node_wallets.get(bytes(node_id))
if wallet:
wallet_points[wallet] += points
raw_points_dict[wallet] += raw_points
raw_points_dict[wallet] += success_points
log.debug(f"Wallet points: {wallet_points}")
return wallet_points, raw_points_dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment