A monitoring tool that tracks block production on Cosmos EVM chains consensus and execution layers, specifically designed to monitor validator block proposals and their corresponding execution blocks.
- Monitors validator block proposals on the consensus layer
- Tracks corresponding blocks on the execution layer
- Provides Prometheus metrics for monitoring
- Configurable via TOML configuration file
- Real-time logging of block production
- Tracks gaps between consensus and execution layers
The exporter provides the following Prometheus metrics:
validator_total_blocks_proposed
: Total number of blocks proposed by the validatorvalidator_execution_blocks_confirmed
: Number of blocks confirmed on execution layervalidator_execution_blocks_missed
: Number of blocks that failed to make it to execution layervalidator_empty_consensus_blocks
: Number of empty blocks on consensus layervalidator_empty_execution_blocks
: Number of empty blocks on execution layervalidator_block_processing_errors
: Number of errors encounteredvalidator_current_block_height
: Current block height being processedvalidator_el_to_cl_gap
: Gap between execution and consensus layer heights
Create a config.toml
file:
evm_address = "" # Validator's EVM address
target_validator = "" # Validator's consensus address
rpc_endpoint = "" # Consensus layer RPC
eth_endpoint = "" # Execution layer RPC
log_file = "block_monitor.log" # Log file path
metrics_port = ":2113" # Prometheus metrics port
enable_file_log = false # Enable file logging
enable_stdout = true # Enable console logging
# Run with config file
go run ./cmd/exporter/main.go --config=./config.toml
# Build binary
go build -o evm-exporter ./cmd/exporter
# Run binary
./evm-exporter --config=./config.toml
Prometheus metrics are available at http://localhost:2113/metrics
- Go 1.22.1 or later
- Access to Cosmos & Ethereum RPC endpoints
Main dependencies:
- github.com/BurntSushi/toml: Configuration file parsing
- github.com/ethereum/go-ethereum: Ethereum client
- github.com/prometheus/client_golang: Prometheus metrics
# Clone repository
git clone [repository-url]
# Install dependencies
go mod download
# Build
go build -o evm-exporter ./cmd/exporter
{"time":"2024-11-15T10:03:54Z","level":"info","message":"ℹ️ Starting exporter","data":{"metrics_port":":2113"}}
{"time":"2024-11-15T10:53:34Z","level":"debug","message":"Processing block","data":{"height":"7458296","proposer_address":"B2A5C37E25E52A994550C504E4227A9CBB60F61A"}}
{"time":"2024-11-15T10:53:34Z","level":"info","message":"ℹ️ Found validator block","data":{"height":7458296,"proposer_address":"B2A5C37E25E52A994550C504E4227A9CBB60F61A"}}
{"time":"2024-11-15T10:53:34Z","level":"success","message":"✅ Found execution block","data":{"cl_height":7458296,"el_height":6892471,"hash":"0xcf98515011a8245cf680492b57fe22fa042ef963fd0d733b8061d362d1f7ef5b"}}
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
This project uses Conventional Commits for semantic versioning. Please format your commit messages according to the following rules:
feat: description
- for new features (triggers minor version bump)fix: description
- for bug fixes (triggers patch version bump)feat!: description
orfix!: description
- for breaking changes (triggers major version bump)chore: description
- for maintenance tasks (no version bump)docs: description
- for documentation updates (no version bump)test: description
- for test updates (no version bump)refactor: description
- for code refactoring (no version bump)
Examples:
git commit -m "feat: add new metric for tracking block confirmations"
git commit -m "fix: correct calculation of EL to CL gap"
git commit -m "docs: update configuration examples"
- Fork the repository and create your branch from
main
- Update the README.md with details of changes if applicable
- Add tests for any new functionality
- Ensure all tests pass and the build succeeds
- Update any relevant documentation
- Submit a pull request
The project uses semantic-release for automated versioning and changelog generation. Upon merging to main:
- Commit messages are analyzed
- Version is automatically bumped based on conventional commits
- CHANGELOG.md is generated/updated
- Release is created with built binaries
- Git tags are created