feat: remove cookie automations and update weight curve#268
feat: remove cookie automations and update weight curve#268grantdfoster merged 14 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes cookie generation/update automation components and updates validator telemetry handling to better support multi-platform restart detection and expanded platform metrics.
Changes:
- Update
_get_delta_node_datarestart detection to look for decreases across all configured raw telemetry fields (not just a Twitter legacy counter). - Expand
PlatformManagerplatform metric mappings (Twitter profiles/other, Web scraped_pages, TikTok auth_errors) and add anllmplatform (tracked but not scored). - Simplify cookie tooling by removing the cookie grabber + docker updater paths, and adjust Kubernetes cookie updater defaults.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| validator/weights.py | Restart/chunk detection now considers all raw metric fields; logging updated accordingly. |
| validator/platform_config.py | Adds new metrics/mappings and introduces an llm platform with 0 emission weight. |
| scripts/update_cookies_kubernetes.sh | Defaults cookie directory to /app/cookies and adds a directory-existence check + clearer message. |
| scripts/update_cookies_docker.sh | Removes Docker-based cookie updater script. |
| scripts/cookie_grabber.py | Removes cookie automation/grabber script. |
| docker-compose.yml | Removes cookie generator/docker updater services; keeps a single cookies updater service with a host volume mount. |
| Dockerfile.cookies.updater.docker | Removes Docker updater image definition. |
| Dockerfile.cookies.generator | Removes cookie generator image definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (4)
tests/test_weights_unit.py:69
WeightsManager.calculate_weightsisasync, but this test calls it synchronously and tries to unpack the coroutine result. Update the test to be async (or useasyncio.run) andawaitthe call; also consider passingsimulation=True(or mockingmetagraph.nodes) since the non-simulation path looks up node IDs in the metagraph.
uids, weights = weights_manager.calculate_weights(node_data)
assert len(uids) == len(weights) == 2
assert weights[0] < weights[1] # Assuming node2 has more activity
scripts/update_cookies_kubernetes.sh:1
- This script calls
kubectlwith--insecure-skip-tls-verifyfor cluster-info, pod listing,cp, andexec, which disables TLS certificate validation for all Kubernetes API calls. An attacker on the network path to the API server could impersonate the control plane, intercept or tamper with responses, and potentially gain access to cluster credentials or execute arbitrary actions. Use strict TLS verification with a properly configured kubeconfig/CA trust instead of--insecure-skip-tls-verifyfor thesekubectlinvocations.
scripts/update_cookies_docker.sh:1 - The SSH/SCP commands here use
-o StrictHostKeyChecking=no, which disables host key verification for remote cookie update hosts. Without host key checking, an attacker who can spoof DNS or intercept traffic could impersonate the remote host and run arbitrary Docker/volume operations under your credentials. Require host key verification viaknown_hostsor per-host SSH config instead of globally disablingStrictHostKeyChecking.
Dockerfile.cookies.updater.docker:1 - The entrypoint writes
/root/.ssh/configwithStrictHostKeyChecking no, turning off host key validation for all SSH connections from this container. This allows a network attacker to silently present a fake host key, hijack the SSH session, and intercept or alter cookie update operations on remote Docker hosts. Prefer keepingStrictHostKeyChecking yesand manage trusted host keys viaknown_hostsor explicitHostentries instead of disabling checks globally.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Runs pytest on Python 3.10 - Caches pip dependencies - Added setuptools package discovery config Made-with: Cursor
Made-with: Cursor
Summary
This PR removes cookie automation tooling from subnet-42 (migrated to cookie-monster repo) and improves validator telemetry handling.
Cookie Automation Removal
cookie_grabber.py,update_cookies_docker.sh,update_cookies_kubernetes.shDockerfile.cookies.generator,Dockerfile.cookies.updater.docker,Dockerfile.cookies.updater.kubernetesdocker-compose.yml(removed all cookie-related services and volumes)Validator Improvements
Restart Detection
boot_timefieldboot_timeis set once at tee-worker startup, making it a reliable restart indicatorboot_time=0won't have restart detectionPlatform Configuration
twitter_errorsfromtwitter-apifyplatform (was duplicating errors already tracked by maintwitterplatform)profiles,otherfor Twitter;auth_errorsfor TikTok;scraped_pagesfor Webllmplatform withemission_weight=0.0for metrics visibilityCode Quality
self.platform_managerinstead of creating new instance in_get_delta_node_dataprint()tologger.debug()stats_jsoninstead of legacy kwargstest_set_weightsto match current method signature (no positional args)Test Plan
pytest tests/test_weights_unit.py)