I spent a while reading ripple protocol, specially the consensus process, the protocol works based only on a sub-network ( from a huge network) reaching a consensus for the current state, it's supposed to prevent double-spending and other attacks. There is no analysis about fork events!

First, any one can explain step by step the underlying consensus mechanism? Second, what's in the mechanism that prevents double-spending, attacks and fork events?