-
Notifications
You must be signed in to change notification settings - Fork 246
Updating CHT BloomTrie
Ivan Daniluk edited this page Mar 2, 2018
·
4 revisions
CHT/BloomTries values are used for faster synchronization in LES (Light Ethereum Service), but at the present moment we have to regenerate the values manually from time to time.
- Clone https://github.com/ethereum/go-ethereum
- Run
make
- Run full node:
build/bin/geth --testnet --syncmode "full" --cache 512
- Wait until it synchronizes (if unsure, check the latest block number with http://ropsten.etherscan.io for example)
- Find two log lines starting with "Storing CHT" and "Storing BloomTrie". Example output:
INFO [01-16|13:37:34] Storing CHT idx=71 sectionHead=196bbde833b65a00668ebfd41e2250252ca341b43f33719637ff9b7b0c6fb6c7 root=4d3108bf5334e1eee0d0940b43b69f532012640961f658cf5e42930dbebefba9
INFO [01-16|13:37:40] Storing BloomTrie section=71 sectionHead=196bbde833b65a00668ebfd41e2250252ca341b43f33719637ff9b7b0c6fb6c7 root=dcd1f171503b19970b37a851498c1eeac4744bfb26df9d67ab360818f3d37ba4 compression ratio=0.059
- Write down 4 values (example, based on output above):
- Section Index: 71 (
idx=
) - Section Head: 196bbde833b65a00668ebfd41e2250252ca341b43f33719637ff9b7b0c6fb6c7 (
sectionHead=
) - CHT Root: 4d3108bf5334e1eee0d0940b43b69f532012640961f658cf5e42930dbebefba9 (
root=
from the "Storing CHT" line) - BloomTrie Root: dcd1f171503b19970b37a851498c1eeac4744bfb26df9d67ab360818f3d37ba4 (
root=
from the "Storing BloomTrie" line)
- Update https://github.com/status-im/status-go/blob/develop/geth-patches/0006-latest-cht.patch with the new values
- Example from the output above:
diff --git a/light/postprocess.go b/light/postprocess.go
index e7e51388..dc6562be 100644
--- a/light/postprocess.go
+++ b/light/postprocess.go
@@ -66,12 +66,20 @@ var (
chtRoot: common.HexToHash("6f56dc61936752cc1f8c84b4addabdbe6a1c19693de3f21cb818362df2117f03"),
bloomTrieRoot: common.HexToHash("aca7d7c504d22737242effc3fdc604a762a0af9ced898036b5986c3a15220208"),
}
+
+ statusRopstenCheckpoint = trustedCheckpoint{
+ name: "Ropsten testnet",
+ sectionIdx: 74,
+ sectionHead: common.HexToHash("196bbde833b65a00668ebfd41e2250252ca341b43f33719637ff9b7b0c6fb6c7"),
+ chtRoot: common.HexToHash("4d3108bf5334e1eee0d0940b43b69f532012640961f658cf5e42930dbebefba9"),
+ bloomTrieRoot: common.HexToHash("dcd1f171503b19970b37a851498c1eeac4744bfb26df9d67ab360818f3d37ba4"),
+ }
)
// trustedCheckpoints associates each known checkpoint with the genesis hash of the chain it belongs to
var trustedCheckpoints = map[common.Hash]trustedCheckpoint{
params.MainnetGenesisHash: mainnetCheckpoint,
- params.TestnetGenesisHash: ropstenCheckpoint,
+ params.TestnetGenesisHash: statusRopstenCheckpoint,
}
var (
- TBD: apply patches to the
status-im/go-ethereum
- TBD: update vendored dependency using
dep
command
- Go to machine called
miner1
, - Run
service stop geth
to stop currently running geth, - Run a container:
docker run -d --name full-geth -i -p 30303:30303 -v /mnt/ethereum/custom-full:/root/.ethereum ethereum/client-go:v1.7.2 --testnet --syncmode "full" --cache 512 --verbosity 5 --lightserv 90
/mnt/ethereum/custom-full
directory has previously downloaded chain-data files,
- Grep for CHT logs:
docker logs --since=30s -f full-geth 2>&1 | grep -e "INFO\|CHT"
, - When you get the newest CHT number, stop
full-geth
container and remove it, - Bring back the stopped geth service:
service start geth
.
Project Information
Getting started
Developers
Support
Internal