Loading
fix(bifrost): prevent signer lock map race
A signing worker can finish while SpawnSignings adds a new vault/chain entry. The worker’s cleanup reads vaultChainLock at the same time, which can crash Bifrost with fatal error: concurrent map read and map write.
Pass the lock channel directly into each worker so cleanup no longer reads the map. The existing WaitGroup and semaphore release ordering stay unchanged.
Found during review of !5087 (merged) and reproduced locally. Adds a regression test covering 32 vault/chain pairs.
Validation:
- The regression catches the map race on current
developwithout the fix. - The regression passes 20 runs under
-race. - The full signer package passes under
-race.