-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robustness: DELA network breaks down after 256 rounds #269
Comments
Congratulation for daring to go beyond 255 blocks, you found a pretty nasty bug 😁. The symptom that we see is that node-0 rejects the chain it receives from itself during the periodic sync that happens among nodes. When nodes receive a sync message, they first validate the chain of links present in the sync message by checking that each forward and backward links correspond. The chain is stored in a key-value store, where each key is the index of the block. When we create the chain of links (which is a lighter version of the blockchain) for validation, we iterate over all keys from the key-value store in a sorted order by key, which should naturally provide blocks from the genesis to the latest one. (genesis block has index 0, next block 1, etc...) When we store a block, we compute the key that we use for the key-value store with this function:
func (s *InDisk) makeKey(index uint64) []byte {
key := make([]byte, 8)
binary.LittleEndian.PutUint64(key, index)
return key
} Can you see why there is a problem after 255 ? |
so what you are saying is that when they index hits 256 and therefore the "next byte" and the lowest byte becomes 0, Bolt is not correctly interpreting the position of the key in the ordering anymore since we are using LitteEndian so changing it to BigEndian should solve the problem? |
(moved this to Dela is the problem is clearly on this side) |
yes :) |
Is included in c4dt/dela |
after round 255 the following happens:
and then no new transactions can be added to the block chain anymore (i.e. no new forms, votes, ...)
I do not understand DELA enough to guess at an answer, the only thing that seems suspicious to me is the following line in the logs:
d-voting-dela-worker-0-1 | 2023-09-06T13:09:13Z DBG pkg/mod/go.dedis.ch/[email protected]/core/ordering/cosipbft/mod.go:551 > round has started addr=dela-worker-0:2000 index=257
d-voting-dela-worker-0-1 | 2023-09-06T13:09:13Z DBG pkg/mod/go.dedis.ch/[email protected]/core/ordering/cosipbft/blocksync/default.go:230 > received synchronization message addr=dela-worker-0:2000 index=255
when before that the index has always been increasing
To reproduce: on a clean install, create a form and add votes up until 256
The text was updated successfully, but these errors were encountered: