Skip to content

Commit

Permalink
Increase competition incentive (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
HudsonGraeme authored Feb 19, 2025
1 parent 2c7234b commit 97b392d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
FLATTENING_COEFFICIENT = 0.9
PROOF_SIZE_THRESHOLD = 3648
PROOF_SIZE_WEIGHT = 0
RESPONSE_TIME_WEIGHT = 0.75
COMPETITION_WEIGHT = 0.25
RESPONSE_TIME_WEIGHT = 0.5
COMPETITION_WEIGHT = 0.5
MAXIMUM_RESPONSE_TIME_DECIMAL = 0.99
SCALING = 100000000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
FLATTENING_COEFFICIENT = 0.9
PROOF_SIZE_THRESHOLD = 3648
PROOF_SIZE_WEIGHT = 0
RESPONSE_TIME_WEIGHT = 0.75
COMPETITION_WEIGHT = 0.25
RESPONSE_TIME_WEIGHT = 0.5
COMPETITION_WEIGHT = 0.5
MAXIMUM_RESPONSE_TIME_DECIMAL = 0.99
SCALING = 100000000

Expand Down
21 changes: 5 additions & 16 deletions neurons/incentive_mechanism.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"from _validator.models.request_type import RequestType\n",
"from execution_layer.generic_input import GenericInput\n",
"\n",
"RESPONSE_TIME_WEIGHT = 0.75\n",
"COMPETITION_WEIGHT = 0.9\n",
"RESPONSE_TIME_WEIGHT = 0.1\n",
"MAX_RESPONSE_TIME = 30\n",
"MIN_RESPONSE_TIME = 0\n",
"NUM_KEYS_TO_SIMULATE = 256\n",
Expand Down Expand Up @@ -73,9 +74,8 @@
" \"PROOF_SIZE_WEIGHT\": int(PROOF_SIZE_WEIGHT * scale),\n",
" \"PROOF_SIZE_THRESHOLD\": int(PROOF_SIZE_THRESHOLD * scale),\n",
" \"RESPONSE_TIME_WEIGHT\": int(RESPONSE_TIME_WEIGHT * scale),\n",
" \"ACCURACY_WEIGHT\": int(ACCURACY_WEIGHT * scale),\n",
" \"COMPETITION_WEIGHT\": int(COMPETITION_WEIGHT * scale),\n",
" \"MAXIMUM_RESPONSE_TIME_DECIMAL\": int(MAXIMUM_RESPONSE_TIME_DECIMAL * scale),\n",
"\n",
" \"maximum_score\": (batch_inputs[\"maximum_score\"] * scale).int().tolist(),\n",
" \"previous_score\": (batch_inputs[\"previous_score\"] * scale).int().tolist(),\n",
" \"verified\": batch_inputs[\"verified\"].tolist(),\n",
Expand All @@ -91,21 +91,10 @@
" \"block_number\": batch_inputs[\"block_number\"].tolist(),\n",
" \"validator_uid\": batch_inputs[\"validator_uid\"].tolist(),\n",
" \"miner_uid\": batch_inputs[\"miner_uid\"].tolist(),\n",
" \"scaling\": scale,\n",
" }\n",
"\n",
" inputs[\"scaling\"] = scale\n",
" inputs[\"RATE_OF_DECAY\"] = int(RATE_OF_DECAY * scale)\n",
" inputs[\"RATE_OF_RECOVERY\"] = int(RATE_OF_RECOVERY * scale)\n",
" inputs[\"FLATTENING_COEFFICIENT\"] = int(FLATTENING_COEFFICIENT * scale)\n",
" inputs[\"PROOF_SIZE_WEIGHT\"] = int(PROOF_SIZE_WEIGHT * scale)\n",
" inputs[\"PROOF_SIZE_THRESHOLD\"] = int(PROOF_SIZE_THRESHOLD * scale)\n",
" inputs[\"RESPONSE_TIME_WEIGHT\"] = int(RESPONSE_TIME_WEIGHT * scale)\n",
" inputs[\"MAXIMUM_RESPONSE_TIME_DECIMAL\"] = int(\n",
" MAXIMUM_RESPONSE_TIME_DECIMAL * scale\n",
" )\n",
" inputs[\"COMPETITION_WEIGHT\"] = int(0.25 * scale)\n",
"\n",
" session = VerifiedModelSession(GenericInput(RequestType.RWR, inputs), circuit)\n",
" session = VerifiedModelSession(GenericInput(RequestType.RWR, modified_inputs), circuit)\n",
" scores = None\n",
" if circuit.proof_system == ProofSystem.CIRCOM:\n",
" witness_content = session.generate_witness(return_content=True)\n",
Expand Down

0 comments on commit 97b392d

Please sign in to comment.