witnet-rust icon indicating copy to clipboard operation
witnet-rust copied to clipboard

Stakes data structure does not correctly track multiple validators with the same withdrawer

Open drcpu-github opened this issue 1 year ago • 0 comments

Staking onto two validators with the same external withdraw address results in the by_withdrawer data stucture only tracking the latest one. However, this is actually a valid move and it is just the by_withdrawer map which cannot index that properly because it only has one SyncStake entry per withdrawer address and each of those entries is tied to a <validator, withdrawer> key.

It's basically the same bug as the one I already shared for by_validator, but more serious because the former is technically invalid if we implement all WIP validation rules.

drcpu-github avatar May 30 '24 19:05 drcpu-github