From d5592c379c90a51a1585eb60992ede9203f17de4 Mon Sep 17 00:00:00 2001 From: plebhash Date: Thu, 27 Jun 2024 21:46:58 -0300 Subject: [PATCH] fix GetSize for SubmitSolutionJd the GetSize implementation is not accounting for self.version.get_size()! that is causing NoiseEncoder to allocate a buffer that's smaller than what is actually needed, which eventually triggers FramingSv2Error(BinarySv2Error(WriteError)) during encoding --- protocols/v2/subprotocols/job-declaration/src/submit_solution.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/protocols/v2/subprotocols/job-declaration/src/submit_solution.rs b/protocols/v2/subprotocols/job-declaration/src/submit_solution.rs index 4b7c30e4ca..9687313ced 100644 --- a/protocols/v2/subprotocols/job-declaration/src/submit_solution.rs +++ b/protocols/v2/subprotocols/job-declaration/src/submit_solution.rs @@ -30,5 +30,6 @@ impl<'d> GetSize for SubmitSolutionJd<'d> { + self.ntime.get_size() + self.nonce.get_size() + self.nbits.get_size() + + self.version.get_size() } }