Skip to content

chore: keep api clean#270

Merged
grantdfoster merged 5 commits intomainfrom
chore--keep-tee-api-clean
Mar 3, 2026
Merged

chore: keep api clean#270
grantdfoster merged 5 commits intomainfrom
chore--keep-tee-api-clean

Conversation

@grantdfoster
Copy link
Contributor

@grantdfoster grantdfoster commented Mar 3, 2026

Summary

  • Fix weight setting bug: Corrected platform_managerself.platform_manager references in _get_delta_node_data that were causing NameError during weight calculation
  • Keep MASA TEE API clean: When miners deregister from the metagraph, we now remove their TEE worker entries from the external MASA TEE API registry
  • Graceful fallback: API removal is fire-and-forget with 10s timeout - failures are logged but don't block validator operations

Test plan

  • Syntax validation passes (python -m py_compile)
  • Module imports successfully
  • Runtime test confirms graceful fallback when env vars not set
  • Existing unit tests pass

Copilot AI review requested due to automatic review settings March 3, 2026 22:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR keeps external MASA TEE worker registry state in sync with the validator by removing TEE worker entries when a miner deregisters, and cleans up a platform manager reference in weight calculation.

Changes:

  • Fix _get_delta_node_data to consistently use self.platform_manager.
  • On miner deregistration, call the MASA TEE API to remove each associated TEE worker address.
  • Add a new async helper _remove_tee_worker_from_api (and related imports/logging) to perform the API call.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
validator/weights.py Uses self.platform_manager for platform metric extraction and platform enumeration during delta calculation.
validator/node_manager.py Adds MASA API deregistration calls during disconnected-node cleanup via a new aiohttp-based helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove unused List import from typing
- Use _ for unused worker_id in loop

Made-with: Cursor
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Switch from aiohttp to existing http_client_manager (httpx)
- Removes new dependency, reuses connection pool
- Re-raise CancelledError for clean shutdown

Made-with: Cursor
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@grantdfoster grantdfoster merged commit 75f38aa into main Mar 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants