Open vncoelho opened 1 year ago
@ZhangTao1596, I am not sure this is just for dBFT 3.0. But also for dBFT 2.0.
In fact, it is even described in the current code. I think we wrote that some long time ago.
" // A possible attack can happen if the last node to commit is malicious and either sends change view after his // commit to stall nodes in a higher view, or if he refuses to send recovery messages. In addition, if a node // asking change views loses network or crashes and comes back when nodes are committed in more than one higher // numbered view, it is possible for the node accepting recovery to commit in any of the higher views, thus // potentially splitting nodes among views and stalling the network."
It also looks like this logic is not correct anymore:
public bool NotAcceptingPayloadsDueToViewChanging => ViewChanging && !MoreThanFNodesCommittedOrLost;
public bool MoreThanFNodesCommittedOrLost => (CountCommitted + CountFailed) > F;
@vncoelho Could you add a test in order to ensure that v2 is affected?
I could, but all test structure was removed when dbft was migrated to a Module, from neo core to here.
We need to add that previous infrastructure for akka testing here.
We need to mock everything here as we used to do before, @shargon.
Do you have a good direction for starting it to work? I could them add all tests. (ping @erikzhang)
I think this problem has always exists in master branch.
Primary node will create different PrepareReqeust
after restart if it hasn't committed, So that it will refuse previous PrepareResponse
in RecoveryMessage
.
@ZhangTao1596, this point you mentioned is another problem related to the PrepareRequest
, which should also be fixed in the future. Perhaps it is good to open another issue explaining that one in order that we do not forget this possibility.
Bug found while testing dBFT 3.0 PR.
However, it is suspected that this can also happen on current version: