Configure EIP-3076 slashing protection with PostgreSQL, SQLite, or DynamoDB
Ethereum validators can be slashed — permanently penalized and forcibly exited — for signing conflicting messages (double votes or surround votes). EIP-3076 defines a slashing protection interchange format that prevents validators from producing conflicting attestations or blocks, even across signer restarts or migrations.
Containment Chamber implements EIP-3076 slashing protection with pluggable backends. Every signing request is checked against the protection database before the BLS signature is produced. If the request would result in a slashable message, the signer returns HTTP 412 and refuses to sign.
Backend Comparison
Section titled “Backend Comparison”| Backend | Multi-Instance | Slashing Protection | Recommended |
|---|---|---|---|
| PostgreSQL | ✅ | ✅ Full | ✅ Production |
| DynamoDB | ✅ | ✅ Hybrid | ✅ Production |
| SQLite | ❌ | ✅ Full | Dev / single instance |
| Noop | — | ❌ None | ⚠️ Testing only |
Per-Backend Configuration
Section titled “Per-Backend Configuration”anti_slashing: backend: postgres url: "postgresql://user:password@localhost:5432/slashing?sslmode=require" pool_size: 64 # connection pool size force_ipv4: false # set true if IPv6 causes issuesPostgreSQL is the recommended backend for production deployments. It supports multiple signer instances sharing the same database and provides full surround vote detection.
TLS is enabled by default. Append ?sslmode=disable to the URL to disable it.
anti_slashing: backend: sqlite path: ./slashing_protection.sqliteSQLite provides complete slashing protection (including surround vote detection) in a single file. Ideal for development or single-instance deployments.
anti_slashing: backend: dynamodb table: "slashing-protection" # Uses AWS SDK default credential chain # (env vars, instance profile, IRSA, etc.)DynamoDB provides multi-instance safety via AWS-native infrastructure. It uses Hybrid mode: high-water marks (slots and epochs can only advance forward) combined with per-slot block records and per-target attestation records that store signing roots. This enables:
- Double-vote detection: signing the same target epoch with a different message is rejected
- Re-broadcast support: re-signing the exact same message (same signing root) is allowed
- Surround vote prevention: algebraically impossible under watermark invariants — no full history scan needed
- Requires a pre-created DynamoDB table — name specified via
table:config option or--anti-slashing-dynamodb-tableCLI flag - Watermarks enforce forward-only progression; signing root records enable precise double-vote detection
- Credentials are resolved via the standard AWS SDK credential chain
anti_slashing: backend: noopThe Noop backend disables all slashing protection checks. Signing requests are never rejected for slashing reasons.
Environment Variable Override
Section titled “Environment Variable Override”You can configure the anti-slashing backend entirely via environment variables using the CONTAINMENT_ prefix with __ for nesting:
CONTAINMENT_ANTI_SLASHING__BACKEND=postgresCONTAINMENT_ANTI_SLASHING__URL="postgresql://user:password@localhost:5432/slashing"CONTAINMENT_ANTI_SLASHING__POOL_SIZE=64CONTAINMENT_ANTI_SLASHING__FORCE_IPV4=falseCLI Flags
Section titled “CLI Flags”For quick testing, you can also set the backend via CLI flags:
# SQLite via CLIcontainment-chamber server \ --anti-slashing-backend sqlite \ --anti-slashing-sqlite-path ./slashing.sqlite \ --key-sources-filesystem-paths ./keystores/raw
# PostgreSQL via CLIcontainment-chamber server \ --anti-slashing-backend postgres \ --anti-slashing-postgres-url "postgresql://user:pass@localhost/slashing" \ --key-sources-filesystem-paths ./keystores/rawNext Steps
Section titled “Next Steps”- PostgreSQL at Scale — pool sizing and performance tuning
- DynamoDB Key Source — encrypted key storage with the same backend
- Upgrading — back up the slashing database before version bumps