Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changes/18197.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fix a bug that causes the daemon to freeze when shut down with a signal like
SIGINT or SIGTERM, and not with `mina client stop`. The frontier visualization
debug diagram that is written at shutdown will now display a total_currency of 0
for every mask. This functionality will be restored when the efficiency of the
underlying operation is improved.
21 changes: 14 additions & 7 deletions src/lib/merkle_mask/maskable_merkle_tree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@ module Make (Inputs : Inputs_intf) = struct
let display_attached_mask mask =
let root_hash = Mask.Attached.merkle_root mask in
let num_accounts = Mask.Attached.num_accounts mask in
let total_currency =
Mask.Attached.foldi mask ~init:0 ~f:(fun _ total_currency account ->
(* only default token matters for total currency *)
if Token_id.equal (Account.token account) Token_id.default then
total_currency + (Balance.to_int @@ Account.balance account)
else total_currency )
in
(* This total_currency computation is temporarily disabled - it causes the
frontier mask visualization that happens at shutdown to be
exceptionally slow. See #17501 and #18196, though if we decide we
really need this then we could also consider optionally caching the
total_currency in ledger masks, and then recomputing the currency
change each mask would cause in the ledger. *)
(* let total_currency =
Mask.Attached.foldi mask ~init:0 ~f:(fun _ total_currency account ->
(* only default token matters for total currency *)
if Token_id.equal (Account.token account) Token_id.default then
total_currency + (Balance.to_int @@ Account.balance account)
else total_currency )
in *)
let total_currency = 0 in
let uuid = format_uuid mask in
{ hash =
Visualization.display_prefix_of_string
Expand Down