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

core/qbft: send qcommit as decided message #508

Merged
merged 3 commits into from
May 10, 2022
Merged

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented May 10, 2022

Broadcasting individual COMMIT messages after Decided can result in some being dropped. This can postpone finality in lossy networks.

Rather batch Qcommit as justification of a new message type MsgDecided. This ensures that if a valid justified MsgDecided is received, that any process will decide. This also makes sending Qcommit explicit and aligns the API with that other messages, mitigating requirement of special case handling.

Also ensure that when filtering/counting messages, that only unique sources/processes are included. Generalise this via uniq := uniqSource helper function.

category: refactor
ticket: #445

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #508 (f71ad70) into main (2558bb0) will decrease coverage by 0.05%.
The diff coverage is 56.09%.

@@            Coverage Diff             @@
##             main     #508      +/-   ##
==========================================
- Coverage   56.34%   56.28%   -0.06%     
==========================================
  Files          87       87              
  Lines        8001     8029      +28     
==========================================
+ Hits         4508     4519      +11     
- Misses       2894     2908      +14     
- Partials      599      602       +3     
Impacted Files Coverage Δ
core/qbft/msgtype_string.go 40.00% <0.00%> (-10.00%) ⬇️
core/qbft/uponrule_string.go 40.00% <ø> (ø)
core/qbft/qbft.go 65.53% <57.50%> (-0.49%) ⬇️
p2p/discovery.go 43.28% <0.00%> (-5.98%) ⬇️
app/app.go 64.20% <0.00%> (-0.30%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2558bb0...f71ad70. Read the comment docs.

for _, prepare := range prepares {
if !uniq(prepare) {
Copy link
Contributor Author

@corverroos corverroos May 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when counting/filtering messages, ensure that only one message per source/process is counted.

@@ -695,7 +717,7 @@ func filterRoundChange[I any, V Value[V]](msgs []Msg[I, V], round int64) []Msg[I
func filterMsgs[I any, V Value[V]](msgs []Msg[I, V], typ MsgType, round int64, value *V, pr *int64, pv *V) []Msg[I, V] {
var (
resp []Msg[I, V]
dups = make(map[dedupKey]bool)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already did this in filterMsgs but since we do not always use this function, generalise the uniqSource[I, V]() helper function

@@ -142,6 +142,20 @@ func TestQBFT(t *testing.T) {
RandomRound: true,
})
})

t.Run("drop 30% const", func(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this issue was uncovered when running multiple 30% lossy tests

cancel()
return
}
t.Logf("%s %v => %v@%d", clock.NowStr(), source, typ, round)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more test logs

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 10, 2022
@obol-bulldozer obol-bulldozer bot merged commit db999b9 into main May 10, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/qbftdecide branch May 10, 2022 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants