@@ -920,25 +920,7 @@ let add_complete_work ~logger ~fee ~prover
920920  Or_error. try_with update_metrics
921921  |>  Result. iter_error ~f: (fun  err  ->
922922         [% log warn] " Failed to update metrics on adding work" 
923-            ~metadata: [ (" error" `String  (Error. to_string_hum err)) ] ) ;
924-   let  cb  result  = 
925-     (*  remove it from seen jobs after attempting to adding it to the pool to
926-            avoid this work being reassigned. 
927-      * If the diff is accepted then remove it from the seen jobs. 
928-      * If not then the work should have already been in the pool with a  
929-            lower fee or the statement isn't referenced anymore or any other  
930-            error. In any case remove it from the seen jobs so that it can be  
931-            picked up if needed *)  
932-     Work_selector. remove t.work_selector stmts ;
933-     Result. iter_error result ~f: (fun  err  ->
934-         (*  Possible reasons of failure: receiving pipe's capacity exceeded,
935-             fee that isn't the lowest, failure in verification or application to the pool *)  
936-         [% log warn] " Failed to add completed work to the pool" 
937-           ~metadata: 
938-             [ (" work_ids" Transaction_snark_work.Statement. compact_json stmts)
939-             ; (" error" `String  (Error. to_string_hum err))
940-             ] )
941-   in 
923+            ~metadata: [ (" error" Error_json. error_to_yojson err) ] ) ;
942924  Network_pool.Snark_pool. (
943925    Local_sink. push t.pipes.snark_local_sink
944926      ( Add_solved_work 
@@ -949,7 +931,15 @@ let add_complete_work ~logger ~fee ~prover
949931                  |>  One_or_two. map ~f: Ledger_proof.Cached. read_proof_from_disk
950932              ; fee =  fee_with_prover
951933              } )
952-       , cb ))
934+       , Result. iter_error ~f: (fun  err  ->
935+             (*  Possible reasons of failure: receiving pipe's capacity exceeded,
936+                 fee that isn't the lowest, failure in verification or application to the pool *)  
937+             [% log warn] " Failed to add completed work to the pool" 
938+               ~metadata: 
939+                 [ ( " work_ids" 
940+                   , Transaction_snark_work.Statement. compact_json stmts )
941+                 ; (" error" Error_json. error_to_yojson err)
942+                 ] ) ))
953943  |>  Deferred. don't_wait_for
954944
955945let  add_work  t  (work  : Snark_work_lib.Result.Partitioned.Stable.Latest.t ) = 
@@ -1778,9 +1768,8 @@ let create ~commit_id ?wallets (config : Config.t) =
17781768          |  Ok  ()  ->
17791769              () 
17801770          |  Error  err  ->
1781-               [% log' warn config.logger]
1782-                 " Error when setting ITN logger data: %s" 
1783-                 (Error. to_string_hum err)
1771+               [% log' warn config.logger] " Error when setting ITN logger data" 
1772+                 ~metadata: [ (" error" Error_json. error_to_yojson err) ]
17841773        else  Deferred. unit 
17851774      in 
17861775      O1trace. thread " mina_lib" fun  ()  ->
@@ -1866,13 +1855,13 @@ let create ~commit_id ?wallets (config : Config.t) =
18661855              Or_error. iter_error result ~f: (fun  error  ->
18671856                  [% log' warn config.logger]
18681857                    " Failed to toggle verifier internal tracing: $error" 
1869-                     ~metadata: [ (" error" `String  ( Error. to_string_hum  error) ) ] ) ) ;
1858+                     ~metadata: [ (" error" Error_json. error_to_yojson  error) ] ) ) ;
18701859          Internal_tracing. register_toggle_callback (fun  enabled  ->
18711860              let % map result =  Prover. toggle_internal_tracing prover enabled in 
18721861              Or_error. iter_error result ~f: (fun  error  ->
18731862                  [% log' warn config.logger]
18741863                    " Failed to toggle prover internal tracing: $error" 
1875-                     ~metadata: [ (" error" `String  ( Error. to_string_hum  error) ) ] ) ) ;
1864+                     ~metadata: [ (" error" Error_json. error_to_yojson  error) ] ) ) ;
18761865          let % bind vrf_evaluator = 
18771866            Monitor. try_with ~here: [% here]
18781867              ~rest: 
@@ -2137,7 +2126,6 @@ let create ~commit_id ?wallets (config : Config.t) =
21372126          in 
21382127          let  work_selector = 
21392128            Work_selector.State. init
2140-               ~reassignment_wait: config.work_reassignment_wait
21412129              ~frontier_broadcast_pipe: frontier_broadcast_pipe_r
21422130              ~logger: config.logger
21432131          in 
0 commit comments