feat: implement context snapshot fetch (Task 8)#2
Merged
Conversation
added 2 commits
June 7, 2026 00:33
- Add context_fetcher.py with Prometheus and Docker socket queries - Implement fallback chain: Docker → Prometheus → unavailable - Query peer count and validator count based on client type - Integrate context snapshot into WebhookHandler before processing - Add 10 unit tests for context fetcher module - Update implementation plan to mark Task 8 complete
- Add Connection: close to Docker socket request to prevent hanging
- Remove broken Prometheus container fallback (up{container=...} doesn't work in eth-docker)
- Add nimbus and lodestar to validator count queries
- Add test assertion to verify Connection: close header is sent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Implements Task 8: Context snapshot fetch for the webhook receiver.
Changes
webhook-receiver/src/webhook_receiver/context_fetcher.py_query_prometheus: Queries Prometheus for instant vector values (2s timeout)_get_docker_container_status: Queries Docker socket via Unix socket for container statefetch_context_snapshot: Orchestrates the fallback chain (Docker → "unavailable")WebhookHandler— context snapshot attached before dedup/storm protectiondocs/hermes-implementation-plan.mdto mark Task 8 completeReview Fixes (separate commit for easy review)
Connection: closeto Docker socket HTTP request to prevent indefinite hangingup{container=...}doesn't work in eth-docker)Connection: closeheader is sentTest results