From 3a7ae8304e71c69e546c214045a2befbf7a21c8d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 29 Jan 2026 15:07:40 +0100 Subject: [PATCH] fix: fetch_owned should not include reserved Reserved triple ids are not assigned to a owner, yet. Including them is inconsistent. There is also a race condition, where a triple is already stored with another owner but `unreserve` has not been called, yet. during that time, a triple will be returned for two different owners. For Presignatures, the owner is known ahead of time. But it is still wrong to assume that all reserved ids will be owned by this node. --- chain-signatures/node/src/storage/protocol_storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain-signatures/node/src/storage/protocol_storage.rs b/chain-signatures/node/src/storage/protocol_storage.rs index e2c6f7c1..400ccf12 100644 --- a/chain-signatures/node/src/storage/protocol_storage.rs +++ b/chain-signatures/node/src/storage/protocol_storage.rs @@ -171,7 +171,7 @@ impl ProtocolStorage { }) .unwrap_or_default(); - owned.union(&*self.reserved.read().await).copied().collect() + owned.into_iter().collect() } pub async fn reserve(&self, id: A::Id) -> Option> {