Closed irriden closed 11 months ago
@irriden That is not correct, you need to include the server_hmac
even if the muts are empty.
The signer actually remembers the muts that were sent to the broker, and compares the HMAC with the locally saved muts https://github.com/stakwork/sphinx-rs/blob/master/lss-connector/src/signer.rs#L164. That is why in most cases, the broker actually sends empty muts back (no need to send back the exact same muts that were received, as that is just a waste of networking and deserializing on the signer side). However the muts
are still needed in the BrokerMutations object because that is how the initial state sync in transferred
So the server_hmac
is always required EXCEPT in cases where lss-connector/broker put_muts
is called but the muts are actually empty. So put_muts
should actually return an Option<[u8; 32]>
, (None in the case of empty muts) which can directly be added to the BrokerMutations
looks good to me, feel free to merge whenever
Attempts to close #25
My biggest question is regarding the changes in
lss-connector/src/broker.rs
in 309be0bd73dc3b0205bcae6c18ba2d111fbfc499. Whenever we set the muts toVec::new
I setserver_hmac
toNone
.Next will test the flow with these changes.