concorde icon indicating copy to clipboard operation
concorde copied to clipboard

test: sends messages

Open jonnadal opened this issue 4 years ago • 1 comments

This PR builds upon https://github.com/graydon/concorde/pull/1

I loaded ConcordeSystem::simple() into Stateright's Explorer and noticed that the latest version isn't sending any messages. This commit simply adds a regression test, which is currently failing.

The commit also adds #derive(Clone) to ConcordeActor and ConcordeSystem as those are necessary for using the Explorer.

jonnadal avatar Jul 11 '20 19:07 jonnadal

@graydon I noticed that a recent change altered a filter to require an ordering relationship between items, whereas the older code would allow None w/ regard to the partial order. Not sure if that was intended, so I introduced a change to adopt the old behavior (not yet part of this PR):

diff --git a/src/participant.rs b/src/participant.rs
index 35f141c..6b4bca9 100644
--- a/src/participant.rs
+++ b/src/participant.rs
@@ -119,7 +119,10 @@ impl<ObjLD: LatticeDef + 'static, Peer: DefTraits + 'static> Participant<ObjLD,
             .new_opinion
             .proposed_configs
             .iter()
-            .filter(|u| { *u >= commit_cfg })
+            .filter(|u| {
+                <crate::cfg::CfgLD<Peer> as LatticeDef>::partial_order(&u.value, &commit_cfg.value)
+                    != Some(std::cmp::Ordering::Less)
+            })
             .cloned()
             .collect();
     }

That change results in messages being sent, but then the liveness property is violated, which leads me to think that I might not be on the right track. Thoughts?

jonnadal avatar Jul 11 '20 21:07 jonnadal