Skip to content

Anti-Slashing Protection

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.

Diagram
BackendMulti-InstanceSlashing ProtectionRecommended
PostgreSQL✅ Full✅ Production
DynamoDB✅ Hybrid✅ Production
SQLite✅ FullDev / single instance
Noop❌ None⚠️ Testing only
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 issues

PostgreSQL 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.

You can configure the anti-slashing backend entirely via environment variables using the CONTAINMENT_ prefix with __ for nesting:

Terminal window
CONTAINMENT_ANTI_SLASHING__BACKEND=postgres
CONTAINMENT_ANTI_SLASHING__URL="postgresql://user:password@localhost:5432/slashing"
CONTAINMENT_ANTI_SLASHING__POOL_SIZE=64
CONTAINMENT_ANTI_SLASHING__FORCE_IPV4=false

For quick testing, you can also set the backend via CLI flags:

Terminal window
# SQLite via CLI
containment-chamber server \
--anti-slashing-backend sqlite \
--anti-slashing-sqlite-path ./slashing.sqlite \
--key-sources-filesystem-paths ./keystores/raw
# PostgreSQL via CLI
containment-chamber server \
--anti-slashing-backend postgres \
--anti-slashing-postgres-url "postgresql://user:pass@localhost/slashing" \
--key-sources-filesystem-paths ./keystores/raw