diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fcef31886f17cbb17ef1506935d6f87dd0801282..c849a2a12489ea3931bd6a314c812d648fc74082 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -264,9 +264,7 @@ validate_haf_commit: prepare_haf_image: stage: build - extends: - - .prepare_haf_image - - .skip_on_docs_only_or_quick_test + extends: .prepare_haf_image needs: - job: detect_changes optional: true # Not needed on protected branches @@ -293,15 +291,10 @@ prepare_haf_image: - public-runner-docker prepare_haf_data: - extends: - - .prepare_haf_data_5m - - .skip_on_docs_only_or_quick_test + extends: .prepare_haf_data_5m needs: - - job: detect_changes - optional: true - job: prepare_haf_image artifacts: true - optional: true # Not needed if build was skipped stage: build timeout: 80m variables: @@ -495,6 +488,8 @@ sync: --ansi never # Avoid nested submodule issues GIT_SUBMODULE_STRATEGY: none + # Use local block_log on each builder (faster than NFS) + SHARED_BLOCK_LOG_DIR: /blockchain/block_log_5m timeout: 1 hours before_script: - | diff --git a/database/hafbe_app_helpers.sql b/database/hafbe_app_helpers.sql index 9771ecfd9ed211d7f77d09e84550f2ff23297ab8..a4aacb14d016645c5b78edf2edb5fd5cf1f3408a 100644 --- a/database/hafbe_app_helpers.sql +++ b/database/hafbe_app_helpers.sql @@ -44,7 +44,7 @@ BEGIN RETURN EXISTS( SELECT true FROM pg_index WHERE indexrelid = ( - SELECT oid FROM pg_class WHERE relname = 'account_proxies_history_account_id' + SELECT oid FROM pg_class WHERE relname = 'witness_votes_history_witness_voter' ) ); END diff --git a/database/indexes/hafbe_app_indexes.sql b/database/indexes/hafbe_app_indexes.sql index 6fa5ab09b3e2f656eabad455d4a18d2d0bae79f0..94ee482b45d40f32e8697e4a12484e73929325ae 100644 --- a/database/indexes/hafbe_app_indexes.sql +++ b/database/indexes/hafbe_app_indexes.sql @@ -15,6 +15,9 @@ BEGIN --Can only vote once every 3 seconds, so sorting by block_num is sufficient CREATE INDEX IF NOT EXISTS witness_votes_history_witness_id_source_op ON hafbe_app.witness_votes_history USING btree (witness_id, hafd.operation_id_to_block_num( source_op )); + -- Index for efficient voter filtering in get_witness_votes_history endpoint + CREATE INDEX IF NOT EXISTS witness_votes_history_witness_voter ON hafbe_app.witness_votes_history USING btree (witness_id, voter_id); + CREATE INDEX IF NOT EXISTS account_proxies_history_account_id_source_op ON hafbe_app.account_proxies_history USING btree (account_id, source_op); CREATE INDEX IF NOT EXISTS account_proxies_history_account_id ON hafbe_app.account_proxies_history USING btree (account_id); CREATE INDEX IF NOT EXISTS current_account_proxies_proxy_id ON hafbe_app.current_account_proxies USING btree (proxy_id);