Vstorage keys can be only alphanumerics, dash, or underscore, which are all valid characters in chain IDs. So, double each occurence of CHAIN_ID_SEPARATOR in the chain ID so the encoded tuple can be decoded.