tarides / tezos

Mirror of the release branches for Tezos, a self-amending cryptographic ledger
https://gitlab.com/tezos/tezos
Other
0 stars 2 forks source link

Pass `head` argument to the `check_self_contained` subcommand #10

Open icristescu opened 3 years ago

icristescu commented 3 years ago

check_self_contained has an optional argument head which is not used in the cli: for tezos this is a problem because they are not using the branch store, so we need to look for the current head in the store and pass it on the check_self_contained function.

zshipko commented 3 years ago

Is this something that just needs to be updated in irmin-pack by calling Store.Repo.heads in the check-self-contained command?

If not, how does tezos store the current heads?

icristescu commented 3 years ago

Both :) We need to update the check-self-contained but also figure out how to get the current head. I'm not sure how do this though.

You can have a look at snapshot import command which if given --block as argument it uses it as the head; otherwise it looks into the block store for the latest head.

Something else that might help is that a tezos-client can connect by rpc to a tezos-node and get the list of current heads ./tezos-client rpc get /chains/main/blocks (you can also check this online).

So this where I would start, hopefully it helps.

zshipko commented 3 years ago

It looks like there is this Store.init function which returns a store value that can be converted to a Store.chain_store which has a current_head field and a known_heads function. Now I just need to figure out how to get the genesis hash to pass to init