mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Add a test to the coordinator for running a Tributary
Impls a LocalP2p for testing. Moves rebroadcasting into Tendermint, since it's what knows if a message is fully valid + original. Removes TributarySpec::validators() HashMap, as its non-determinism caused different instances to have different round robin schedules. It was already prior moved to a Vec for this issue, so I'm unsure why this remnant existed. Also renames the GH no-std workflow from the prior commit.
This commit is contained in:
@@ -70,7 +70,7 @@ async fn handle_block<D: Db, Pro: Processor, P: P2p>(
|
||||
|
||||
// If they've already published a TX for this attempt, slash
|
||||
if let Some(data) =
|
||||
TributaryDb::<D>::data(label, &txn, tributary.genesis(), id, attempt, &signed.signer)
|
||||
TributaryDb::<D>::data(label, &txn, tributary.genesis(), id, attempt, signed.signer)
|
||||
{
|
||||
if data != bytes {
|
||||
// TODO: Full slash
|
||||
@@ -99,17 +99,18 @@ async fn handle_block<D: Db, Pro: Processor, P: P2p>(
|
||||
tributary.genesis(),
|
||||
id,
|
||||
attempt,
|
||||
&signed.signer,
|
||||
signed.signer,
|
||||
&bytes,
|
||||
);
|
||||
|
||||
// If we have all the needed commitments/preprocesses/shares, tell the processor
|
||||
// TODO: This needs to be coded by weight, not by validator count
|
||||
if received == needed {
|
||||
let mut data = HashMap::new();
|
||||
for validator in spec.validators().keys() {
|
||||
for validator in spec.validators().iter().map(|validator| validator.0) {
|
||||
data.insert(
|
||||
spec.i(*validator).unwrap(),
|
||||
if validator == &signed.signer {
|
||||
spec.i(validator).unwrap(),
|
||||
if validator == signed.signer {
|
||||
bytes.split_off(0)
|
||||
} else if let Some(data) =
|
||||
TributaryDb::<D>::data(label, &txn, tributary.genesis(), id, attempt, validator)
|
||||
|
||||
Reference in New Issue
Block a user