Move zkevm_* files into a separate folder

pull/7584/head
POA 1 year ago
parent 126c59a30d
commit a82c8bd2a3
  1. 6
      apps/block_scout_web/lib/block_scout_web/chain.ex
  2. 14
      apps/explorer/lib/explorer/chain.ex
  3. 17
      apps/explorer/lib/explorer/chain/import/runner/zkevm/batch_transactions.ex
  4. 19
      apps/explorer/lib/explorer/chain/import/runner/zkevm/lifecycle_transactions.ex
  5. 19
      apps/explorer/lib/explorer/chain/import/runner/zkevm/transaction_batches.ex
  6. 6
      apps/explorer/lib/explorer/chain/import/stage/block_referencing.ex
  7. 6
      apps/explorer/lib/explorer/chain/transaction.ex
  8. 9
      apps/explorer/lib/explorer/chain/zkevm/batch_transaction.ex
  9. 9
      apps/explorer/lib/explorer/chain/zkevm/lifecycle_transaction.ex
  10. 17
      apps/explorer/lib/explorer/chain/zkevm/transaction_batch.ex
  11. 12
      apps/indexer/lib/indexer/fetcher/zkevm/transaction_batch.ex
  12. 7
      apps/indexer/lib/indexer/supervisor.ex

@ -34,10 +34,10 @@ defmodule BlockScoutWeb.Chain do
Transaction, Transaction,
Transaction.StateChange, Transaction.StateChange,
Wei, Wei,
Withdrawal, Withdrawal
ZkevmTransactionBatch
} }
alias Explorer.Chain.Zkevm.TransactionBatch
alias Explorer.PagingOptions alias Explorer.PagingOptions
defimpl Poison.Encoder, for: Decimal do defimpl Poison.Encoder, for: Decimal do
@ -535,7 +535,7 @@ defmodule BlockScoutWeb.Chain do
%{"index" => index} %{"index" => index}
end end
defp paging_params(%ZkevmTransactionBatch{number: number}) do defp paging_params(%TransactionBatch{number: number}) do
%{"number" => number} %{"number" => number}
end end

@ -64,11 +64,11 @@ defmodule Explorer.Chain do
TokenTransfer, TokenTransfer,
Transaction, Transaction,
Wei, Wei,
Withdrawal, Withdrawal
ZkevmBatchTransaction,
ZkevmTransactionBatch
} }
alias Explorer.Chain.Zkevm.{BatchTransaction, TransactionBatch}
alias Explorer.Chain.Block.{EmissionReward, Reward} alias Explorer.Chain.Block.{EmissionReward, Reward}
alias Explorer.Chain.Cache.{ alias Explorer.Chain.Cache.{
@ -6396,7 +6396,7 @@ defmodule Explorer.Chain do
def zkevm_batch(number, options \\ []) def zkevm_batch(number, options \\ [])
def zkevm_batch(:latest, options) when is_list(options) do def zkevm_batch(:latest, options) when is_list(options) do
ZkevmTransactionBatch TransactionBatch
|> order_by(desc: :number) |> order_by(desc: :number)
|> limit(1) |> limit(1)
|> select_repo(options).one() |> select_repo(options).one()
@ -6409,7 +6409,7 @@ defmodule Explorer.Chain do
def zkevm_batch(number, options) when is_list(options) do def zkevm_batch(number, options) when is_list(options) do
necessity_by_association = Keyword.get(options, :necessity_by_association, %{}) necessity_by_association = Keyword.get(options, :necessity_by_association, %{})
ZkevmTransactionBatch TransactionBatch
|> where(number: ^number) |> where(number: ^number)
|> join_associations(necessity_by_association) |> join_associations(necessity_by_association)
|> select_repo(options).one() |> select_repo(options).one()
@ -6442,7 +6442,7 @@ defmodule Explorer.Chain do
necessity_by_association = Keyword.get(options, :necessity_by_association, %{}) necessity_by_association = Keyword.get(options, :necessity_by_association, %{})
base_query = base_query =
from(tb in ZkevmTransactionBatch, from(tb in TransactionBatch,
order_by: [desc: tb.number] order_by: [desc: tb.number]
) )
@ -6465,7 +6465,7 @@ defmodule Explorer.Chain do
end end
def zkevm_batch_transactions(batch_number, options \\ []) do def zkevm_batch_transactions(batch_number, options \\ []) do
query = from(bts in ZkevmBatchTransaction, where: bts.batch_number == ^batch_number) query = from(bts in BatchTransaction, where: bts.batch_number == ^batch_number)
select_repo(options).all(query) select_repo(options).all(query)
end end

@ -1,12 +1,13 @@
defmodule Explorer.Chain.Import.Runner.ZkevmBatchTransactions do defmodule Explorer.Chain.Import.Runner.Zkevm.BatchTransactions do
@moduledoc """ @moduledoc """
Bulk imports `t:Explorer.Chain.ZkevmBatchTransaction.t/0`. Bulk imports `t:Explorer.Chain.Zkevm.BatchTransaction.t/0`.
""" """
require Ecto.Query require Ecto.Query
alias Ecto.{Changeset, Multi, Repo} alias Ecto.{Changeset, Multi, Repo}
alias Explorer.Chain.{Import, ZkevmBatchTransaction} alias Explorer.Chain.Import
alias Explorer.Chain.Zkevm.BatchTransaction
alias Explorer.Prometheus.Instrumenter alias Explorer.Prometheus.Instrumenter
@behaviour Import.Runner @behaviour Import.Runner
@ -14,10 +15,10 @@ defmodule Explorer.Chain.Import.Runner.ZkevmBatchTransactions do
# milliseconds # milliseconds
@timeout 60_000 @timeout 60_000
@type imported :: [ZkevmBatchTransaction.t()] @type imported :: [BatchTransaction.t()]
@impl Import.Runner @impl Import.Runner
def ecto_schema_module, do: ZkevmBatchTransaction def ecto_schema_module, do: BatchTransaction
@impl Import.Runner @impl Import.Runner
def option_key, do: :zkevm_batch_transactions def option_key, do: :zkevm_batch_transactions
@ -53,17 +54,17 @@ defmodule Explorer.Chain.Import.Runner.ZkevmBatchTransactions do
def timeout, do: @timeout def timeout, do: @timeout
@spec insert(Repo.t(), [map()], %{required(:timeout) => timeout(), required(:timestamps) => Import.timestamps()}) :: @spec insert(Repo.t(), [map()], %{required(:timeout) => timeout(), required(:timestamps) => Import.timestamps()}) ::
{:ok, [ZkevmBatchTransaction.t()]} {:ok, [BatchTransaction.t()]}
| {:error, [Changeset.t()]} | {:error, [Changeset.t()]}
def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = _options) when is_list(changes_list) do def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = _options) when is_list(changes_list) do
# Enforce ZkevmBatchTransaction ShareLocks order (see docs: sharelock.md) # Enforce Zkevm.BatchTransaction ShareLocks order (see docs: sharelock.md)
ordered_changes_list = Enum.sort_by(changes_list, & &1.hash) ordered_changes_list = Enum.sort_by(changes_list, & &1.hash)
{:ok, inserted} = {:ok, inserted} =
Import.insert_changes_list( Import.insert_changes_list(
repo, repo,
ordered_changes_list, ordered_changes_list,
for: ZkevmBatchTransaction, for: BatchTransaction,
returning: true, returning: true,
timeout: timeout, timeout: timeout,
timestamps: timestamps, timestamps: timestamps,

@ -1,12 +1,13 @@
defmodule Explorer.Chain.Import.Runner.ZkevmLifecycleTransactions do defmodule Explorer.Chain.Import.Runner.Zkevm.LifecycleTransactions do
@moduledoc """ @moduledoc """
Bulk imports `t:Explorer.Chain.ZkevmLifecycleTransaction.t/0`. Bulk imports `t:Explorer.Chain.Zkevm.LifecycleTransaction.t/0`.
""" """
require Ecto.Query require Ecto.Query
alias Ecto.{Changeset, Multi, Repo} alias Ecto.{Changeset, Multi, Repo}
alias Explorer.Chain.{Import, ZkevmLifecycleTransaction} alias Explorer.Chain.Import
alias Explorer.Chain.Zkevm.LifecycleTransaction
alias Explorer.Prometheus.Instrumenter alias Explorer.Prometheus.Instrumenter
import Ecto.Query, only: [from: 2] import Ecto.Query, only: [from: 2]
@ -16,10 +17,10 @@ defmodule Explorer.Chain.Import.Runner.ZkevmLifecycleTransactions do
# milliseconds # milliseconds
@timeout 60_000 @timeout 60_000
@type imported :: [ZkevmLifecycleTransaction.t()] @type imported :: [LifecycleTransaction.t()]
@impl Import.Runner @impl Import.Runner
def ecto_schema_module, do: ZkevmLifecycleTransaction def ecto_schema_module, do: LifecycleTransaction
@impl Import.Runner @impl Import.Runner
def option_key, do: :zkevm_lifecycle_transactions def option_key, do: :zkevm_lifecycle_transactions
@ -55,19 +56,19 @@ defmodule Explorer.Chain.Import.Runner.ZkevmLifecycleTransactions do
def timeout, do: @timeout def timeout, do: @timeout
@spec insert(Repo.t(), [map()], %{required(:timeout) => timeout(), required(:timestamps) => Import.timestamps()}) :: @spec insert(Repo.t(), [map()], %{required(:timeout) => timeout(), required(:timestamps) => Import.timestamps()}) ::
{:ok, [ZkevmLifecycleTransaction.t()]} {:ok, [LifecycleTransaction.t()]}
| {:error, [Changeset.t()]} | {:error, [Changeset.t()]}
def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = options) when is_list(changes_list) do def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = options) when is_list(changes_list) do
on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0) on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0)
# Enforce ZkevmLifecycleTransaction ShareLocks order (see docs: sharelock.md) # Enforce Zkevm.LifecycleTransaction ShareLocks order (see docs: sharelock.md)
ordered_changes_list = Enum.sort_by(changes_list, & &1.id) ordered_changes_list = Enum.sort_by(changes_list, & &1.id)
{:ok, inserted} = {:ok, inserted} =
Import.insert_changes_list( Import.insert_changes_list(
repo, repo,
ordered_changes_list, ordered_changes_list,
for: ZkevmLifecycleTransaction, for: LifecycleTransaction,
returning: true, returning: true,
timeout: timeout, timeout: timeout,
timestamps: timestamps, timestamps: timestamps,
@ -80,7 +81,7 @@ defmodule Explorer.Chain.Import.Runner.ZkevmLifecycleTransactions do
defp default_on_conflict do defp default_on_conflict do
from( from(
tx in ZkevmLifecycleTransaction, tx in LifecycleTransaction,
update: [ update: [
set: [ set: [
# don't update `id` as it is a primary key # don't update `id` as it is a primary key

@ -1,12 +1,13 @@
defmodule Explorer.Chain.Import.Runner.ZkevmTransactionBatches do defmodule Explorer.Chain.Import.Runner.Zkevm.TransactionBatches do
@moduledoc """ @moduledoc """
Bulk imports `t:Explorer.Chain.ZkevmTransactionBatch.t/0`. Bulk imports `t:Explorer.Chain.Zkevm.TransactionBatch.t/0`.
""" """
require Ecto.Query require Ecto.Query
alias Ecto.{Changeset, Multi, Repo} alias Ecto.{Changeset, Multi, Repo}
alias Explorer.Chain.{Import, ZkevmTransactionBatch} alias Explorer.Chain.Import
alias Explorer.Chain.Zkevm.TransactionBatch
alias Explorer.Prometheus.Instrumenter alias Explorer.Prometheus.Instrumenter
import Ecto.Query, only: [from: 2] import Ecto.Query, only: [from: 2]
@ -16,10 +17,10 @@ defmodule Explorer.Chain.Import.Runner.ZkevmTransactionBatches do
# milliseconds # milliseconds
@timeout 60_000 @timeout 60_000
@type imported :: [ZkevmTransactionBatch.t()] @type imported :: [TransactionBatch.t()]
@impl Import.Runner @impl Import.Runner
def ecto_schema_module, do: ZkevmTransactionBatch def ecto_schema_module, do: TransactionBatch
@impl Import.Runner @impl Import.Runner
def option_key, do: :zkevm_transaction_batches def option_key, do: :zkevm_transaction_batches
@ -55,19 +56,19 @@ defmodule Explorer.Chain.Import.Runner.ZkevmTransactionBatches do
def timeout, do: @timeout def timeout, do: @timeout
@spec insert(Repo.t(), [map()], %{required(:timeout) => timeout(), required(:timestamps) => Import.timestamps()}) :: @spec insert(Repo.t(), [map()], %{required(:timeout) => timeout(), required(:timestamps) => Import.timestamps()}) ::
{:ok, [ZkevmTransactionBatch.t()]} {:ok, [TransactionBatch.t()]}
| {:error, [Changeset.t()]} | {:error, [Changeset.t()]}
def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = options) when is_list(changes_list) do def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = options) when is_list(changes_list) do
on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0) on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0)
# Enforce ZkevmTransactionBatch ShareLocks order (see docs: sharelock.md) # Enforce Zkevm.TransactionBatch ShareLocks order (see docs: sharelock.md)
ordered_changes_list = Enum.sort_by(changes_list, & &1.number) ordered_changes_list = Enum.sort_by(changes_list, & &1.number)
{:ok, inserted} = {:ok, inserted} =
Import.insert_changes_list( Import.insert_changes_list(
repo, repo,
ordered_changes_list, ordered_changes_list,
for: ZkevmTransactionBatch, for: TransactionBatch,
returning: true, returning: true,
timeout: timeout, timeout: timeout,
timestamps: timestamps, timestamps: timestamps,
@ -80,7 +81,7 @@ defmodule Explorer.Chain.Import.Runner.ZkevmTransactionBatches do
defp default_on_conflict do defp default_on_conflict do
from( from(
tb in ZkevmTransactionBatch, tb in TransactionBatch,
update: [ update: [
set: [ set: [
# don't update `number` as it is a primary key and used for the conflict target # don't update `number` as it is a primary key and used for the conflict target

@ -33,9 +33,9 @@ defmodule Explorer.Chain.Import.Stage.BlockReferencing do
"polygon_zkevm" -> "polygon_zkevm" ->
@default_runners ++ @default_runners ++
[ [
Runner.ZkevmLifecycleTransactions, Runner.Zkevm.LifecycleTransactions,
Runner.ZkevmTransactionBatches, Runner.Zkevm.TransactionBatches,
Runner.ZkevmBatchTransactions Runner.Zkevm.BatchTransactions
] ]
_ -> @default_runners _ -> @default_runners
end end

@ -27,11 +27,11 @@ defmodule Explorer.Chain.Transaction do
TokenTransfer, TokenTransfer,
Transaction, Transaction,
TransactionAction, TransactionAction,
Wei, Wei
ZkevmBatchTransaction
} }
alias Explorer.Chain.Transaction.{Fork, Status} alias Explorer.Chain.Transaction.{Fork, Status}
alias Explorer.Chain.Zkevm.BatchTransaction
alias Explorer.SmartContract.SigProviderInterface alias Explorer.SmartContract.SigProviderInterface
@optional_attrs ~w(max_priority_fee_per_gas max_fee_per_gas block_hash block_number created_contract_address_hash cumulative_gas_used earliest_processing_start @optional_attrs ~w(max_priority_fee_per_gas max_fee_per_gas block_hash block_number created_contract_address_hash cumulative_gas_used earliest_processing_start
@ -276,7 +276,7 @@ defmodule Explorer.Chain.Transaction do
has_many(:uncles, through: [:forks, :uncle]) has_many(:uncles, through: [:forks, :uncle])
has_one(:zkevm_batch_transaction, ZkevmBatchTransaction, foreign_key: :hash) has_one(:zkevm_batch_transaction, BatchTransaction, foreign_key: :hash)
has_one(:zkevm_batch, through: [:zkevm_batch_transaction, :batch]) has_one(:zkevm_batch, through: [:zkevm_batch_transaction, :batch])
has_one(:zkevm_sequence_txn, through: [:zkevm_batch, :sequence_transaction]) has_one(:zkevm_sequence_txn, through: [:zkevm_batch, :sequence_transaction])
has_one(:zkevm_verify_txn, through: [:zkevm_batch, :verify_transaction]) has_one(:zkevm_verify_txn, through: [:zkevm_batch, :verify_transaction])

@ -1,22 +1,23 @@
defmodule Explorer.Chain.ZkevmBatchTransaction do defmodule Explorer.Chain.Zkevm.BatchTransaction do
@moduledoc "Models a list of transactions related to a batch for zkEVM." @moduledoc "Models a list of transactions related to a batch for zkEVM."
use Explorer.Schema use Explorer.Schema
alias Explorer.Chain.{Hash, Transaction, ZkevmTransactionBatch} alias Explorer.Chain.{Hash, Transaction}
alias Explorer.Chain.Zkevm.TransactionBatch
@required_attrs ~w(batch_number hash)a @required_attrs ~w(batch_number hash)a
@type t :: %__MODULE__{ @type t :: %__MODULE__{
batch_number: non_neg_integer(), batch_number: non_neg_integer(),
batch: %Ecto.Association.NotLoaded{} | ZkevmTransactionBatch.t() | nil, batch: %Ecto.Association.NotLoaded{} | TransactionBatch.t() | nil,
hash: Hash.t(), hash: Hash.t(),
l2_transaction: %Ecto.Association.NotLoaded{} | Transaction.t() | nil l2_transaction: %Ecto.Association.NotLoaded{} | Transaction.t() | nil
} }
@primary_key false @primary_key false
schema "zkevm_batch_l2_transactions" do schema "zkevm_batch_l2_transactions" do
belongs_to(:batch, ZkevmTransactionBatch, foreign_key: :batch_number, references: :number, type: :integer) belongs_to(:batch, TransactionBatch, foreign_key: :batch_number, references: :number, type: :integer)
belongs_to(:l2_transaction, Transaction, foreign_key: :hash, primary_key: true, references: :hash, type: Hash.Full) belongs_to(:l2_transaction, Transaction, foreign_key: :hash, primary_key: true, references: :hash, type: Hash.Full)
timestamps() timestamps()

@ -1,9 +1,10 @@
defmodule Explorer.Chain.ZkevmLifecycleTransaction do defmodule Explorer.Chain.Zkevm.LifecycleTransaction do
@moduledoc "Models an L1 lifecycle transaction for zkEVM." @moduledoc "Models an L1 lifecycle transaction for zkEVM."
use Explorer.Schema use Explorer.Schema
alias Explorer.Chain.{Hash, ZkevmTransactionBatch} alias Explorer.Chain.Hash
alias Explorer.Chain.Zkevm.TransactionBatch
@required_attrs ~w(id hash is_verify)a @required_attrs ~w(id hash is_verify)a
@ -17,8 +18,8 @@ defmodule Explorer.Chain.ZkevmLifecycleTransaction do
field(:hash, Hash.Full) field(:hash, Hash.Full)
field(:is_verify, :boolean) field(:is_verify, :boolean)
has_many(:sequenced_batches, ZkevmTransactionBatch, foreign_key: :sequence_id) has_many(:sequenced_batches, TransactionBatch, foreign_key: :sequence_id)
has_many(:verified_batches, ZkevmTransactionBatch, foreign_key: :verify_id) has_many(:verified_batches, TransactionBatch, foreign_key: :verify_id)
timestamps() timestamps()
end end

@ -1,9 +1,10 @@
defmodule Explorer.Chain.ZkevmTransactionBatch do defmodule Explorer.Chain.Zkevm.TransactionBatch do
@moduledoc "Models a batch of transactions for zkEVM." @moduledoc "Models a batch of transactions for zkEVM."
use Explorer.Schema use Explorer.Schema
alias Explorer.Chain.{Hash, ZkevmBatchTransaction, ZkevmLifecycleTransaction} alias Explorer.Chain.Hash
alias Explorer.Chain.Zkevm.{BatchTransaction, LifecycleTransaction}
@optional_attrs ~w(sequence_id verify_id)a @optional_attrs ~w(sequence_id verify_id)a
@ -17,10 +18,10 @@ defmodule Explorer.Chain.ZkevmTransactionBatch do
acc_input_hash: Hash.t(), acc_input_hash: Hash.t(),
state_root: Hash.t(), state_root: Hash.t(),
sequence_id: non_neg_integer() | nil, sequence_id: non_neg_integer() | nil,
sequence_transaction: %Ecto.Association.NotLoaded{} | ZkevmLifecycleTransaction.t() | nil, sequence_transaction: %Ecto.Association.NotLoaded{} | LifecycleTransaction.t() | nil,
verify_id: non_neg_integer() | nil, verify_id: non_neg_integer() | nil,
verify_transaction: %Ecto.Association.NotLoaded{} | ZkevmLifecycleTransaction.t() | nil, verify_transaction: %Ecto.Association.NotLoaded{} | LifecycleTransaction.t() | nil,
l2_transactions: %Ecto.Association.NotLoaded{} | [ZkevmBatchTransaction.t()] l2_transactions: %Ecto.Association.NotLoaded{} | [BatchTransaction.t()]
} }
@primary_key {:number, :integer, autogenerate: false} @primary_key {:number, :integer, autogenerate: false}
@ -31,15 +32,15 @@ defmodule Explorer.Chain.ZkevmTransactionBatch do
field(:acc_input_hash, Hash.Full) field(:acc_input_hash, Hash.Full)
field(:state_root, Hash.Full) field(:state_root, Hash.Full)
belongs_to(:sequence_transaction, ZkevmLifecycleTransaction, belongs_to(:sequence_transaction, LifecycleTransaction,
foreign_key: :sequence_id, foreign_key: :sequence_id,
references: :id, references: :id,
type: :integer type: :integer
) )
belongs_to(:verify_transaction, ZkevmLifecycleTransaction, foreign_key: :verify_id, references: :id, type: :integer) belongs_to(:verify_transaction, LifecycleTransaction, foreign_key: :verify_id, references: :id, type: :integer)
has_many(:l2_transactions, ZkevmBatchTransaction, foreign_key: :batch_number) has_many(:l2_transactions, BatchTransaction, foreign_key: :batch_number)
timestamps() timestamps()
end end

@ -1,4 +1,4 @@
defmodule Indexer.Fetcher.ZkevmTransactionBatch do defmodule Indexer.Fetcher.Zkevm.TransactionBatch do
@moduledoc """ @moduledoc """
Fills zkevm_transaction_batches DB table. Fills zkevm_transaction_batches DB table.
""" """
@ -13,7 +13,7 @@ defmodule Indexer.Fetcher.ZkevmTransactionBatch do
import EthereumJSONRPC, only: [integer_to_quantity: 1, json_rpc: 2, quantity_to_integer: 1] import EthereumJSONRPC, only: [integer_to_quantity: 1, json_rpc: 2, quantity_to_integer: 1]
alias Explorer.{Chain, Repo} alias Explorer.{Chain, Repo}
alias Explorer.Chain.{ZkevmLifecycleTransaction, ZkevmTransactionBatch} alias Explorer.Chain.Zkevm.{LifecycleTransaction, TransactionBatch}
@zero_hash "0000000000000000000000000000000000000000000000000000000000000000" @zero_hash "0000000000000000000000000000000000000000000000000000000000000000"
@ -36,7 +36,7 @@ defmodule Indexer.Fetcher.ZkevmTransactionBatch do
def init(args) do def init(args) do
Logger.metadata(fetcher: :zkevm_transaction_batches) Logger.metadata(fetcher: :zkevm_transaction_batches)
config = Application.get_all_env(:indexer)[Indexer.Fetcher.ZkevmTransactionBatch] config = Application.get_all_env(:indexer)[Indexer.Fetcher.Zkevm.TransactionBatch]
chunk_size = config[:chunk_size] chunk_size = config[:chunk_size]
recheck_interval = config[:recheck_interval] recheck_interval = config[:recheck_interval]
@ -113,7 +113,7 @@ defmodule Indexer.Fetcher.ZkevmTransactionBatch do
defp get_last_verified_batch_number do defp get_last_verified_batch_number do
query = query =
from(tb in ZkevmTransactionBatch, from(tb in TransactionBatch,
select: tb.number, select: tb.number,
where: not is_nil(tb.verify_id), where: not is_nil(tb.verify_id),
order_by: [desc: tb.number], order_by: [desc: tb.number],
@ -127,7 +127,7 @@ defmodule Indexer.Fetcher.ZkevmTransactionBatch do
defp get_next_id do defp get_next_id do
query = query =
from(lt in ZkevmLifecycleTransaction, from(lt in LifecycleTransaction,
select: lt.id, select: lt.id,
order_by: [desc: lt.id], order_by: [desc: lt.id],
limit: 1 limit: 1
@ -228,7 +228,7 @@ defmodule Indexer.Fetcher.ZkevmTransactionBatch do
query = query =
from( from(
lt in ZkevmLifecycleTransaction, lt in LifecycleTransaction,
select: {lt.hash, lt.id}, select: {lt.hash, lt.id},
where: lt.hash in ^l1_tx_hashes where: lt.hash in ^l1_tx_hashes
) )

@ -34,10 +34,11 @@ defmodule Indexer.Supervisor do
TokenUpdater, TokenUpdater,
TransactionAction, TransactionAction,
UncleBlock, UncleBlock,
Withdrawal, Withdrawal
ZkevmTransactionBatch
} }
alias Indexer.Fetcher.Zkevm.TransactionBatch
alias Indexer.Temporary.{ alias Indexer.Temporary.{
BlocksTransactionsMismatch, BlocksTransactionsMismatch,
UncatalogedTokenTransfers, UncatalogedTokenTransfers,
@ -133,7 +134,7 @@ defmodule Indexer.Supervisor do
{Indexer.Fetcher.PolygonEdge.Withdrawal.Supervisor, {Indexer.Fetcher.PolygonEdge.Withdrawal.Supervisor,
[[memory_monitor: memory_monitor, json_rpc_named_arguments: json_rpc_named_arguments]]}, [[memory_monitor: memory_monitor, json_rpc_named_arguments: json_rpc_named_arguments]]},
{Indexer.Fetcher.PolygonEdge.WithdrawalExit.Supervisor, [[memory_monitor: memory_monitor]]}, {Indexer.Fetcher.PolygonEdge.WithdrawalExit.Supervisor, [[memory_monitor: memory_monitor]]},
configure(ZkevmTransactionBatch.Supervisor, [ configure(TransactionBatch.Supervisor, [
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor] [json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]), ]),

Loading…
Cancel
Save