From eb64e6edd6970b1fc21dc2a0d6ea12f594f24baf Mon Sep 17 00:00:00 2001 From: GlacierWalrus <114941647+GlacierWalrus@users.noreply.github.com> Date: Wed, 15 Jan 2025 22:10:57 +0000 Subject: [PATCH 1/2] Add notransaction fix Disable transaction around `CREATE INDEX CONCURRENTLY` statements --- ...92635_add_validatorindex_slot_index_withdrawals_table.sql | 5 +++-- ...20250112125552_add_idx_blocks_status_depositscountgt0.sql | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/db/migrations/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql b/db/migrations/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql index 5bafa95f24..b902ba2774 100644 --- a/db/migrations/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql +++ b/db/migrations/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql @@ -1,11 +1,12 @@ +-- +goose NO TRANSACTION -- +goose Up --- +goose StatementBegin SELECT 'creating idx_blocks_withdrawals_validatorindex_slot'; +-- +goose StatementBegin CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_blocks_withdrawals_validatorindex_slot ON blocks_withdrawals (validatorindex, block_slot DESC); -- +goose StatementEnd -- +goose Down --- +goose StatementBegin SELECT 'dropping idx_blocks_withdrawals_validatorindex_slot'; +-- +goose StatementBegin DROP INDEX CONCURRENTLY IF EXISTS idx_blocks_withdrawals_validatorindex_slot; -- +goose StatementEnd diff --git a/db/migrations/20250112125552_add_idx_blocks_status_depositscountgt0.sql b/db/migrations/20250112125552_add_idx_blocks_status_depositscountgt0.sql index 726f7747e1..b51adc9c2e 100644 --- a/db/migrations/20250112125552_add_idx_blocks_status_depositscountgt0.sql +++ b/db/migrations/20250112125552_add_idx_blocks_status_depositscountgt0.sql @@ -1,13 +1,13 @@ -- +goose NO TRANSACTION -- +goose Up --- +goose StatementBegin SELECT 'creating idx_blocks_status_depositscountgt0'; +-- +goose StatementBegin CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_blocks_status_depositscountgt0 ON blocks (status, (depositscount > 0)) where depositscount > 0; -- +goose StatementEnd -- +goose Down --- +goose StatementBegin SELECT 'dropping idx_blocks_status_depositscountgt0'; +-- +goose StatementBegin DROP INDEX CONCURRENTLY IF EXISTS idx_blocks_status_depositscountgt0; -- +goose StatementEnd From 3e5cca99141fe27a4d95e571ca003ea42d81fd1e Mon Sep 17 00:00:00 2001 From: GlacierWalrus <114941647+GlacierWalrus@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:42:10 +0000 Subject: [PATCH 2/2] Return consistent types during TransformEnsNameRegistered --- db/ens.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/ens.go b/db/ens.go index 943fab3e29..8e55ba0e9b 100644 --- a/db/ens.go +++ b/db/ens.go @@ -90,7 +90,9 @@ func (bigtable *Bigtable) TransformEnsNameRegistered(blk *types.Eth1Block, cache case "11155111": ensCrontractAddresses = ensContracts.ENSCrontractAddressesSepolia default: - return nil, nil, nil + return &types.BulkMutations{[]string{}, []*gcp_bigtable.Mutation{}}, + &types.BulkMutations{[]string{}, []*gcp_bigtable.Mutation{}}, + nil } bulkData = &types.BulkMutations{}