Introduction
The XDC Network, powered by its XDC 2.0 consensus mechanism, employs a slashing mechanism to maintain network stability and ensure validator accountability. Unlike punitive slashing systems in other blockchains, XDC's approach focuses on corrective measures that balance network efficiency with fairness to node operators.
This article explores how slashing works, its impact on network performance, and practical solutions for masternode operators to avoid slashing events.
Why Slashing is Critical for Network Performance
The Timeout Problem
In XDPoS, masternodes create blocks in a round-robin fashion. When a masternode fails to create a block during its designated turn, the entire network experiences a 10-second timeout before the next masternode proceeds.
Impact Example:
If 27 masternodes (25% of the 108-node network) are underperforming:
- Wasted time per epoch: 27 nodes × 6 average turns × 10 seconds = 1,620 seconds
- Normal epoch duration: 1,800 seconds
- Performance degradation: 47.4%
- Network throughput: Reduced from 2,000+ TPS to ~1,050 TPS
Without slashing, these underperforming masternodes would continue degrading network performance indefinitely. With slashing, the network automatically excludes them, restoring full operational efficiency.
How XDC Slashing Works
The Slashing Trigger
Primary Condition: A masternode that fails to sign any block during an entire epoch (900 blocks) will be slashed.
The system evaluates complete inactivity over an epoch, not isolated missed blocks. This prevents false positives from temporary network hiccups while identifying genuinely unresponsive masternodes.
The Slashing Cycle
Phase 1: Performance Monitoring
Each epoch consists of 900 blocks (approximately 30 minutes):
Epoch N (900 blocks, ~1800 seconds)
├── Masternodes take turns creating blocks
├── Block Signer smart contract records all signatures
└── Block 900 (Checkpoint): Performance evaluation
Phase 2: Detection and Slashing
At the checkpoint block:
for each masternode M in MasternodeSet {
signatures = BlockSigner.getSignatureCount(M, currentEpoch);
if (signatures == 0) {
slashMasternode(M);
addToSlashedList(M, currentEpoch + 4);
}
}
Key Point: Zero signatures = automatic slashing. Partial participation = no slashing.
Phase 3: Exclusion Period (4 Epochs)
Once slashed, a masternode enters a 4-epoch exclusion period (~2 hours):
Epoch N: Masternode slashed (0 signatures)
├── Epochs N+1 to N+4: Excluded from block creation
│ └── Can still verify/sign blocks created by others
└── Epoch N+5: Eligible for reinstatement
During Exclusion:
- Cannot create blocks
- Can verify and sign blocks (demonstrates liveness)
- This activity is required for recovery
Phase 4: Automatic Reinstatement
After 4 epochs, the masternode automatically rejoins if:
- It signed blocks during the exclusion period
- Stake remains locked in the smart contract
- No additional slashing events occurred
Byzantine Fault Tolerance and Network Safety
The XDC Network maintains Byzantine Fault Tolerance through its 75% finality requirement:
BFT Parameters:
- Finality requires: 81 validator signatures (75% of 108)
- Network tolerates: Up to 27 faulty/offline masternodes
- Critical threshold: If 28+ masternodes are slashed, finality becomes impossible
| Slashed Nodes | Active Nodes | BFT Status |
|---|---|---|
| 0-10 | 98-108 | ✅ Excellent |
| 11-27 | 81-97 | ✅ Safe |
| 27 | 81 | ⚠️ Critical |
| 28+ | <81 | ❌ Broken |
Double Validation Integration
XDC's slashing mechanism integrates with its Double Validation system:
How It Works:
- Block Creator: Creates block per round-robin schedule
- Block Verifier: Randomly selected to verify and co-sign
- Finalization: Requires both signatures
Slashing Impact:
- Slashed masternodes are excluded from block creator rotation
- Can still participate as random block verifiers
- Allows demonstration of liveness for recovery
Solutions to Avoid Slashing
Alternative: Third-Party Masternode Services
If you do not have the technical resources, infrastructure, or time to maintain a masternode yourself, there are several third-party services and volunteers willing to provide professional masternode hosting and management services. These providers handle all technical aspects including:
- Infrastructure setup and maintenance
- 24/7 uptime management
- Security hardening and updates
- Failover and redundancy
- Technical support and troubleshooting
Available Third-Party Services:
- IndSoft - Professional masternode hosting
- NODE FORGE - Managed validator services
- Zeeve - Enterprise blockchain infrastructure
- BlockDaemon - Institutional-grade node operations
- Tatum - Blockchain infrastructure platform
- NOWNodes - Node hosting and API services
- Asternodes - Validator management services
- Ankr - Decentralized node infrastructure
- thirdweb - Web3 infrastructure provider
- GOLDSKY - Blockchain data infrastructure
Important Considerations:
When selecting a third-party service provider:
- Research their track record and uptime history
- Understand their fee structure
- Verify their security practices
- Check their support responsiveness
- Review client testimonials
- Ensure they have experience with XDC Network
DISCLAIMER: XDC Network does not officially endorse any third-party services. Please perform due diligence and research before proceeding with any service provider. You remain responsible for your staked XDC and masternode performance.
For Self-Hosted Masternodes:Infrastructure Requirements
Hardware Specifications
Minimum Requirements:
- CPU: 12+ core
- RAM: 32 GB
- Storage: 2 TB NVMe SSD
- Network: 100 Mbps (1 Gbps recommended)
Why This Matters:
- Insufficient CPU → slow block processing
- Insufficient RAM → system swapping and delays
- HDD instead of SSD → missed signing windows
- Unstable network → failed peer communication
Network Infrastructure
Critical Requirements:
- Static Public IP (mandatory)
- 99.99%+ uptime SLA (use tier-3+ data centers)
- DDoS protection
- Low latency (<100ms to network peers)
- Redundant connectivity
1. Proper Node Setup
Follow the official setup guide:
Repository: https://github.com/XinFinOrg/XinFin-Node
Setup Steps:
# Clone the official repository
git clone https://github.com/XinFinOrg/XinFin-Node
cd XinFin-Node
# Run the setup script
./setup.sh
# Key configuration parameters:
# - Static IP address
# - Port 30303 open for P2P
# - Proper keystore and password
# - Adequate system resources
Essential Configuration:
-
--syncmode "full": Complete blockchain sync -
--mine: Enable block creation - Firewall: Open port 30303, restrict RPC access
2. Implement Hot Standby Architecture
Setup:
┌─────────────────────┐ ┌─────────────────────┐
│ Primary Masternode │ │ Hot Standby Node │
│ - Active mining │◄───────►│ - Synced, ready │
│ - Signing blocks │ │ - Not mining │
└─────────────────────┘ └─────────────────────┘
Critical Rules:
- Never run both nodes with same key simultaneously (causes double-signing → 100% stake loss)
- Keep standby fully synced at all times
- Document failover procedure
- Practice failover monthly
- Target failover time: <5 minutes
3. Regular Maintenance
Update Schedule:
- Critical patches: Within 24 hours
- Protocol upgrades: Per XDC Team announcements
- Regular updates: Monthly maintenance windows
Planned Maintenance:
# Update procedure
cd XinFin-Node && git pull origin master
docker-compose up -d
# Restart (target: <10 minutes downtime)
docker-compose down
docker-compose up -d
# Verify node is signing blocks within 5 minutes
4. Security Hardening
Firewall Configuration:
# Basic firewall setup
ufw default deny incoming
ufw default allow outgoing
# Allow P2P (essential)
ufw allow 30303/tcp
# Allow RPC only from localhost
ufw allow from 127.0.0.1 to any port 8545
# Allow SSH from trusted IPs only
ufw allow from YOUR_ADMIN_IP to any port 22
ufw enable
Key Protection:
- Use strong passwords (25+ characters)
- Store keys in encrypted files with restricted permissions (
chmod 600) - Never store unencrypted private keys on servers
5. Verify Network Connectivity
Check Peer Connections:
# Check peer count (should be >10)
docker exec -it xinfinnetwork_xdcnode_1 geth attach /work/xdcchain/XDC.ipc \
--exec 'admin.peers.length'
# Add peers manually if needed
docker exec -it xinfinnetwork_xdcnode_1 geth attach /work/xdcchain/XDC.ipc \
--exec 'admin.addPeer("enode://PEER_ID@IP:PORT")'
Target: Maintain 15-30 peer connections for optimal resilience.
6. Ensure Continuous Sync
Verify Sync Status:
# Check current block number
docker exec -it xinfinnetwork_xdcnode_1 geth attach /work/xdcchain/XDC.ipc \
--exec 'eth.blockNumber'
# Compare to network: https://xinfin.network
# Check sync status
docker exec -it xinfinnetwork_xdcnode_1 geth attach /work/xdcchain/XDC.ipc \
--exec 'eth.syncing'
# Should return "false" if fully synced
Action Guidelines:
- <10 blocks behind → Monitor
- 10-100 blocks behind → Check peers and connectivity
- >100 blocks behind → Investigate immediately, may need restart
7. Pre-Launch Checklist
Before activating your masternode:
- Hardware meets recommended specifications
- Static IP configured and tested
- Node deployed from official repository
- Full blockchain sync completed
- Firewall configured correctly
- Hot standby node synced
- Failover procedure documented and tested
- Keys secured properly
- 10,000,000 XDC staked
- KYC completed
8. Daily Operational Checks
Daily:
- Verify sync status (within 10 blocks)
- Check peer count (>10 peers)
- Review system logs for errors
Weekly:
- Verify standby node is synced
- Test failover readiness
- Check for software updates
Monthly:
- Update node software
- Test complete failover
- Security audit
- Backup configurations
Recovery After Slashing
If your masternode gets slashed, follow this recovery process:
Step 1: Confirm Slashing (5 Minutes)
Check your status:
- Visit https://xdcscan.com
- Enter your masternode address
- Verify epoch performance shows 0 signatures
Step 2: Diagnose Root Cause (30 Minutes)
| Issue | Check | Solution |
|---|---|---|
| Node offline | Service status | Restart service |
| Out of sync | Sync progress | Wait for completion |
| No peers | Peer count | Add peers manually |
| Disk full | Disk usage | Clear space |
| Memory issues | System resources | Restart, upgrade RAM |
Step 3: Fix the Issue (1 Hour)
Restart Node:
docker-compose restart
docker-compose logs -f --tail 100
# Verify sync resumption
docker exec -it xinfinnetwork_xdcnode_1 geth attach /work/xdcchain/XDC.ipc \
--exec 'eth.syncing'
Add Peers:
# Check firewall
ufw status
# Verify P2P port
netstat -tuln | grep 30303
# Add peers
bash peer.sh
Step 4: Demonstrate Liveness (4 Epochs)
During the 4-epoch exclusion:
- Your node can verify and sign blocks (even though it can't create them)
- This demonstrates operational status
- Target: Sign >50% of blocks during exclusion
Step 5: Automatic Reinstatement (Epoch N+5)
Your masternode automatically rejoins if:
- You signed blocks during exclusion
- Stake remains locked
- No additional slashing occurred
Verify Recovery:
- Node creates blocks again within first few hundred blocks of epoch N+5
- Check your signatures in Block Signer contract
- Confirm address in active masternode list
Best Practices Summary
Do's ✅
- Use tier-3+ data centers or reputable cloud providers
- Maintain a fully synced hot standby node
- Follow official setup guide: https://github.com/XinFinOrg/XinFin-Node
- Keep software updated with security patches
- Use strong security practices (firewall, key protection)
- Verify sync status daily
- Document all procedures
- Test failover monthly
- Maintain adequate system resources
- Keep >10 peer connections
Don'ts ❌
- Never run two nodes with same key simultaneously
- Don't use unreliable infrastructure
- Don't ignore software updates
- Don't skip regular maintenance
- Don't store unencrypted private keys
- Don't let node fall >100 blocks behind
- Don't operate without failover plan
- Don't use insufficient hardware
- Don't neglect firewall configuration
- Don't skip pre-launch checklist
Conclusion
The XDC Network's slashing mechanism maintains network stability through:
- Correction over punishment - Technical issues allow recovery
- Transparent enforcement - Automated via smart contracts
- Network efficiency - Excludes underperforming nodes to maintain throughput
- Byzantine fault tolerance - Ensures security up to 25% faulty nodes
Key Takeaways
For Prevention:
- Robust infrastructure eliminates slashing risk
- Proper configuration and maintenance are critical
- Hot standby provides failover capability
- Regular checks catch issues early
For Recovery:
- Slashing is temporary, not permanent
- Demonstrate liveness during exclusion
- Automatic reinstatement after 4 epochs
- Fix root cause to prevent recurrence
By following these guidelines, masternode operators can avoid slashing while contributing to a stable, high-performance XDC Network.
Resources
- Masternode Setup: https://github.com/XinFinOrg/XinFin-Node
- Documentation: https://docs.xdc.network
- Network Explorer: https://xdc.blocksscan.io/
- Technical Whitepaper: https://xinfin.org/docs/whitepaper-tech.pdf
- Community: https://xdc.dev
- Telegram: https://t.me/xinfintalk
Discussion (0)