@@ -965,7 +965,8 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
965965 expected_status status
966966 (Ledger.Transaction_partially_applied. command partially_applied_txn)
967967 in
968- let apply_previous_incomplete_txns ~k (txns : Previous_incomplete_txns.t ) =
968+ let apply_previous_incomplete_txns ~signature_kind ~k
969+ (txns : Previous_incomplete_txns.t ) =
969970 (* Note: Previous incomplete transactions refer to the block's transactions from previous scan state tree that were split between the two trees.
970971 The set in the previous tree have gone through the first pass. For the second pass that is to happen after the rest of the set goes through the first pass, we need partially applied state - result of previous tree's transactions' first pass. To generate the partial state, we do a first pass application of previous tree's transaction on a sparse ledger created from witnesses stored in the scan state and then use it to apply to the ledger here*)
971972 let inject_ledger_info partially_applied_txn =
@@ -1016,7 +1017,7 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
10161017 { command = t.command
10171018 ; previous_hash = t.previous_hash
10181019 ; original_first_pass_account_states
1019- ; signature_kind = Mina_signature_kind. t_DEPRECATED
1020+ ; signature_kind
10201021 ; constraint_constants = t.constraint_constants
10211022 ; state_view = t.state_view
10221023 ; global_state
@@ -1068,7 +1069,7 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
10681069 in
10691070 let rec apply_txns (previous_incomplete : Previous_incomplete_txns.t )
10701071 (ordered_txns : _ Transactions_ordered.Poly.t list )
1071- ~first_pass_ledger_hash =
1072+ ~first_pass_ledger_hash ~ signature_kind =
10721073 let previous_incomplete =
10731074 (* filter out any non-zkapp transactions for second pass application*)
10741075 match previous_incomplete with
@@ -1090,8 +1091,9 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
10901091 in
10911092 match ordered_txns with
10921093 | [] ->
1093- apply_previous_incomplete_txns previous_incomplete ~k: (fun () ->
1094- Ok (`Complete first_pass_ledger_hash) )
1094+ apply_previous_incomplete_txns ~signature_kind
1095+ ~k: (fun () -> Ok (`Complete first_pass_ledger_hash))
1096+ previous_incomplete
10951097 | [ txns_per_block ] when stop_at_first_pass ->
10961098 (* Last block; don't apply second pass. This is for snarked ledgers which are first pass ledgers*)
10971099 apply_txns_first_pass txns_per_block.first_pass
@@ -1100,13 +1102,14 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
11001102 then there’d be at least two sets of txns_per_block and the
11011103 previous_incomplete txns will be applied when processing the first
11021104 set. The subsequent sets shouldn’t have any previous-incomplete.*)
1103- apply_txns (Unapplied [] ) [] ~first_pass_ledger_hash )
1105+ apply_txns (Unapplied [] ) [] ~first_pass_ledger_hash ~signature_kind )
11041106 | txns_per_block :: ordered_txns' ->
11051107 (* Apply first pass of a blocks transactions either new or continued from previous tree*)
11061108 apply_txns_first_pass txns_per_block.first_pass
11071109 ~k: (fun first_pass_ledger_hash partially_applied_txns ->
11081110 (* Apply second pass of previous tree's transactions, if any*)
1109- apply_previous_incomplete_txns previous_incomplete ~k: (fun () ->
1111+ apply_previous_incomplete_txns previous_incomplete ~signature_kind
1112+ ~k: (fun () ->
11101113 let continue_previous_tree's_txns =
11111114 (* If this is a continuation from previous tree for the same block (incomplete txns in both sets) then do second pass now*)
11121115 let previous_not_empty =
@@ -1127,11 +1130,11 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
11271130 if do_second_pass then
11281131 apply_txns_second_pass partially_applied_txns ~k: (fun () ->
11291132 apply_txns (Unapplied [] ) ordered_txns'
1130- ~first_pass_ledger_hash )
1133+ ~first_pass_ledger_hash ~signature_kind )
11311134 else
11321135 (* Transactions not completed in this tree, so second pass after first pass of remaining transactions for the same block in the next tree*)
11331136 apply_txns (Partially_applied partially_applied_txns)
1134- ordered_txns' ~first_pass_ledger_hash ) )
1137+ ordered_txns' ~first_pass_ledger_hash ~signature_kind ) )
11351138 in
11361139 let previous_incomplete =
11371140 Option. value_map (List. hd ordered_txns)
@@ -1148,7 +1151,7 @@ let apply_ordered_txns_stepwise ?(stop_at_first_pass = false) ordered_txns
11481151
11491152let apply_ordered_txns_sync ?stop_at_first_pass ordered_txns ~ledger
11501153 ~get_protocol_state ~apply_first_pass ~apply_second_pass
1151- ~apply_first_pass_sparse_ledger =
1154+ ~apply_first_pass_sparse_ledger ~ signature_kind =
11521155 let rec run = function
11531156 | Ok (`Continue k ) ->
11541157 run (k () )
@@ -1160,11 +1163,11 @@ let apply_ordered_txns_sync ?stop_at_first_pass ordered_txns ~ledger
11601163 run
11611164 @@ apply_ordered_txns_stepwise ?stop_at_first_pass ordered_txns ~ledger
11621165 ~get_protocol_state ~apply_first_pass ~apply_second_pass
1163- ~apply_first_pass_sparse_ledger
1166+ ~apply_first_pass_sparse_ledger ~signature_kind
11641167
11651168let apply_ordered_txns_async ?stop_at_first_pass ordered_txns
11661169 ?(async_batch_size = 10 ) ~ledger ~get_protocol_state ~apply_first_pass
1167- ~apply_second_pass ~apply_first_pass_sparse_ledger =
1170+ ~apply_second_pass ~apply_first_pass_sparse_ledger ~ signature_kind =
11681171 let open Deferred.Result.Let_syntax in
11691172 let yield =
11701173 let f = Staged. unstage (Scheduler. yield_every ~n: async_batch_size) in
@@ -1183,36 +1186,38 @@ let apply_ordered_txns_async ?stop_at_first_pass ordered_txns
11831186 run
11841187 @@ apply_ordered_txns_stepwise ?stop_at_first_pass ordered_txns ~ledger
11851188 ~get_protocol_state ~apply_first_pass ~apply_second_pass
1186- ~apply_first_pass_sparse_ledger
1189+ ~apply_first_pass_sparse_ledger ~signature_kind
11871190
11881191let get_snarked_ledger_sync ~ledger ~get_protocol_state ~apply_first_pass
1189- ~apply_second_pass ~apply_first_pass_sparse_ledger t =
1192+ ~apply_second_pass ~apply_first_pass_sparse_ledger ~ signature_kind t =
11901193 match latest_ledger_proof' t with
11911194 | None ->
11921195 Or_error. errorf " No transactions found"
11931196 | Some (_ , txns_per_block ) ->
11941197 apply_ordered_txns_sync ~stop_at_first_pass: true txns_per_block ~ledger
11951198 ~get_protocol_state ~apply_first_pass ~apply_second_pass
1196- ~apply_first_pass_sparse_ledger
1199+ ~apply_first_pass_sparse_ledger ~signature_kind
11971200 |> Or_error. ignore_m
11981201
11991202let get_snarked_ledger_async ?async_batch_size ~ledger ~get_protocol_state
1200- ~apply_first_pass ~apply_second_pass ~apply_first_pass_sparse_ledger t =
1203+ ~apply_first_pass ~apply_second_pass ~apply_first_pass_sparse_ledger
1204+ ~signature_kind t =
12011205 match latest_ledger_proof' t with
12021206 | None ->
12031207 Deferred.Or_error. errorf " No transactions found"
12041208 | Some (_ , txns_per_block ) ->
12051209 apply_ordered_txns_async ~stop_at_first_pass: true txns_per_block
12061210 ?async_batch_size ~ledger ~get_protocol_state ~apply_first_pass
1207- ~apply_second_pass ~apply_first_pass_sparse_ledger
1211+ ~apply_second_pass ~apply_first_pass_sparse_ledger ~signature_kind
12081212 |> Deferred.Or_error. ignore_m
12091213
12101214let get_staged_ledger_async ?async_batch_size ~ledger ~get_protocol_state
1211- ~apply_first_pass ~apply_second_pass ~apply_first_pass_sparse_ledger t =
1215+ ~apply_first_pass ~apply_second_pass ~apply_first_pass_sparse_ledger
1216+ ~signature_kind t =
12121217 let staged_transactions_with_state_hash = staged_transactions t in
12131218 apply_ordered_txns_async staged_transactions_with_state_hash ?async_batch_size
12141219 ~ledger ~get_protocol_state ~apply_first_pass ~apply_second_pass
1215- ~apply_first_pass_sparse_ledger
1220+ ~apply_first_pass_sparse_ledger ~signature_kind
12161221
12171222let free_space t = Parallel_scan. free_space t.scan_state
12181223
0 commit comments