Skip to content
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

feat(routing table): Store miners tee address in a SQLite and keep it in sync with the Metagraph #7

Closed
5 tasks done
Tracked by #89
hide-on-bush-x opened this issue Jan 28, 2025 · 1 comment · May be fixed by #13
Closed
5 tasks done
Tracked by #89
Assignees
Labels

Comments

@hide-on-bush-x
Copy link
Collaborator

hide-on-bush-x commented Jan 28, 2025

Problem Statement

The currently proposed implementation stores miner addresses in memory, which is not secure or persistent. We need a more reliable storage solution to ensure data integrity and availability across sessions. Additionally, there is a need to support multiple addresses per miner.

Acceptance Criteria

  • Miner addresses are stored in a SQLite database.
  • The database is kept in sync with the Metagraph.
  • The system can handle database read/write errors gracefully.
  • Support for multiple addresses per miner is implemented.
  • Tests that cover this feature

Proposed Solution

Implement a SQLite database to store miner addresses. The validator will periodically update this database to reflect changes in the Metagraph. This will involve:

  • Creating a SQLite database schema to store miner addresses, supporting multiple addresses per miner.
  • Implementing functions to add, update, and delete records in the database.
  • Ensuring the validator process updates the database in a separate thread to avoid blocking operations.

Technical Details

  • Database Schema: Define a table with columns for miner ID, address, timestamp, and any other relevant metadata. Ensure the schema supports multiple addresses per miner.
  • Synchronization: Implement a mechanism to periodically fetch the latest list of nodes from the Metagraph and update the SQLite database accordingly.
  • Error Handling: Use try-except blocks to handle potential database errors and log them for debugging purposes.
  • Threading: Use Python's threading module to run the database update process in a separate thread.

Related Issues / Dependencies

  • This feature depends on the existing validator process and its ability to fetch nodes from the Metagraph.
  • Ensure compatibility with the fiber library used in the validator.
@hide-on-bush-x hide-on-bush-x self-assigned this Jan 28, 2025
@hide-on-bush-x
Copy link
Collaborator Author

Format of the response from the miner side must be ip:port1,ip:port2,ip:port3,....

hide-on-bush-x added a commit that referenced this issue Jan 29, 2025
@hide-on-bush-x hide-on-bush-x closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants