mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 21:19:24 +00:00
Remove Session from VariantSignId::SlashReport
It's only there to make the VariantSignid unique across Sessions. By localizing the VariantSignid to a Session, we avoid this, and can better ensure we don't queue work for historic sessions.
This commit is contained in:
@@ -79,8 +79,7 @@ impl<D: Db, S: ScannerFeed> ContinuallyRan for SlashReportSignerTask<D, S> {
|
||||
}
|
||||
}
|
||||
let mut txn = self.db.txn();
|
||||
for msg in self.attempt_manager.register(VariantSignId::SlashReport(self.session), machines)
|
||||
{
|
||||
for msg in self.attempt_manager.register(VariantSignId::SlashReport, machines) {
|
||||
SlashReportSignerToCoordinatorMessages::send(&mut txn, self.session, &msg);
|
||||
}
|
||||
txn.commit();
|
||||
@@ -102,14 +101,15 @@ impl<D: Db, S: ScannerFeed> ContinuallyRan for SlashReportSignerTask<D, S> {
|
||||
}
|
||||
}
|
||||
Response::Signature { id, signature } => {
|
||||
let VariantSignId::SlashReport(session) = id else {
|
||||
panic!("SlashReportSignerTask signed a non-SlashReport")
|
||||
};
|
||||
assert_eq!(session, self.session);
|
||||
assert_eq!(id, VariantSignId::SlashReport);
|
||||
// Drain the channel
|
||||
SlashReport::try_recv(&mut txn, self.session).unwrap();
|
||||
// Send the signature
|
||||
SlashReportSignature::send(&mut txn, session, &Signature::from(signature).encode());
|
||||
SlashReportSignature::send(
|
||||
&mut txn,
|
||||
self.session,
|
||||
&Signature::from(signature).encode(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user