Skip to content
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

Reduce chance of Commits in different views if a node restarts. #643

Closed
wants to merge 49 commits into from
Closed
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
aa16b7f
Prevent commit after ChangeView.
jsolman Mar 18, 2019
d686236
Minor simplification.
jsolman Mar 18, 2019
0d98768
Minimize differences.
jsolman Mar 18, 2019
d9ea44e
Don't consider view changing once F nodes committed.
jsolman Mar 19, 2019
57065f8
Add a comment describing current potential issues.
jsolman Mar 19, 2019
442bfe8
Save consensus context upon changing view to prevent split commit.
jsolman Mar 19, 2019
f471b32
Adjust comment concerning potential issues.
jsolman Mar 19, 2019
7d5b201
Further improve comment.
jsolman Mar 19, 2019
470b35c
Reduce to minimal changes to fix the main issue that can cause the ne…
jsolman Mar 19, 2019
b5ec0b4
Don't save transactions when saving consensus state for view changes.
jsolman Mar 19, 2019
0701fc1
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 19, 2019
bfb729e
Rename helper method that checks if F nodes are already committed.
jsolman Mar 19, 2019
76bd576
Greater than F nodes must have committed for it to not be possible fo…
jsolman Mar 19, 2019
d64c2b7
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 19, 2019
ee72d58
Rename flag to MoreThanFNodesCommitted.
jsolman Mar 19, 2019
b3c8ee8
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 19, 2019
8ce9b8a
Minor simplification.
jsolman Mar 19, 2019
3dcc435
Merge branch 'master' into consensus/preventStall
vncoelho Mar 19, 2019
dfe7464
Whitespace adjustmnet.
jsolman Mar 20, 2019
8f2bf77
White line adjustment.
jsolman Mar 20, 2019
af62c52
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 20, 2019
b18735e
Merge branch 'master' into consensus/preventStall
jsolman Mar 20, 2019
aa365fd
Make a new flag for clarity. Add TODO for fixing counting committed p…
jsolman Mar 20, 2019
4959176
Keep track of commit payloads in all views to support counting commits.
jsolman Mar 20, 2019
abb8063
Merge branch 'master' into consensus/preventStall
jsolman Mar 20, 2019
68f5235
Rename flag for clarity.
jsolman Mar 20, 2019
eee35cc
Remove unnecessary change of recording commit from another view.
jsolman Mar 20, 2019
2f053f1
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 20, 2019
4ab9b6c
Fix typo in comment.
jsolman Mar 20, 2019
f19d84d
If we already have a commit for the validator at the current view, we…
jsolman Mar 20, 2019
2e7d8ad
Fix typo in comment.
jsolman Mar 20, 2019
28b45cc
If we already have a commit for the validator at the current view, we…
jsolman Mar 20, 2019
3664c56
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 20, 2019
b6bf4da
Add warning log for receiving a different commit from a validator. A …
jsolman Mar 20, 2019
0dcf20a
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 20, 2019
ce7685b
minor changes
erikzhang Mar 21, 2019
b8beafc
use `LogLevel.Warning`
erikzhang Mar 21, 2019
731b915
Merge branch 'master' into consensus/preventStall
erikzhang Mar 21, 2019
7ba991b
Check `ViewNumber` in `OnPrepareRequestReceived()` and `OnPrepareResp…
erikzhang Mar 21, 2019
6fc4864
Simplify `OnRecoveryMessageReceived()`
erikzhang Mar 21, 2019
b7e7981
minor change
erikzhang Mar 21, 2019
9838afc
Fix a merge issue. OnConsensusPayload method should not be accepting …
jsolman Mar 21, 2019
663a8ae
Revert "Fix a merge issue. OnConsensusPayload method should not be ac…
jsolman Mar 21, 2019
d0f89c6
Merge branch 'master' into consensus/preventStall
jsolman Mar 21, 2019
c3005ac
Merge branch 'master' into consensus/preventStall
shargon Mar 21, 2019
72a4253
Merge branch 'consensus/preventStall' into consensus/preventStall2
jsolman Mar 21, 2019
ded8a68
Merge branch 'master' into consensus/preventStall2
erikzhang Mar 25, 2019
c721b4a
Merge branch 'master' into consensus/preventStall2
shargon Mar 26, 2019
6d3ae34
Merge branch 'master' into consensus/preventStall2
vncoelho Apr 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions neo/Consensus/ConsensusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ private void CheckExpectedView(byte viewNumber)
localNode.Tell(new LocalNode.SendDirectly { Inventory = context.MakeChangeView(viewNumber) });
}
InitializeConsensus(viewNumber);
// Save View Change without Transactions for restoring after a restart.
var savedTransactions = context.Transactions;
context.Transactions = null;
jsolman marked this conversation as resolved.
Show resolved Hide resolved
context.Save();
context.Transactions = savedTransactions;
}
jsolman marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down Expand Up @@ -491,10 +496,11 @@ private void OnStart(Start options)
return;
}
}
InitializeConsensus(0);
// Issue a ChangeView with NewViewNumber of 0 to request recovery messages on start-up.
InitializeConsensus(context.ViewNumber);

// Issue a ChangeView with NewViewNumber of context.ViewNumber to request recovery messages on start-up.
if (!context.WatchOnly())
SendChangeViewToRequestRecovery(0);
SendChangeViewToRequestRecovery(context.ViewNumber);
}

private void OnTimer(Timer timer)
Expand Down