-
sech1
-
sech1
How to generate this checkpoints.json?
-
sech1
Suppose I have up to date Monero node and want to bootstrap a new one, and I don't want to just copy over lmdb/data.mdb
-
sech1
selsta moneromooo ^
-
moneromooo
Checkpoints don't speed sync up, it just prevents you from syncing the wrong chain.
-
moneromooo
Which is kind of a speedup in a way, but I don't think that's what you want ?
-
moneromooo
The hash of hashes system does speed things up.
-
moneromooo
And that one's generated with monero-blockchain-export
-
moneromooo
I do't think thr json checkpoints system was ever used beyond testing. It's *really* old.
-
moneromooo
It was a crutch to allow people to sync in case of attack early on.
-
moneromooo
But to the actual question, I do not know offhand, but I assume it's by hand, same as the hardcoded ones. Lookup the hash at a given height, write this with the right keys.
-
sech1
Yes, I mean hash of hashes that's used to speed up sync until certain height
-
sech1
Because as soon as monerod runs out of these, sync gets really slow
-
selsta
sech1: v0.18.2.0 contains hashes up until 2-3 weeks ago
-
selsta
./monero-blockchain-export --output-file checkpoints.dat --block-stop 2817000 --blocksdat
-
sech1
So there's no way to feedd this file to monerod except compiling it?
-
selsta
i don't think so
-
moneromooo
Correct. Easy to change though if you want, it's loaded as a blob.
-
sech1
Ok, so I can just build my own monerod every time
-
hyc
why can't we propagate hash-of-hashes lists across p2p?
-
someoneelse49549
<hyc> "why can't we propagate hash-of-..." <- Could you be more precise?
-
hyc
they're currently hardcoded, compiled into each new release binary
-
ofrnxmr[m]
Instead of doing what sech said and hardcoding each node, why cant we have node update and share the hash of hashes dramatically
-
ofrnxmr[m]
(I was replying to someonelse, not reasking 🙏)
-
hyc
there is an element of trust involved, obviously the HoH list in the binaries is in a reproducible build, and trustworthy
-
hyc
anything pulled over the p2p link could be fake, but that isn't any different from following a fake/forked chain is it?
-
hyc
could have some rule like: use hash-of-hashes until within 1000 blocks of chain tip
-
hyc
so whenever you're doing IBD or catching up from a long time offline, it will use the compiled in HoH for as long as they last, and then HoH from network until it's nearly caught up, then switch to normal verification
-
ofrnxmr[m]
Maybe should use hardcoded hoh without a special flag "--sync-using-hashes". Nodes without flag ignore hashes from others, but still calculate them to distribute.
-
ofrnxmr[m]
Ones with the flag will use hoh up to 720 blocks until tip
-
sech1
it requires trust right now
-
sech1
if nodes included it in blocks they mine, it would've been a different story
-
sech1
then it would be confirmed with PoW
-
hyc
sounds like a good feature to add for next hardfork?
-
sech1
A mining node includes hash of the last 256 block hashes in block N, and syncing nodes check PoW for the next 256 blocks (N...N+255) to consider this hash of hashes confirmed by the network. Something like this.
-
sech1
Then syncing node will only need to check PoW
-
sech1
In practice syncing nodes will just download blocks until N+256 first, then check PoW and consider blocks up to N valid after checking hashes
-
hyc
makes sense
-
hyc
not in every block, only in blocks numbered (N % 256 == 0)
-
sech1
yes
-
hyc
that would eliminate a ton of random I/O from block verification
-
sech1
the same way built-in hashes work now
-
DataHoarder
plaster it inside the tx hash list on those :')
-
sech1
no, in tx_extra for the coinbase transaction
-
DataHoarder
fair enough
-
hyc
worth writing this up as a github issue?
-
DataHoarder
wouldn't mining a block already include the previous 256 hashes, in the way of the PreviousId chain?
-
sech1
technically yes
-
sech1
hash of hashes allows monerod to skip transaction verification in exchange for using trusted source of hashes (built into the binary)
-
sech1
so it's basically "yolo" sync mode where it only checks PoW and trusts that other nodes which produced that PoW, also checked transactions
-
DataHoarder
so only needs headers ever 256 blocks
-
ofrnxmr[m]
And nodes that are up to sync would be verifying on the fly. Only nodes who fall behind would skip verification.