Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…#2639)

* Delete duplicate values

* Fix release docker-compose (0xPolygonHermez#2638)
  • Loading branch information
ARR552 authored Oct 11, 2023
1 parent b169d93 commit 99b390a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
mkdir -p testnet/db/scripts
cp config/environments/testnet/* testnet/config/environments/testnet
cp docker-compose.yml testnet
sed -i 's/\/config\/environments\/${ZKEVM_NETWORK}/\/config\/environments\/testnet/g' mainnet/docker-compose.yml
cp db/scripts/init_prover_db.sql testnet/db/scripts
mv testnet/config/environments/testnet/example.env testnet
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" testnet/docker-compose.yml
Expand All @@ -50,6 +51,7 @@ jobs:
mkdir -p mainnet/db/scripts
cp config/environments/mainnet/* mainnet/config/environments/mainnet
cp docker-compose.yml mainnet
sed -i 's/\/config\/environments\/${ZKEVM_NETWORK}/\/config\/environments\/mainnet/g' mainnet/docker-compose.yml
cp db/scripts/init_prover_db.sql mainnet/db/scripts
mv mainnet/config/environments/mainnet/example.env mainnet
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" mainnet/docker-compose.yml
Expand Down
8 changes: 8 additions & 0 deletions db/migrations/state/0010.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
-- +migrate Up
CREATE INDEX IF NOT EXISTS l2block_block_hash_idx ON state.l2block (block_hash);

DELETE FROM state.sequences a USING (
SELECT MIN(ctid) as ctid, from_batch_num
FROM state.sequences
GROUP BY from_batch_num HAVING COUNT(*) > 1
) b
WHERE a.from_batch_num = b.from_batch_num
AND a.ctid <> b.ctid;

ALTER TABLE state.sequences ADD PRIMARY KEY(from_batch_num);
ALTER TABLE state.trusted_reorg ADD PRIMARY KEY(timestamp);
ALTER TABLE state.sync_info ADD PRIMARY KEY(last_batch_num_seen, last_batch_num_consolidated, init_sync_batch);
Expand Down

0 comments on commit 99b390a

Please sign in to comment.