Automated patch management and build system for integrating Xatu Sidecar observability into Lighthouse.
Dimhouse is a patch management system that integrates Xatu Sidecar observability into the Lighthouse Ethereum consensus client. It maintains patches that inject the Xatu Sidecar crate into Lighthouse builds, enabling enhanced network monitoring and metrics collection for the Xatu data collection pipeline.
- Xatu Sidecar Integration: Seamlessly adds Xatu Sidecar observability capabilities to Lighthouse
- Patch Management: Maintains patches for different Lighthouse versions (branches, tags, commits)
- Automated Updates: CI/CD workflows to keep patches current with upstream changes
- Multi-version Support: Track and build multiple versions simultaneously
- Release Automation: Automatic GitHub releases for updated patches
├── .github/workflows/ # GitHub Actions workflows
│ ├── check-patches.yml # Automated patch checking and updating
│ ├── add-patch.yml # Manual patch addition workflow
│ └── list-patches.yml # List all available patches
├── crates/ # Source crates to be integrated
│ └── xatu/ # Xatu Sidecar crate for Lighthouse integration
├── patches/ # Patch files organized by org/repo/ref
│ └── sigp/
│ └── lighthouse/
│ └── unstable.patch # Default patch for Lighthouse
├── dimhouse-build.sh # Main build script
├── apply-dimhouse-patch.sh # Helper script to apply patches
└── example-xatu-config.yaml # Xatu configuration file
Main build script that handles the full workflow: clone, patch, build, and update patches.
# Usage
./dimhouse-build.sh -r <org/repo> -b <branch/tag/commit> [--ci]
# Examples
./dimhouse-build.sh -r sigp/lighthouse -b unstable
./dimhouse-build.sh -r sigp/lighthouse -b v4.5.0
./dimhouse-build.sh -r sigp/lighthouse -b a1b2c3d
# CI mode (non-interactive, auto-approves changes)
./dimhouse-build.sh -r sigp/lighthouse -b unstable --ci
Options:
-r, --repo
: Repository in formatorg/repo
-b, --branch
: Branch name, tag, or commit hash--ci
: Run in CI mode (non-interactive, auto-clean, auto-update patches)
Helper script to apply patches to an existing repository.
# Usage
./apply-dimhouse-patch.sh <org/repo> <branch/tag/commit> [target_dir]
# Examples
./apply-dimhouse-patch.sh sigp/lighthouse unstable
./apply-dimhouse-patch.sh sigp/lighthouse v4.5.0 /path/to/lighthouse
Patches are stored in patches/<org>/<repo>/<ref>.patch
where ref
can be:
- Branch name:
unstable.patch
- Tag:
v4.5.0.patch
- Commit:
a1b2c3d.patch
The system uses a fallback mechanism when applying patches:
- First tries to find an exact match:
patches/<org>/<repo>/<ref>.patch
- Falls back to default:
patches/sigp/lighthouse/unstable.patch
When running dimhouse-build.sh
:
- If the build succeeds and the patch has changed, you'll be prompted to update it
- In CI mode (
--ci
), patches are automatically updated without prompting - New patches are created automatically for new branches/tags/commits
Runs daily (2 AM UTC) or manually to:
- Discover all existing patches
- Build each patch in parallel
- Auto-commit updated patches if changes are detected
- Create GitHub releases for each updated patch
Triggers:
- Schedule: Daily at 2 AM UTC
- Manual: Via GitHub Actions UI
Allows manual addition of new patches via GitHub Actions UI.
Inputs:
repository
: Repository inorg/repo
formatref
: Branch, tag, or commit hashpatch_name
: Optional custom patch filenameforce_rebuild
: Force overwrite existing patches
Example: Adding a patch for a specific Lighthouse release:
- Go to Actions → "Add New Patch"
- Enter:
sigp/lighthouse
andv4.5.0
- Run workflow
Lists all available patches in a table format.
Triggers:
- Manual: Via GitHub Actions UI
- Automatic: When patches are modified
The CI system automatically creates GitHub releases for updated patches with tags following the format:
<org>-<repo>-<ref>-<short_commit_hash>
Example: sigp-lighthouse-unstable-a3f5e92
Each release includes:
- The patch file as an artifact
- Build details and commit information
- Application instructions
The example-xatu-config.yaml
file contains configuration for the Xatu Sidecar. This file is referenced by the environment variable XATU_CONFIG
when running the patched Lighthouse binary with Xatu Sidecar integration.
To run the Lighthouse client built with Dimhouse patches and enable Xatu Sidecar observability:
lighthouse beacon_node --xatu-config /path/to/xatu-config.yaml [other options]
The configuration file should be based on example-xatu-config.yaml
and customized for your deployment needs.
- Git
- Rust/Cargo (for building Lighthouse)
- Bash
- GitHub CLI (
gh
) for release creation in CI
- The
lighthouse/
directory is git-ignored and used as a working directory - Patches automatically exclude the xatu crate directory (it's copied separately)
- Cargo.lock changes are excluded from patches to avoid conflicts
- CI mode (
--ci
) enables fully automated operation without user prompts
- Fork the repository
- Add or modify patches as needed
- Test locally with
dimhouse-build.sh
- Submit a pull request
Patches should be tested to ensure they:
- Apply cleanly to the target version
- Build successfully
- Maintain the intended Xatu Sidecar integration functionality