I am just reading source code of EOS but I am not clear with fork databases.
I do not know exactly where it is (on RAM or on disk). I also would like to have a look at the exact code. Which files are relevant? Thanks!
The still reversible blocks are stored in blocks/reversible
.
The reversible state is kept in RAM, and keeps track of inserts, deletes, and updates in their undo
/ redo
forms, so they can be applied and unapplied when a change of longest chain occurs. If you're looking at the source, check references to chainbase
instead of fork. Check the squash
, commit
methods, and around here: https://github.com/EOSIO/chainbase/blob/master/src/chainbase.cpp#L217