From c9c620e89011f120567ea554b5bec3a646124ab3 Mon Sep 17 00:00:00 2001 From: Qwerty5Uiop <105209995+Qwerty5Uiop@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:12:47 +0400 Subject: [PATCH] fix: Fix transactions deadlock (#11623) --- apps/explorer/lib/explorer/chain/import.ex | 1 + .../stage/block_transaction_referencing.ex | 1 - .../lib/explorer/chain/import/stage/logs.ex | 27 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 apps/explorer/lib/explorer/chain/import/stage/logs.ex diff --git a/apps/explorer/lib/explorer/chain/import.ex b/apps/explorer/lib/explorer/chain/import.ex index 5bfda72c8516..fc75a873fbed 100644 --- a/apps/explorer/lib/explorer/chain/import.ex +++ b/apps/explorer/lib/explorer/chain/import.ex @@ -22,6 +22,7 @@ defmodule Explorer.Chain.Import do Import.Stage.BlockTransactionReferencing, Import.Stage.TokenReferencing, Import.Stage.TokenInstances, + Import.Stage.Logs, Import.Stage.InternalTransactions, Import.Stage.ChainTypeSpecific ] diff --git a/apps/explorer/lib/explorer/chain/import/stage/block_transaction_referencing.ex b/apps/explorer/lib/explorer/chain/import/stage/block_transaction_referencing.ex index 91c5a201206e..8c25a9a05495 100644 --- a/apps/explorer/lib/explorer/chain/import/stage/block_transaction_referencing.ex +++ b/apps/explorer/lib/explorer/chain/import/stage/block_transaction_referencing.ex @@ -10,7 +10,6 @@ defmodule Explorer.Chain.Import.Stage.BlockTransactionReferencing do @runners [ Runner.TokenTransfers, Runner.Transaction.Forks, - Runner.Logs, Runner.Block.Rewards, Runner.Block.SecondDegreeRelations, Runner.TransactionActions, diff --git a/apps/explorer/lib/explorer/chain/import/stage/logs.ex b/apps/explorer/lib/explorer/chain/import/stage/logs.ex new file mode 100644 index 000000000000..739af1583d35 --- /dev/null +++ b/apps/explorer/lib/explorer/chain/import/stage/logs.ex @@ -0,0 +1,27 @@ +defmodule Explorer.Chain.Import.Stage.Logs do + @moduledoc """ + Import logs. + """ + + alias Explorer.Chain.Import.{Runner, Stage} + + @behaviour Stage + + @runners [ + Runner.Logs + ] + + @impl Stage + def runners, do: @runners + + @impl Stage + def all_runners, do: runners() + + @impl Stage + def multis(runner_to_changes_list, options) do + {final_multi, final_remaining_runner_to_changes_list} = + Stage.single_multi(runners(), runner_to_changes_list, options) + + {[final_multi], final_remaining_runner_to_changes_list} + end +end