Skip to content

Anti-Slashing Protection

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✅ Full✅ Production
SQLite✅ FullDev / single instance
Noop❌ None⚠️ Testing only

PostgreSQL is the recommended backend for production deployments. It supports multiple signer instances sharing the same database and provides full surround vote detection.

antislashing:
backend: postgres
url: "postgresql://user:password@localhost:5432/slashing?sslmode=require"
pool_size: 8 # connection pool size
force_ipv4: false # set true if IPv6 causes issues

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_ANTISLASHING__BACKEND=postgres
CONTAINMENT_ANTISLASHING__URL="postgresql://user:password@localhost:5432/slashing"
CONTAINMENT_ANTISLASHING__POOL_SIZE=8
CONTAINMENT_ANTISLASHING__FORCE_IPV4=false

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

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