mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Move message_queue over to deduplication via intents
Due to each service having multiple distinct clocks, we can't expect a stable ordering except the ordering an intact message-queue provides. The messages emitted should be consistent however, solely with unknown order, which is why we can craft intents based on their contents (already implemented by processor-messages).
This commit is contained in:
@@ -27,13 +27,13 @@ lazy_static::lazy_static! {
|
||||
fn queue_message(meta: Metadata, msg: Vec<u8>, sig: SchnorrSignature<Ristretto>) {
|
||||
{
|
||||
let from = (*KEYS).read().unwrap()[&meta.from];
|
||||
assert!(sig.verify(from, message_challenge(from, &msg, sig.R)));
|
||||
assert!(sig.verify(from, message_challenge(from, meta.to, &meta.intent, &msg, sig.R)));
|
||||
}
|
||||
|
||||
// Assert one, and only one of these, is the coordinator
|
||||
assert!(matches!(meta.from, Service::Coordinator) ^ matches!(meta.to, Service::Coordinator));
|
||||
|
||||
// TODO: Verify the from_id hasn't been prior seen
|
||||
// TODO: Verify the intent hasn't been prior seen
|
||||
|
||||
// Queue it
|
||||
(*QUEUES).read().unwrap()[&meta.to].write().unwrap().queue_message(QueuedMessage {
|
||||
|
||||
Reference in New Issue
Block a user