Skip to content

Commit

Permalink
Merge pull request blockscout#9597 from blockscout/ap-fix-token-trans…
Browse files Browse the repository at this point in the history
…fers-consensus-update

Update token transfers block_consensus by block_number
  • Loading branch information
vbaranov authored Mar 12, 2024
2 parents 8c44ca5 + f50018b commit 1b8397c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
### Fixes

- [#9601](https://github.com/blockscout/blockscout/pull/9601) - Fix token instance transform for some unconventional tokens
- [#9597](https://github.com/blockscout/blockscout/pull/9597) - Update token transfers block_consensus by block_number
- [#9572](https://github.com/blockscout/blockscout/pull/9572) - Fix Shibarium L1 fetcher
- [#9563](https://github.com/blockscout/blockscout/pull/9563) - Fix timestamp handler for unfinalized zkEVM batches
- [#9560](https://github.com/blockscout/blockscout/pull/9560) - Fix fetch pending transaction for hyperledger besu client
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/lib/explorer/chain/import/runner/blocks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ defmodule Explorer.Chain.Import.Runner.Blocks do
or_where: block.number in ^consensus_block_numbers,
# we also need to acquire blocks that will be upserted here, for ordering
or_where: block.hash in ^hashes,
select: block.hash,
select: %{hash: block.hash, number: block.number},
# Enforce Block ShareLocks order (see docs: sharelocks.md)
order_by: [asc: block.hash],
lock: "FOR NO KEY UPDATE"
Expand Down Expand Up @@ -413,7 +413,7 @@ defmodule Explorer.Chain.Import.Runner.Blocks do
from(
token_transfer in TokenTransfer,
join: s in subquery(acquire_query),
on: token_transfer.block_hash == s.hash,
on: token_transfer.block_number == s.number,
# we don't want to remove consensus from blocks that will be upserted
where: token_transfer.block_hash not in ^hashes
),
Expand Down

0 comments on commit 1b8397c

Please sign in to comment.