If CBC Casper validators are building a blockchain, then the bets they are making are blocks themselves. This is a fundamental difference between CBC Casper and most other existing consensus protocols.
Also, when validators make blocks, they don’t specify how sure they are about this block (or any other block, for that matter) being in the chain. In fact, when they make a block, they have absolutely no safety guarantees on that block, as no one has built on top of it yet!
What algorithm does a node use when making a new bet based on the current info (graph of bets from other nodes)?
The algorithm that determines where to build a new block (which, remember, are the bets), is called the forkchoice. You can read a python implementation here, and read about the inspiration GHOST. Essentially:
- Set current_block to the last block that is “final” in a view.
- Look through current_block’s children and find the one with the heaviest weight. Select that child as the new current_block.
- Repeat step 2 until the current_block has no children.
When the current_block has no children, you have reached a tip of the blockchain. If you want to make a new block, use this block as the block to point to with your previous block pointer. This is your new bet/block!
What is Weight? How is it related to deposit?
In the case of PoS, weight == deposit. But as CBC Casper is specified a general purpose consensus protocol, there is no need to say it will always be a deposit. You can imagine giving all the validators the same weight, and just having a “regular” consensus protocol where the participating nodes are known and all equal.
What is safety and what algorithm is used to decide that a block is safe? Is it a simple weighted sum of most recent bet estimates, if yes, how is the threshold determined? One could imagine a network where the threshold sum would be determined by machine learning essentially as a regression algorithm.
There are a couple different safety oracles that can be used to determine if a block is safe. You can see implementations of them here. Most of them come from the “ideal adversary” line of thinking. The idea here is essentially: if the entire world was trying to convince me that this block will not end up in the main blockchain, and they can’t do it, then this block is absolutely going to be in the main chain. The ideal adversary essentially simulates the entire world conspiring to remove the block from the chain - and if it can’t do it, then no one can.