Repository: MinaProtocol/mina
Pull request #16489: Use headers in Best_tip_prover.verify
Author: login: georgeee
Created: 2025-01-21T20:02:14Z | Merged: 2025-03-31T18:54:20Z

Use headers in `Best_tip_prover.verify`.
Use of block-containing structures there is completely unjustified.

This PR changes signature of `Best_tip_prover.verify` to work on headers rather than blocks. Motivation is that headers are just enough. Integration of the updated function into some parts of code look a bit unusual, but that's mainly due to the codebase working with `Mina_block.t` in so many places where `Mina_block.Header.t` would suffice. Eventually we'll refactor many of these places.

This change is useful for RAM optimizations work. Without it in some contexts we would either be obliged to convert between `Mina_block.t` and `Mina_block.Stable.Latest.t` (which will become different, with former containing a cache tag instead of the actual ledger proof), or to define `Best_tip_prover.verify` for both cached and uncached blocks. It only seemed natural to stop relying on blocks in `Best_tip_prover.verify`.

Explain how you tested your changes:
* It's a refactoring that doesn't change any behavior
* It compiles :)

Checklist:

- [x] Dependency versions are unchanged
  - Notify Velocity team if dependencies must change in CI
- [x] Modified the current draft of release notes with details on what is completed or incomplete within this project
- [x] Document code purpose, how to use it
  - Mention expected invariants, implicit constraints
- [x] Tests were added for the new behavior
  - Document test purpose, significance of failures
  - Test names should reflect their purpose
- [x] All tests pass (CI will check this if you didn't)
- [x] Serialized types are in stable-versioned modules
- [x] Does this close issues? None



Diff:
diff --git a/src/lib/best_tip_prover/best_tip_prover.ml b/src/lib/best_tip_prover/best_tip_prover.ml
index 2a757e0a1d3c..82eed13fe0b4 100644
--- a/src/lib/best_tip_prover/best_tip_prover.ml
+++ b/src/lib/best_tip_prover/best_tip_prover.ml
@@ -2,7 +2,6 @@ open Core_kernel
 open Mina_base
 open Mina_state
 open Async_kernel
-open Mina_block
 
 module type Inputs_intf = sig
   module Transition_frontier : module type of Transition_frontier
@@ -28,7 +27,8 @@ module Make (Inputs : Inputs_intf) :
 
     let get_previous ~context transition =
       let parent_hash =
-        transition |> Mina_block.Validated.header |> Header.protocol_state
+        transition |> Mina_block.Validated.header
+        |> Mina_block.Header.protocol_state
         |> Protocol_state.previous_state_hash
       in
       let open Option.Let_syntax in
@@ -88,24 +88,19 @@ module Make (Inputs : Inputs_intf) :
       }
 
   let validate_proof ~verifier ~genesis_state_hash
-      (transition_with_hash : Mina_block.with_hash) :
-      Mina_block.initial_valid_block Deferred.Or_error.t =
-    let validate (b, v) =
-      let open Deferred.Result.Let_syntax in
-      let h = (With_hash.map ~f:Mina_block.header b, v) in
-      Deferred.return (Validation.validate_protocol_versions h)
-      >>= Fn.compose Deferred.return
-            (Validation.validate_genesis_protocol_state ~genesis_state_hash)
-      >>= Validation.validate_single_proof ~verifier ~genesis_state_hash
-      >>| Fn.flip Validation.with_body (Mina_block.body @@ With_hash.data b)
-    in
+      (header_hashed : Mina_block.Header.with_hash) :
+      Mina_block.initial_valid_header Deferred.Or_error.t =
+    let open Mina_block.Validation in
     let%map validation =
-      Validation.wrap transition_with_hash
-      |> Validation.skip_time_received_validation
-           `This_block_was_not_received_via_gossip
-      |> Validation.skip_delta_block_chain_validation
+      wrap_header header_hashed
+      |> skip_time_received_validation `This_block_was_not_received_via_gossip
+      |> skip_delta_block_chain_validation
            `This_block_was_not_received_via_gossip
-      |> validate
+      |> validate_protocol_versions
+      |> Result.bind ~f:(validate_genesis_protocol_state ~genesis_state_hash)
+      |> Deferred.return
+      |> Deferred.Result.bind
+           ~f:(validate_single_proof ~verifier ~genesis_state_hash)
     in
     match validation with
     | Ok block ->
@@ -132,11 +127,13 @@ module Make (Inputs : Inputs_intf) :
     let genesis_state_hash =
       State_hash.With_state_hashes.state_hash genesis_protocol_state
     in
-    let state_hashes block =
-      Mina_block.header block |> Header.protocol_state |> Protocol_state.hashes
+    let state_hashes h =
+      Mina_block.Header.protocol_state h |> Protocol_state.hashes
+    in
+    let root_with_hash = With_hash.of_data root ~hash_data:state_hashes in
+    let root_is_genesis =
+      State_hash.(root_with_hash.hash.state_hash = genesis_state_hash)
     in
-    let root_state_hash = (state_hashes root).state_hash in
-    let root_is_genesis = State_hash.(root_state_hash = genesis_state_hash) in
     let%bind () =
       Deferred.return
         (Result.ok_if_true
@@ -150,16 +147,11 @@ module Make (Inputs : Inputs_intf) :
     let best_tip_with_hash =
       With_hash.of_data best_tip ~hash_data:state_hashes
     in
-    let root_transition_with_hash =
-      With_hash.of_data root ~hash_data:state_hashes
-    in
     let%bind (_ : State_hash.t Mina_stdlib.Nonempty_list.t) =
       Deferred.return
         (Result.of_option
            (Merkle_list_verifier.verify
-              ~init:
-                (State_hash.With_state_hashes.state_hash
-                   root_transition_with_hash )
+              ~init:(State_hash.With_state_hashes.state_hash root_with_hash)
               merkle_list
               (State_hash.With_state_hashes.state_hash best_tip_with_hash) )
            ~error:
@@ -169,10 +161,11 @@ module Make (Inputs : Inputs_intf) :
     in
     let%map root, best_tip =
       Deferred.Or_error.both
-        (validate_proof ~genesis_state_hash ~verifier root_transition_with_hash)
+        (validate_proof ~genesis_state_hash ~verifier root_with_hash)
         (validate_proof ~genesis_state_hash ~verifier best_tip_with_hash)
     in
-    (`Root root, `Best_tip best_tip)
+    ( `Root (root : Mina_block.Validation.initial_valid_with_header)
+    , `Best_tip (best_tip : Mina_block.Validation.initial_valid_with_header) )
 end
 
 include Make (struct
diff --git a/src/lib/block_producer/block_producer.ml b/src/lib/block_producer/block_producer.ml
index 678ee2954322..9ef323f95f0b 100644
--- a/src/lib/block_producer/block_producer.ml
+++ b/src/lib/block_producer/block_producer.ml
@@ -865,19 +865,20 @@ let produce ~genesis_breadcrumb ~context:(module Context : CONTEXT) ~prover
                 |> Option.value_exn
               in
               [%log internal] "Produce_validated_transition" ;
+              let header =
+                Header.create ~protocol_state ~protocol_state_proof
+                  ~delta_block_chain_proof ()
+              in
+              let body = Body.create staged_ledger_diff in
               let%bind transition =
                 let open Result.Let_syntax in
-                Validation.wrap
-                  { With_hash.hash = protocol_state_hashes
-                  ; data =
-                      (let body = Body.create staged_ledger_diff in
-                       Mina_block.create ~body
-                         ~header:
-                           (Header.create ~protocol_state ~protocol_state_proof
-                              ~delta_block_chain_proof () ) )
-                  }
+                Validation.wrap_header
+                  { With_hash.hash = protocol_state_hashes; data = header }
+                |> Validation.skip_delta_block_chain_validation
+                     `This_block_was_not_received_via_gossip
                 |> Validation.skip_time_received_validation
                      `This_block_was_not_received_via_gossip
+                |> Fn.flip Validation.with_body body
                 |> Validation.skip_protocol_versions_validation
                      `This_block_has_valid_protocol_versions
                 |> validate_genesis_protocol_state_block
@@ -887,8 +888,6 @@ let produce ~genesis_breadcrumb ~context:(module Context : CONTEXT) ~prover
                           previous_protocol_state )
                 >>| Validation.skip_proof_validation
                       `This_block_was_generated_internally
-                >>| Validation.skip_delta_block_chain_validation
-                      `This_block_was_not_received_via_gossip
                 >>= Validation.validate_frontier_dependencies
                       ~to_header:Mina_block.header
                       ~context:(module Context)
@@ -1425,25 +1424,24 @@ let run_precomputed ~context:(module Context : CONTEXT) ~verifier ~trust_system
           let previous_protocol_state_hash =
             State_hash.With_state_hashes.state_hash previous_transition
           in
+          let header =
+            Header.create ~protocol_state ~protocol_state_proof
+              ~delta_block_chain_proof ()
+          in
+          let body = Body.create staged_ledger_diff in
           let%bind transition =
             let open Result.Let_syntax in
-            Validation.wrap
-              { With_hash.hash = protocol_state_hashes
-              ; data =
-                  (let body = Body.create staged_ledger_diff in
-                   Mina_block.create ~body
-                     ~header:
-                       (Header.create ~protocol_state ~protocol_state_proof
-                          ~delta_block_chain_proof () ) )
-              }
+            Validation.wrap_header
+              { With_hash.hash = protocol_state_hashes; data = header }
+            |> Validation.skip_delta_block_chain_validation
+                 `This_block_was_not_received_via_gossip
             |> Validation.skip_time_received_validation
                  `This_block_was_not_received_via_gossip
+            |> Fn.flip Validation.with_body body
             |> Validation.skip_protocol_versions_validation
                  `This_block_has_valid_protocol_versions
             |> Validation.skip_proof_validation
                  `This_block_was_generated_internally
-            |> Validation.skip_delta_block_chain_validation
-                 `This_block_was_not_received_via_gossip
             |> validate_genesis_protocol_state_block
                  ~genesis_state_hash:
                    (Protocol_state.genesis_state_hash
diff --git a/src/lib/bootstrap_controller/bootstrap_controller.ml b/src/lib/bootstrap_controller/bootstrap_controller.ml
index 76212bde2ab8..905673d47e55 100644
--- a/src/lib/bootstrap_controller/bootstrap_controller.ml
+++ b/src/lib/bootstrap_controller/bootstrap_controller.ml
@@ -175,9 +175,11 @@ let on_transition ({ context = (module Context); _ } as t) ~sender
         Deferred.return `Ignored
     | Ok peer_root_with_proof -> (
         match%bind
-          Sync_handler.Root.verify
-            ~context:(module Context)
-            ~verifier:t.verifier candidate_consensus_state
+          Mina_block.verify_on_header
+            ~verify:
+              (Sync_handler.Root.verify
+                 ~context:(module Context)
+                 ~verifier:t.verifier candidate_consensus_state )
             peer_root_with_proof.data
         with
         | Ok (`Root root, `Best_tip best_tip) ->
diff --git a/src/lib/ledger_catchup/normal_catchup.ml b/src/lib/ledger_catchup/normal_catchup.ml
index 0e1f9976faf7..6c5b16824cd8 100644
--- a/src/lib/ledger_catchup/normal_catchup.ml
+++ b/src/lib/ledger_catchup/normal_catchup.ml
@@ -56,11 +56,14 @@ end
     After building the breadcrumb path, [Ledger_catchup] will then send it to
     the [Processor] via writing them to catchup_breadcrumbs_writer. *)
 
-let validate_block ~genesis_state_hash (b, v) =
+(** Validates block without time received validation *)
+let validate_block_skipping_time_received ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
+    `This_block_was_not_received_via_gossip h
+  |> validate_genesis_protocol_state ~genesis_state_hash
   >>= validate_protocol_versions >>= validate_delta_block_chain
   >>| Fn.flip with_body (Mina_block.body @@ With_hash.data b)
 
@@ -85,10 +88,8 @@ let verify_transition ~context:(module Context : CONTEXT) ~trust_system
   let cached_initially_validated_transition_result =
     let open Result.Let_syntax in
     let%bind initially_validated_transition =
-      transition_with_hash
-      |> Mina_block.Validation.skip_time_received_validation
-           `This_block_was_not_received_via_gossip
-      |> validate_block ~genesis_state_hash
+      validate_block_skipping_time_received ~genesis_state_hash
+        transition_with_hash
     in
     let enveloped_initially_validated_transition =
       Envelope.Incoming.map enveloped_transition
diff --git a/src/lib/ledger_catchup/super_catchup.ml b/src/lib/ledger_catchup/super_catchup.ml
index 1d63647b6151..f50c19f39306 100644
--- a/src/lib/ledger_catchup/super_catchup.ml
+++ b/src/lib/ledger_catchup/super_catchup.ml
@@ -129,11 +129,14 @@ let write_graph (_ : t) =
   let _ = G.output_graph in
   ()
 
-let validate_block ~genesis_state_hash (b, v) =
+(** Validates block without time received validation *)
+let validate_block_skipping_time_received ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
+    `This_block_was_not_received_via_gossip h
+  |> validate_genesis_protocol_state ~genesis_state_hash
   >>= validate_protocol_versions >>= validate_delta_block_chain
   >>| Fn.flip with_body (Mina_block.body @@ With_hash.data b)
 
@@ -157,9 +160,8 @@ let verify_transition ~context:(module Context : CONTEXT) ~trust_system
   let transition_with_hash = Envelope.Incoming.data enveloped_transition in
   let cached_initially_validated_transition_result =
     let%bind.Result initially_validated_transition =
-      Mina_block.Validation.skip_time_received_validation
-        `This_block_was_not_received_via_gossip transition_with_hash
-      |> validate_block ~genesis_state_hash
+      validate_block_skipping_time_received ~genesis_state_hash
+        transition_with_hash
     in
     let enveloped_initially_validated_transition =
       Envelope.Incoming.map enveloped_transition
diff --git a/src/lib/mina_block/dune b/src/lib/mina_block/dune
index 192c4e47145c..132e580485f6 100644
--- a/src/lib/mina_block/dune
+++ b/src/lib/mina_block/dune
@@ -55,7 +55,8 @@
   random_oracle_input
   ppx_version.runtime
   mina_wire_types
-  internal_tracing)
+  internal_tracing
+  proof_carrying_data)
  (instrumentation
   (backend bisect_ppx))
  (preprocess
diff --git a/src/lib/mina_block/mina_block.ml b/src/lib/mina_block/mina_block.ml
index 286192fb4fb3..42b27071b9a4 100644
--- a/src/lib/mina_block/mina_block.ml
+++ b/src/lib/mina_block/mina_block.ml
@@ -72,3 +72,20 @@ let consensus_state =
     (Fn.compose Header.protocol_state Block.header)
 
 include Block
+
+let verify_on_header ~verify
+    { Proof_carrying_data.proof = merkle_list, root_unverified
+    ; data = best_tip_unverified
+    } =
+  let%map.Async_kernel.Deferred.Or_error ( `Root root_header
+                                         , `Best_tip best_tip_header ) =
+    verify
+      { Proof_carrying_data.proof = (merkle_list, header root_unverified)
+      ; data = header best_tip_unverified
+      }
+  in
+  let root = Validation.with_body root_header (body root_unverified) in
+  let best_tip =
+    Validation.with_body best_tip_header (body best_tip_unverified)
+  in
+  (`Root root, `Best_tip best_tip)
diff --git a/src/lib/mina_block/validation.ml b/src/lib/mina_block/validation.ml
index be1389255f33..bed739785e96 100644
--- a/src/lib/mina_block/validation.ml
+++ b/src/lib/mina_block/validation.ml
@@ -386,7 +386,7 @@ let validate_delta_block_chain (t, validation) =
 let skip_delta_block_chain_validation `This_block_was_not_received_via_gossip
     (t, validation) =
   let previous_protocol_state_hash =
-    t |> With_hash.data |> Block.header |> Header.protocol_state
+    t |> With_hash.data |> Header.protocol_state
     |> Protocol_state.previous_state_hash
   in
   ( t
diff --git a/src/lib/mina_block/validation.mli b/src/lib/mina_block/validation.mli
index 7d47da95c7ee..e182858e75a0 100644
--- a/src/lib/mina_block/validation.mli
+++ b/src/lib/mina_block/validation.mli
@@ -71,8 +71,15 @@ val skip_time_received_validation :
      , 'd
      , 'e
      , 'f )
-     with_block
-  -> ([ `Time_received ] * unit Truth.true_t, 'a, 'b, 'c, 'd, 'e, 'f) with_block
+     with_header
+  -> ( [ `Time_received ] * unit Truth.true_t
+     , 'a
+     , 'b
+     , 'c
+     , 'd
+     , 'e
+     , 'f )
+     with_header
 
 val validate_genesis_protocol_state :
      genesis_state_hash:State_hash.t
@@ -183,7 +190,7 @@ val skip_delta_block_chain_validation :
      , 'd
      , 'e
      , 'f )
-     with_block
+     with_header
   -> ( 'a
      , 'b
      , 'c
@@ -192,7 +199,7 @@ val skip_delta_block_chain_validation :
      , 'd
      , 'e
      , 'f )
-     with_block
+     with_header
 
 val validate_frontier_dependencies :
      to_header:('a -> Header.t)
diff --git a/src/lib/mina_intf/transition_frontier_components_intf.ml b/src/lib/mina_intf/transition_frontier_components_intf.ml
index 8926794d4d29..4e67cfc56f9a 100644
--- a/src/lib/mina_intf/transition_frontier_components_intf.ml
+++ b/src/lib/mina_intf/transition_frontier_components_intf.ml
@@ -184,11 +184,11 @@ module type Best_tip_prover_intf = sig
        verifier:Verifier.t
     -> genesis_constants:Genesis_constants.t
     -> precomputed_values:Precomputed_values.t
-    -> ( Mina_block.t
-       , State_body_hash.t list * Mina_block.t )
+    -> ( Mina_block.Header.t
+       , State_body_hash.t list * Mina_block.Header.t )
        Proof_carrying_data.t
-    -> ( [ `Root of Mina_block.initial_valid_block ]
-       * [ `Best_tip of Mina_block.initial_valid_block ] )
+    -> ( [ `Root of Mina_block.initial_valid_header ]
+       * [ `Best_tip of Mina_block.initial_valid_header ] )
        Deferred.Or_error.t
 end
 
@@ -211,11 +211,11 @@ module type Consensus_best_tip_prover_intf = sig
        context:(module CONTEXT)
     -> verifier:Verifier.t
     -> Consensus.Data.Consensus_state.Value.t State_hash.With_state_hashes.t
-    -> ( Mina_block.t
-       , State_body_hash.t list * Mina_block.t )
+    -> ( Mina_block.Header.t
+       , State_body_hash.t list * Mina_block.Header.t )
        Proof_carrying_data.t
-    -> ( [ `Root of Mina_block.initial_valid_block ]
-       * [ `Best_tip of Mina_block.initial_valid_block ] )
+    -> ( [ `Root of Mina_block.initial_valid_header ]
+       * [ `Best_tip of Mina_block.initial_valid_header ] )
        Deferred.Or_error.t
 end
 
diff --git a/src/lib/sync_handler/sync_handler.ml b/src/lib/sync_handler/sync_handler.ml
index 71ca07a56192..194036db8a52 100644
--- a/src/lib/sync_handler/sync_handler.ml
+++ b/src/lib/sync_handler/sync_handler.ml
@@ -255,7 +255,11 @@ module Make (Inputs : Inputs_intf) :
           (Consensus.Hooks.select
              ~context:(module Context)
              ~existing:
-               (With_hash.map ~f:Mina_block.consensus_state best_tip_transition)
+               (With_hash.map
+                  ~f:
+                    (Fn.compose Mina_state.Protocol_state.consensus_state
+                       Mina_block.Header.protocol_state )
+                  best_tip_transition )
              ~candidate )
           `Keep
       in
diff --git a/src/lib/transition_router/transition_router.ml b/src/lib/transition_router/transition_router.ml
index d6475eece373..df3cea60067b 100644
--- a/src/lib/transition_router/transition_router.ml
+++ b/src/lib/transition_router/transition_router.ml
@@ -254,8 +254,11 @@ let download_best_tip ~context:(module Context : CONTEXT) ~notify_online
               "Successfully downloaded best tip with $length from $peer" ;
             (* TODO: Use batch verification instead *)
             match%bind
-              Best_tip_prover.verify ~verifier peer_best_tip ~genesis_constants
-                ~precomputed_values
+              Mina_block.verify_on_header
+                ~verify:
+                  (Best_tip_prover.verify ~verifier ~genesis_constants
+                     ~precomputed_values )
+                peer_best_tip
             with
             | Error e ->
                 [%log warn]


Reviews:
user: login: mrmr1993
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-26T16:01:35Z
user: login: georgeee
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-26T21:20:57Z
user: login: georgeee
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-26T21:21:47Z
user: login: mrmr1993
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-31T18:48:59Z

Review comments:
diff_hunk: @@ -133,7 +133,9 @@ let validate_block ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
path: src/lib/ledger_catchup/super_catchup.ml
user: login: mrmr1993
body: I feel somewhat uncomfortable inlining this here. A function called `validate_block` that skips some validations has potential to be used incorrectly if copied/reused in other codepaths. Can you put it back?
created_at: 2025-02-25T16:06:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -60,7 +60,9 @@ let validate_block ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
path: src/lib/ledger_catchup/normal_catchup.ml
user: login: mrmr1993
body: Here also, `validate_block` is subverting expectations by skipping validations
created_at: 2025-02-25T16:07:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,21 @@
+let map ~f
path: src/lib/best_tip_prover/wrap_for_block.ml
user: login: mrmr1993
body: The names here are very unhelpful, I wouldn't know what this code was doing if I weren't reading the function directly. Thoughts:
* this is a block utility function, shouldn't it live in `Mina_block`?
* a more natural name would be e.g. `Mina_block.on_header ~f`
  * given how specific this is, maybe even `Mina_block.verify_on_header ~verify`
* the type here is really quite hard to follow, although this seems like more of a symptom of bad types in the callsites.
created_at: 2025-03-26T15:59:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -122,7 +117,9 @@ module Make (Inputs : Inputs_intf) :
             Error (Error.tag ~tag:"verifier proof" e) )
 
   let verify ~verifier ~genesis_constants ~precomputed_values
-      { Proof_carrying_data.data = best_tip; proof = merkle_list, root } =
+      { Proof_carrying_data.data = (best_tip : Mina_block.Header.t)
path: src/lib/best_tip_prover/best_tip_prover.ml
user: login: mrmr1993
body: Nit: it would be good to remove these type annotations if no longer needed.
created_at: 2025-03-26T16:00:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -60,7 +60,9 @@ let validate_block ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
path: src/lib/ledger_catchup/normal_catchup.ml
user: login: georgeee
body: Okay, will rename it. Good catch.
created_at: 2025-03-26T21:19:35Z
author_association: MEMBER
diff_hunk: @@ -133,7 +133,9 @@ let validate_block ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
path: src/lib/ledger_catchup/super_catchup.ml
user: login: georgeee
body: Okay, will rename it. Good catch.

Code behavior stays the same. So we only need to make sure that the name indicates that `validate_block` is only a partial validation function.
created_at: 2025-03-26T21:20:33Z
author_association: MEMBER
diff_hunk: @@ -60,7 +60,9 @@ let validate_block ~genesis_state_hash (b, v) =
   let open Mina_block.Validation in
   let open Result.Let_syntax in
   let h = (With_hash.map ~f:Mina_block.header b, v) in
-  validate_genesis_protocol_state ~genesis_state_hash h
+  Mina_block.Validation.skip_time_received_validation
path: src/lib/ledger_catchup/normal_catchup.ml
user: login: georgeee
body: `validate_block_skipping_time_received` would be fine here
created_at: 2025-03-26T21:21:47Z
author_association: MEMBER

PR comments:
user: login: georgeee
created_at: 2025-01-23T14:20:50Z
body: !ci-build-me
author_association: MEMBER
user: login: georgeee
created_at: 2025-03-20T11:51:06Z
body: !ci-build-me
author_association: MEMBER
user: login: dkijania
created_at: 2025-03-27T13:24:07Z
body: !ci-build-me
author_association: MEMBER