Skip to content

Commit 63ea9d5

Browse files
authored
Merge pull request #147 from web-genie-ai/feat/ddos
Feat/ddos
2 parents 1a1c3fa + f81abf4 commit 63ea9d5

File tree

7 files changed

+205
-55
lines changed

7 files changed

+205
-55
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,4 @@ developer_doc.md
193193

194194
debug_images/
195195
submit_results.py
196+
*.pem

neurons/validators/validator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,11 @@ def __init__(self, config=None):
8787

8888
def resync_metagraph(self):
8989
# Copies state of metagraph before syncing.
90-
previous_metagraph = copy.deepcopy(self.metagraph)
91-
90+
previous_axons = copy.deepcopy(self.metagraph.axons)
9291
# Sync the metagraph.
9392
self.metagraph.sync(subtensor=self.subtensor)
94-
9593
# Check if the metagraph axon info has changed.
96-
if previous_metagraph.axons == self.metagraph.axons:
94+
if previous_axons == self.metagraph.axons:
9795
return
9896

9997
bt.logging.info(

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[project]
22
name = "web-genie-ai"
3-
version = "1.1.20"
3+
version = "1.3.0"
44
description = "The first bittensor subnet for web generation"
55
readme = "README.md"
66
requires-python = ">=3.12.4"
77
dependencies = [
88
"ansible-vault==2.1.0",
9-
"async-substrate-interface==1.0.0",
9+
"async-substrate-interface==1.0.3",
1010
"beautifulsoup4==4.12.3",
1111
"bert-score==0.3.13",
1212
"bt-decode==0.5.0a2",
13-
"bittensor==9.0.0",
14-
"bittensor-cli==9.0.0",
13+
"bittensor==9.0.3",
14+
"bittensor-cli==9.0.3",
1515
"clip",
1616
"datasets==3.2.0",
1717
"ddt==1.6.0",
@@ -26,7 +26,7 @@ dependencies = [
2626
"peft",
2727
"pip-chill==1.0.3",
2828
"playwright==1.49.1",
29-
"pydantic==2.6",
29+
"pydantic==2.10.6",
3030
"python-dotenv==1.0.1",
3131
"scikit-learn==1.6.0",
3232
"shtab==1.6.5",
@@ -40,6 +40,7 @@ dependencies = [
4040
"tensorflow>=2.18.0",
4141
"tf-keras",
4242
"uvicorn",
43+
"bt-ddos-shield-client>=0.1.3",
4344
]
4445

4546
[project.urls]

uv.lock

Lines changed: 192 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webgenie/base/neuron.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import bittensor as bt
2222

2323
from abc import ABC, abstractmethod
24+
from bt_ddos_shield import ShieldMetagraph
2425

2526
# Sync calls set weights and also resyncs the metagraph.
2627
from webgenie.constants import NEURON_EPOCH_LENGTH, SPEC_VERSION
@@ -90,7 +91,7 @@ def __init__(self, config=None):
9091
else:
9192
self.wallet = bt.wallet(config=self.config)
9293
self.subtensor = bt.subtensor(config=self.config)
93-
self.metagraph = self.subtensor.metagraph(self.config.netuid)
94+
self.metagraph = ShieldMetagraph(self.wallet, self.config.netuid, subtensor=self.subtensor)
9495

9596
bt.logging.info(f"Wallet: {self.wallet}")
9697
bt.logging.info(f"Subtensor: {self.subtensor}")

webgenie/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import psutil
44
# Change this value when updating your code base.
55
# Define the version of the webgenie.
6-
__VERSION__ = "1.2.2" # version
6+
__VERSION__ = "1.3.0" # version
77

88
SPEC_VERSION = (
99
(1000 * int(__VERSION__.split(".")[0]))

webgenie/datasets/central_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def get_html(self, session:int, task_number:int)->str:
4848

4949
if response.status_code != 200:
5050
raise Exception(f"Failed to get HTML: {response.status_code} {response.text}")
51-
bt.logging.info(f"HTML: {response.json()}")
51+
5252
return response.json()["html"]

0 commit comments

Comments
 (0)