Skip to content

Commit

Permalink
Preload accounts for transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 authored and georgeee committed Nov 27, 2023
1 parent 17d15af commit 344a10d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/staged_ledger/staged_ledger.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,14 @@ module T = struct
let new_mask = Ledger.Mask.create ~depth:(Ledger.depth t.ledger) () in
let new_ledger = Ledger.register_mask t.ledger new_mask in
let transactions, works, commands_count, coinbases = pre_diff_info in
let accounts_accessed =
List.fold_left ~init:Account_id.Set.empty transactions ~f:(fun set txn ->
Account_id.Set.(
union set
(of_list (Transaction.accounts_referenced txn.With_status.data))) )
|> Set.to_list
in
Ledger.unsafe_preload_accounts_from_parent new_ledger accounts_accessed ;
[%log internal] "Update_coinbase_stack"
~metadata:
[ ("transactions", `Int (List.length transactions))
Expand Down

0 comments on commit 344a10d

Please sign in to comment.