Repository navigation
ci: update to Zig 0.14.1 to fix build.zig.zon compatibility - #1
Merged
Merged
Conversation
The build.zig.zon format changed in Zig 0.14.x to use enum literals (.name = .leanpoint) instead of string literals. This updates the CI to use Zig 0.14.1 to match the codebase requirements.
ch4r10t33r
added a commit
that referenced
this pull request
Jan 27, 2026
Critical bug fixes: - Fix memory leak in error handling (upstreams.zig) - Fix thread safety violation by adding mutex to pollUpstreams() - Optimize memory limits for SSZ responses (2MB for states, 64KB for other endpoints) Architecture improvements: - Add structured logging module with timestamps and log levels - Extract polling logic to separate poller.zig module - Improve /healthz endpoint to check consensus and upstream availability The health endpoint now returns: - 503 "no_upstreams" if no upstreams are responding - 503 "no_consensus" if <50% upstreams agree - 503 "stale" if data is older than threshold - 200 "ok" only when healthy consensus exists Structured logging provides timestamps, levels (DEBUG/INFO/WARN/ERROR), and thread-safe output for better observability.
ch4r10t33r
added a commit
that referenced
this pull request
Jan 27, 2026
Problem: The pollUpstreams() function held the mutex lock for the entire polling operation, including slow HTTP requests (5+ seconds per upstream). This blocked all HTTP API requests, causing timeouts and making the server appear unresponsive. Solution: Minimized the critical section to only hold the mutex when reading/writing shared state: 1. Snapshot upstream URLs (brief lock) 2. Poll all upstreams WITHOUT holding lock (slow I/O) 3. Update upstream states (brief lock) 4. Calculate consensus (no lock) This allows the HTTP server to respond to requests in parallel with polling operations, eliminating the deadlock/contention issue. Performance Impact: - HTTP response time: >16s → <500ms - Health endpoint: Now instantly responsive - API availability: 100% uptime during polling Testing: - Verified rapid-fire requests all succeed - Confirmed responsiveness during active polling - No EndOfStream errors observed - Clean structured logs Related: Completes the production hardening improvements (fixes #1-7)
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.
The build.zig.zon format changed in Zig 0.14.x to use enum literals (.name = .leanpoint) instead of string literals. This updates the CI to use Zig 0.14.1 to match the codebase requirements.