Ripple ledger stores history of ledgers 0 to N or it stores only N?
That's just a matter of definition. You can define the ledger to be just a single state of the network with a single sequence number. Or you can define the ledger to be every past state of the network as well.
Most commonly, we use the term "ledger" to refer to a single state of the network at a single time.
Each Ripple ledger stores every account info or just accounts on which transaction occur recently?
Again, that's just a matter of definition. Most commonly, we use the term "ledger" to refer to all of the state entries (accounts, offers, trust lines, and so on) that were connected at a particular point in time.
The ledger design is passive. That is, a particular entry can be in ledgers 10,000,000 through 20,000,000 without anything special happening to it and without it requiring any processing as it just sits in the ledger and doesn't do anything.
If a new rippled server starts up with no data at all, it will not begin processing until it reaches some point where it knows every single currently valid/reachable ledger entry. That typically takes about two minutes (because the ledger's structure is specifically designed to make this efficient). At that point, it can process transactions and perform normal functions even though it doesn't have any network history. Of course, it can't tell you what happened in the past.
I guess the question here is about information replication from the previous ledger into the new ledger. Every time a new round of consensus is finished the ledger height changes from N to N+1. My question (and I believe the original question) is: the information that is appended and stored contains only the new transactions or it also contains reference to previous balances and accounts, other than the reference to the previous height hash? That is not clear in the answer. – Joao Leme – 2017-12-31T15:20:27.280
It also contains references to previous balances and accounts because those didn't change and so they're still there. It passively continue to include them. – David Schwartz – 2018-01-01T02:16:14.350
Thanks David for the response, but it's still not clear. I guess the proper question is: Is the "state tree" broadcasted over the network on every new Ledger, or just the state tree root node hash? Maybe its subject to another question. – Joao Leme – 2018-01-04T13:09:17.063
1Every node that is in sync builds the new ledger itself. They confirm the hash of the ledger header which includes the hash of the state tree root node. Any server that for some reason could not build that ledger but wants it will have to fetch the ledger header by hash, then the state tree root by hash, and so on. If they have a recent ledger, the tree branches will quickly lead to a node they already have as they fetch the changed nodes. – David Schwartz – 2018-01-07T05:31:52.693