This website is no longer actively supported. Please see the Ripple Developer Center for up-to-date documentation and other resources.

Ledger Cycle

From Ripple Wiki
Jump to: navigation, search

First read: Continuous Ledger Close

Here is a timeline of the process from the point of view of a single node.

  1. Ledger is open. Servers will attempt to apply transactions they receive to their open ledger. Transactions that successfully apply will be relayed.
  2. Start Ledger Closing process. Servers will start the closing process any time they have transactions that have not gotten into a consensus ledger (or a certain amount of time passes).
  3. Servers send a hash of the transaction bundle they think should be applied to the previous ledger based on the transactions that got into their open ledger. This is called their proposal.
  4. Proposal are flooded to the network in the same way that transactions are.
  5. As each proposal is received, servers check if it's a newer proposal from a server on the UNL. If it is, they look for any transactions that server has taken a different position on.
  6. If necessary, server change positions on disputed transactions to reach a consensus. They send new proposals as necessary to converge. (The ledger close time is also converged on.)
  7. Once a consensus is reached, they apply the consensus transaction set to the last closed ledger. They accept this ledger as the new last closed ledger and send a validation message for the new last closed ledger.
  8. They create a new open ledger that follows the new last closed ledger. Any transactions that didn't get into the consensus set, any new transactions in their open ledger, and any held transactions are applied to the new open ledger.
  9. Collect validations
  10. Look at the validations from the nodes on the UNL. If the majority of nodes on the UNL back a different last closed ledger switch to this new ledger.
  11. There is now a new last closed ledger and a new open ledger, notify clients and start the process at 1) again

Ledger Close State Machine