diff --git a/CHANGELOG.md b/CHANGELOG.md index cfb61e9ec7..8582ddf55f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#3564](https://github.com/poanetwork/blockscout/pull/3564) - Staking welcome message ### Fixes +- [#3600](https://github.com/poanetwork/blockscout/pull/3600) - Prevent update validator metadata with empty name from contract - [#3592](https://github.com/poanetwork/blockscout/pull/3592) - Contract interaction: fix nested tuples in the output view, add formatting - [#3583](https://github.com/poanetwork/blockscout/pull/3583) - Reduce RPC requests and DB changes by Staking DApp diff --git a/apps/explorer/lib/explorer/validator/metadata_importer.ex b/apps/explorer/lib/explorer/validator/metadata_importer.ex index 5c6757ffbd..8cc3792a77 100644 --- a/apps/explorer/lib/explorer/validator/metadata_importer.ex +++ b/apps/explorer/lib/explorer/validator/metadata_importer.ex @@ -9,7 +9,12 @@ defmodule Explorer.Validator.MetadataImporter do def import_metadata(metadata_maps) do # Enforce Name ShareLocks order (see docs: sharelocks.md) - ordered_metadata_maps = Enum.sort_by(metadata_maps, &{&1.address_hash, &1.name}) + ordered_metadata_maps = + metadata_maps + |> Enum.filter(fn metadata -> + String.trim(metadata.name) !== "" + end) + |> Enum.sort_by(&{&1.address_hash, &1.name}) Repo.transaction(fn -> Enum.each(ordered_metadata_maps, &upsert_validator_metadata(&1)) end) end