dkg.js
dkg.js copied to clipboard
Jenkins timeout fix
Fix: Add timeout protection to prevent infinite hangs in DKG client operations
Problem
Jenkins pipeline tests were hanging indefinitely during DKG operations, particularly affecting Neuroweb testnet. The issue was caused by missing timeout protection in core blockchain interaction methods, leading to infinite loops when network conditions were poor or nodes were unresponsive.
Root Cause
Several critical DKG client methods lacked proper timeout protection:
-
waitForEventFinality: No timeout protection, could hang indefinitely during block confirmations -
executeContractFunction: No timeout protection, could hang indefinitely during contract execution -
finalityStatus: Only had retry limits (25s max), no total timeout protection -
getOperationResult: Only had retry limits (25s max), no total timeout protection
Solution
Added comprehensive timeout protection to prevent infinite hangs:
-
waitForEventFinality: Added 60-second timeout (using existingtransactionFinalityMaxWaitTimeconfig) -
executeContractFunction: Added 5-minute total timeout -
finalityStatus: Added 5-minute total timeout (in addition to existing retry limits) -
getOperationResult: Added 5-minute total timeout (in addition to existing retry limits)
Impact
- Prevents Jenkins pipeline timeouts and hanging jobs
- Improves reliability across all blockchain networks (Base, Gnosis, Neuroweb)
- Maintains existing functionality while adding safety protection
- No breaking changes to API or behavior
Testing
- Fixes Neuroweb testnet hanging issues
- All existing timeout configurations preserved
- Generous timeout values ensure normal operations are not affected