-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routing table #13
base: main
Are you sure you want to change the base?
Routing table #13
Conversation
Edge case found: |
for hotkey, _ in self.connected_nodes.items(): | ||
if hotkey in self.validator.metagraph.nodes: | ||
node = self.validator.metagraph.nodes[hotkey] | ||
tee_address = await self.get_tee_address(node) | ||
tee_addresses = await self.get_tee_address(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be self.get_tee_addresses(node)
for clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
logger.info( | ||
f"Hotkey: {hotkey} stored address {tee_address} into DB successfuly." | ||
) | ||
except sqlite3.IntegrityError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not familiar w/ sqlite - are there other potential errors that could happen here? And, if so, do we want some retry logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there must be some other errors to catch, will take a look
Summary
This pull request introduces significant improvements to the routing table and node management functionalities within the validator. The changes include the implementation of a new
RoutingTable
class, updates to theNodeManager
for better handling of TEE addresses, and comprehensive test coverage for the new features.Key Changes
RoutingTable Class:
RoutingTable
class to manage miner addresses.NodeManager Updates:
NodeManager
to use theRoutingTable
for managing TEE addresses.Database Schema:
RoutingTableDatabase
schema to enforce a unique constraint on theaddress
column.uid
andhotkey
.Test Coverage:
RoutingTable
andRoutingTableDatabase
classes.Testing
python -m unittest discover tests
.Additional Notes
.gitignore
file has been updated to exclude database files generated during testing.Validator
class now initializes aRoutingTable
instance for managing TEE addresses.closes #7