I'd like to download some recent version of the Ethereum State Trie. I read here that geth --syncmode light
downloads the current state. But does that only encompass the most recent blocks or also a recent version of the State Trie?
When I started my node, geth said it added a trusted checkpoint for block 5734399. So I figured, it downloaded the state trie from a peer for that block. So I tried to access the leveldb files directly using the state root of block 5734399 following this tutorial. However, there was no trie data available for the state root of that block in the leveldb. Does geth maybe download the State Trie of some other block? Or does it not download any State Trie at all?
Here is my nodejs code for reading the leveldb:
var level = require('level');
var rlp = require('rlp');
var Trie = require('merkle-patricia-tree/secure');
var root = "0x35cabdf547eeddccbc9d2df11e3c8b3e0254144b57ec33560c446d8dccfbdf78"; // block 5734399
var db = level('/media/sdc1/.ethereum_light/geth/lightchaindata');
var trie = new Trie(db, root);
var stream = trie.createReadStream();
stream.on('data', function (data){
console.log(data.key);
});