The DB key generation algorithm can be used to simplify s2s clustering.
I replaced all code to generate S2S secret with new code which generates secret as described in XEP-0185.
The DB key generation algorithm can be used to simplify s2s clustering.