Compare commits

..
34 Commits
Author SHA1 Message Date
Ian Norden 05600e51d2 Merge pull request #59 from vulcanize/release-v3.2.0
update the pre- and post- batch sets with new meta schema and tables
2022-03-31 12:47:32 -05:00
i-norden 201cadbd49 update the pre- and post- batch sets with new meta schema and tables 2022-03-31 12:45:27 -05:00
Ian Norden 82f28ae6ba Merge pull request #53 from vulcanize/feature/known_table
Add `known_gaps` table
2022-03-31 11:12:54 -05:00
Abdul Rabbani 63e3d66cc1 Merge branch 'main' into feature/known_table 2022-03-31 12:07:28 -04:00
Abdul Rabbani 2ffb98c6f7 Change file name 2022-03-31 12:06:11 -04:00
Abdul Rabbani b2f8f63a65 Update file name 2022-03-31 10:47:29 -04:00
Abdul Rabbani e99787242e Add Migration file 2022-03-31 10:45:11 -04:00
Ian Norden d8dbd14af8 Merge pull request #54 from deep-stack/ng-watched-addresses-v3
Add a table for watched addresses (v3)
2022-03-23 07:08:59 -05:00
nabarun 679f3e8d79 Remove GO111MODULE flag when installing goose in makefile
Passing GO111MODULE=off with go get throws error. The CI fails due to this when using the makefile.
2022-03-21 17:07:46 +05:30
Abdul Rabbani a1b75c31e9 Update schema.sql 2022-03-19 09:17:48 -04:00
Abdul Rabbani 35b40e6ff7 Add known_gaps table - DO NOT MERGE YET!!
We will probably need to change the `modulus_block_number` columns name
2022-03-18 14:35:07 -04:00
nabarun a500c1a49a Add table for watched addresses in eth_meta schema 2022-03-17 19:02:05 +05:30
Ian Norden bba8a410f8 Merge pull request #50 from vulcanize/release-v3.0.7
Release v3.0.7
2022-03-07 11:12:09 -06:00
i-norden f59582ab42 indexes on receipt cid and mh_key should not be unique, as it is possible (but improbable) that two receipts can be identical 2022-02-16 14:11:23 -06:00
Ian Norden 16e17abb7e Merge pull request #47 from vulcanize/release-v3.0.6
split pk application into two parts
2022-01-26 13:09:24 -06:00
i-norden 9e7e0377a5 split pk application into two parts 2022-01-26 13:01:41 -06:00
Ian Norden 36de257357 Merge pull request #46 from vulcanize/release-v3.0.5
drop un-unique indexes
2022-01-25 12:33:34 -06:00
i-norden 0710ed1bb1 drop un-unique indexes 2022-01-25 12:31:59 -06:00
Ian Norden c4254bdff1 Merge pull request #45 from vulcanize/release-v3.0.3
prep for integrated node of v3
2022-01-25 09:29:26 -06:00
i-norden 1088313ab7 prep for integrated node of v3 2022-01-25 08:29:25 -06:00
Ian Norden ffdf0a0d4d Merge pull request #43 from vulcanize/release-v3.0.2
v3.0.2
2022-01-19 15:31:13 -06:00
i-norden edabfcc9c9 migration for applying log_cids.leaf_mh_key FK constraint to check that repair process was completed 2022-01-19 15:21:29 -06:00
Ian Norden 6612edabbe Merge pull request #41 from vulcanize/release-v3.0.1
disable and renable indexes correctly
2022-01-10 21:52:25 -06:00
i-norden ae1a6e9d31 disable and renable indexes correctly 2022-01-10 21:51:04 -06:00
Ian Norden 35a1ba7218 Merge pull request #40 from vulcanize/release-v3.0.0
Release v3.0.0
2022-01-10 12:49:57 -06:00
i-norden 4699385a21 new make targets for rolling back pre and post-batch migrations 2022-01-10 12:13:52 -06:00
i-norden a2c98550b7 mig to upgrade schema version in db; mig to remove temporary indexes for logTrie fix 2022-01-10 12:13:49 -06:00
i-norden 4ad1250ea1 split out new post-batch migration for indexes that will accelerate our logTrie repair process 2022-01-10 11:53:55 -06:00
Ian Norden 3fb695c1e6 Merge pull request #39 from vulcanize/release-v0.3.3
Release v0.3.3
2022-01-07 13:44:36 -06:00
i-norden b5b9950f1d default val for GOPATH in Makefile 2022-01-07 13:41:40 -06:00
i-norden 858d6ee85a set GO111MODULE=off when go getting 2022-01-07 13:07:57 -06:00
i-norden d313d4823e new make targets for running up migrations one at a time 2022-01-07 12:56:19 -06:00
i-norden 8b64621f46 move public.blocks PK application into own migration to be applied alone 2022-01-07 12:52:45 -06:00
i-norden 70d571e03e rename file, no schema changes 2022-01-07 12:51:29 -06:00
26 changed files with 317 additions and 49 deletions
+24 -1
View File
@@ -1,3 +1,7 @@
ifndef GOPATH
override GOPATH = $(HOME)/go
endif
BIN = $(GOPATH)/bin BIN = $(GOPATH)/bin
# Tools # Tools
@@ -44,12 +48,26 @@ rollback: $(GOOSE) checkdbvars
$(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down $(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down
pg_dump -O -s $(CONNECT_STRING) > schema.sql pg_dump -O -s $(CONNECT_STRING) > schema.sql
## Rollback to a select migration (id/timestamp) ## Rollback to a select migration (id/timestamp)
.PHONY: rollback_to .PHONY: rollback_to
rollback_to: $(GOOSE) checkmigration checkdbvars rollback_to: $(GOOSE) checkmigration checkdbvars
$(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)" $(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)"
## Rollback pre_batch_set
.PHONY: `rollback_pre_batch_set`
rollback_pre_batch_set: $(GOOSE) checkdbvars
$(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" down
## Rollback post_batch_set
.PHONY: rollback_post_batch_set
rollback_post_batch_set: $(GOOSE) checkdbvars
$(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" down
## Apply the next up migration
.PHONY: migrate_up_by_one
migrate_up_by_one: $(GOOSE) checkdbvars
$(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" up-by-one
## Apply all migrations not already run ## Apply all migrations not already run
.PHONY: migrate .PHONY: migrate
migrate: $(GOOSE) checkdbvars migrate: $(GOOSE) checkdbvars
@@ -61,6 +79,11 @@ migrate: $(GOOSE) checkdbvars
migrate_pre_batch_set: $(GOOSE) checkdbvars migrate_pre_batch_set: $(GOOSE) checkdbvars
$(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" up $(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" up
## Apply migrations to be ran after a batch processing, one-by-one
.PHONY: migrate_post_batch_set_up_by_one
migrate_post_batch_set_up_by_one: $(GOOSE) checkdbvars
$(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" up-by-one
## Apply migrations to be ran after a batch processing ## Apply migrations to be ran after a batch processing
.PHONY: migrate_post_batch_set .PHONY: migrate_post_batch_set
migrate_post_batch_set: $(GOOSE) checkdbvars migrate_post_batch_set: $(GOOSE) checkdbvars
+4 -4
View File
@@ -1,8 +1,8 @@
-- +goose Up -- +goose Up
-- header indexes -- header indexes
CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number); CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number);
CREATE INDEX header_cid_index ON eth.header_cids USING btree (cid); CREATE UNIQUE INDEX header_cid_index ON eth.header_cids USING btree (cid);
CREATE INDEX header_mh_index ON eth.header_cids USING btree (mh_key); CREATE UNIQUE INDEX header_mh_index ON eth.header_cids USING btree (mh_key);
CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root); CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root);
CREATE INDEX timestamp_index ON eth.header_cids USING brin (timestamp); CREATE INDEX timestamp_index ON eth.header_cids USING brin (timestamp);
@@ -11,8 +11,8 @@ CREATE INDEX uncle_header_id_index ON eth.uncle_cids USING btree (header_id);
-- transaction indexes -- transaction indexes
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id); CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid); CREATE UNIQUE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid);
CREATE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key); CREATE UNIQUE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key);
CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst); CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst);
CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src); CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src);
+3 -3
View File
@@ -1,6 +1,6 @@
-- +goose Up -- +goose Up
INSERT INTO public.db_version (singleton, version) VALUES (true, 'v0.3.2') INSERT INTO public.db_version (singleton, version) VALUES (true, 'v3.0.0')
ON CONFLICT (singleton) DO UPDATE SET (version, tstamp) = ('v0.3.2', NOW()); ON CONFLICT (singleton) DO UPDATE SET (version, tstamp) = ('v3.0.0', NOW());
-- +goose Down -- +goose Down
DELETE FROM public.db_version WHERE version = 'v0.3.2'; DELETE FROM public.db_version WHERE version = 'v3.0.0';
@@ -0,0 +1,5 @@
-- +goose Up
CREATE SCHEMA eth_meta;
-- +goose Down
DROP SCHEMA eth_meta;
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE eth_meta.watched_addresses (
address VARCHAR(66) PRIMARY KEY,
created_at BIGINT NOT NULL,
watched_at BIGINT NOT NULL,
last_filled_at BIGINT NOT NULL DEFAULT 0
);
-- +goose Down
DROP TABLE eth_meta.watched_addresses;
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE eth_meta.known_gaps (
starting_block_number bigint PRIMARY KEY,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);
-- +goose Down
DROP TABLE eth_meta.known_gaps;
@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE public.blocks
ADD CONSTRAINT pk_public_blocks PRIMARY KEY (key);
-- +goose Down
ALTER TABLE public.blocks
DROP CONSTRAINT pk_public_blocks;
@@ -0,0 +1,8 @@
-- +goose Up
INSERT INTO public.db_version (singleton, version) VALUES (true, 'v3.0.0')
ON CONFLICT (singleton) DO UPDATE SET (version, tstamp) = ('v3.0.0', NOW());
-- +goose Down
DELETE FROM public.db_version WHERE version = 'v3.0.0';
INSERT INTO public.db_version (singleton, version) VALUES (true, 'v0.3.2')
ON CONFLICT (singleton) DO UPDATE SET (version, tstamp) = ('v0.3.2', NOW());
@@ -0,0 +1,15 @@
-- +goose Up
CREATE INDEX log_mh_index ON eth.log_cids USING btree (leaf_mh_key);
CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number);
CREATE INDEX header_block_hash_index ON eth.header_cids USING btree (block_hash);
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
CREATE INDEX tx_tx_hash_index ON eth.transaction_cids USING btree (tx_hash);
CREATE INDEX log_cids_index ON eth.log_cids USING btree (rct_id, index);
-- +goose Down
DROP INDEX eth.log_cids_index;
DROP INDEX eth.tx_tx_hash_index;
DROP INDEX eth.tx_header_id_index;
DROP INDEX eth.header_block_hash_index;
DROP INDEX eth.block_number_index;
DROP INDEX eth.log_mh_index;
@@ -0,0 +1,9 @@
-- +goose Up
ALTER TABLE eth.log_cids
ADD CONSTRAINT fk_log_leaf_mh_key
FOREIGN KEY (leaf_mh_key) REFERENCES public.blocks (key)
ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-- +goose Down
ALTER TABLE eth.log_cids
DROP CONSTRAINT fk_log_leaf_mh_key;
@@ -0,0 +1,53 @@
-- +goose Up
UPDATE pg_index
SET indisready=false
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.log_cids'
);
UPDATE pg_index
SET indisready=false
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.transaction_cids'
);
UPDATE pg_index
SET indisready=false
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.header_cids'
);
ALTER TABLE eth.log_cids
DROP CONSTRAINT fk_log_leaf_mh_key;
-- +goose Down
ALTER TABLE eth.log_cids
ADD CONSTRAINT fk_log_leaf_mh_key
FOREIGN KEY (leaf_mh_key) REFERENCES public.blocks (key)
ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
UPDATE pg_index
SET indisready=true
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.header_cids'
);
UPDATE pg_index
SET indisready=true
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.transaction_cids'
);
UPDATE pg_index
SET indisready=true
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.log_cids'
);
@@ -0,0 +1,53 @@
-- +goose Up
UPDATE pg_index
SET indisready=true
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.header_cids'
);
UPDATE pg_index
SET indisready=true
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.transaction_cids'
);
UPDATE pg_index
SET indisready=true
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.log_cids'
);
DROP INDEX eth.tx_header_id_index;
DROP INDEX eth.block_number_index;
DROP INDEX eth.log_mh_index;
-- +goose Down
CREATE INDEX log_mh_index ON eth.log_cids USING btree (leaf_mh_key);
CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number);
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
UPDATE pg_index
SET indisready=false
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.log_cids'
);
UPDATE pg_index
SET indisready=false
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.transaction_cids'
);
UPDATE pg_index
SET indisready=false
WHERE indrelid = (
SELECT oid
FROM pg_class
WHERE relname='eth.header_cids'
);
@@ -0,0 +1,9 @@
-- +goose Up
DROP INDEX eth.log_cids_index;
DROP INDEX eth.tx_tx_hash_index;
DROP INDEX eth.header_block_hash_index;
-- +goose Down
CREATE INDEX header_block_hash_index ON eth.header_cids USING btree (block_hash);
CREATE INDEX tx_tx_hash_index ON eth.transaction_cids USING btree (tx_hash);
CREATE INDEX log_cids_index ON eth.log_cids USING btree (rct_id, index);
@@ -1,7 +1,4 @@
-- +goose Up -- +goose Up
ALTER TABLE public.blocks
ADD CONSTRAINT pk_public_blocks PRIMARY KEY (key);
ALTER TABLE public.nodes ALTER TABLE public.nodes
ADD CONSTRAINT pk_public_nodes PRIMARY KEY (node_id); ADD CONSTRAINT pk_public_nodes PRIMARY KEY (node_id);
@@ -33,35 +30,32 @@ ALTER TABLE eth.state_accounts
ADD CONSTRAINT pk_eth_state_accounts PRIMARY KEY (header_id, state_path); ADD CONSTRAINT pk_eth_state_accounts PRIMARY KEY (header_id, state_path);
-- +goose Down -- +goose Down
ALTER TABLE public.blocks ALTER TABLE eth.state_accounts
DROP CONSTRAINT pk_public_blocks; DROP CONSTRAINT pk_eth_state_accounts;
ALTER TABLE public.nodes
DROP CONSTRAINT pk_public_nodes;
ALTER TABLE eth.header_cids
DROP CONSTRAINT pk_eth_header_cids;
ALTER TABLE eth.uncle_cids
DROP CONSTRAINT pk_eth_uncle_cids;
ALTER TABLE eth.transaction_cids
DROP CONSTRAINT pk_eth_transaction_cids;
ALTER TABLE eth.receipt_cids
DROP CONSTRAINT pk_eth_receipt_cids;
ALTER TABLE eth.access_list_elements
DROP CONSTRAINT pk_eth_access_list_elements;
ALTER TABLE eth.log_cids
DROP CONSTRAINT pk_eth_log_cids;
ALTER TABLE eth.state_cids
DROP CONSTRAINT pk_eth_state_cids;
ALTER TABLE eth.storage_cids ALTER TABLE eth.storage_cids
DROP CONSTRAINT pk_eth_storage_cids; DROP CONSTRAINT pk_eth_storage_cids;
ALTER TABLE eth.state_accounts ALTER TABLE eth.state_cids
DROP CONSTRAINT pk_eth_state_accounts; DROP CONSTRAINT pk_eth_state_cids;
ALTER TABLE eth.log_cids
DROP CONSTRAINT pk_eth_log_cids;
ALTER TABLE eth.access_list_elements
DROP CONSTRAINT pk_eth_access_list_elements;
ALTER TABLE eth.receipt_cids
DROP CONSTRAINT pk_eth_receipt_cids;
ALTER TABLE eth.transaction_cids
DROP CONSTRAINT pk_eth_transaction_cids;
ALTER TABLE eth.uncle_cids
DROP CONSTRAINT pk_eth_uncle_cids;
ALTER TABLE eth.header_cids
DROP CONSTRAINT pk_eth_header_cids;
ALTER TABLE public.nodes
DROP CONSTRAINT pk_public_nodes;
@@ -0,0 +1,5 @@
-- +goose Up
CREATE SCHEMA eth_meta;
-- +goose Down
DROP SCHEMA eth_meta;
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE eth_meta.watched_addresses (
address VARCHAR(66) PRIMARY KEY,
created_at BIGINT NOT NULL,
watched_at BIGINT NOT NULL,
last_filled_at BIGINT NOT NULL DEFAULT 0
);
-- +goose Down
DROP TABLE eth_meta.watched_addresses;
@@ -0,0 +1,10 @@
-- +goose Up
CREATE TABLE eth_meta.known_gaps (
starting_block_number bigint PRIMARY KEY,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);
-- +goose Down
DROP TABLE eth_meta.known_gaps;
@@ -1,8 +1,8 @@
-- +goose Up -- +goose Up
-- header indexes -- header indexes
CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number); CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number);
CREATE INDEX header_cid_index ON eth.header_cids USING btree (cid); CREATE UNIQUE INDEX header_cid_index ON eth.header_cids USING btree (cid);
CREATE INDEX header_mh_index ON eth.header_cids USING btree (mh_key); CREATE UNIQUE INDEX header_mh_index ON eth.header_cids USING btree (mh_key);
CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root); CREATE INDEX state_root_index ON eth.header_cids USING btree (state_root);
CREATE INDEX timestamp_index ON eth.header_cids USING brin (timestamp); CREATE INDEX timestamp_index ON eth.header_cids USING brin (timestamp);
@@ -11,8 +11,8 @@ CREATE INDEX uncle_header_id_index ON eth.uncle_cids USING btree (header_id);
-- transaction indexes -- transaction indexes
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id); CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid); CREATE UNIQUE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid);
CREATE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key); CREATE UNIQUE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key);
CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst); CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst);
CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src); CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src);
@@ -46,8 +46,8 @@ CREATE INDEX access_list_element_address_index ON eth.access_list_elements USING
CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gin (storage_keys); CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gin (storage_keys);
-- log indexes -- log indexes
CREATE INDEX log_mh_index ON eth.log_cids USING btree (leaf_mh_key);
CREATE INDEX log_cid_index ON eth.log_cids USING btree (leaf_cid); CREATE INDEX log_cid_index ON eth.log_cids USING btree (leaf_cid);
CREATE INDEX log_mh_index ON eth.log_cids USING btree (leaf_mh_key);
CREATE INDEX log_address_index ON eth.log_cids USING btree (address); CREATE INDEX log_address_index ON eth.log_cids USING btree (address);
CREATE INDEX log_topic0_index ON eth.log_cids USING btree (topic0); CREATE INDEX log_topic0_index ON eth.log_cids USING btree (topic0);
CREATE INDEX log_topic1_index ON eth.log_cids USING btree (topic1); CREATE INDEX log_topic1_index ON eth.log_cids USING btree (topic1);
@@ -61,8 +61,8 @@ DROP INDEX eth.log_topic2_index;
DROP INDEX eth.log_topic1_index; DROP INDEX eth.log_topic1_index;
DROP INDEX eth.log_topic0_index; DROP INDEX eth.log_topic0_index;
DROP INDEX eth.log_address_index; DROP INDEX eth.log_address_index;
DROP INDEX eth.log_cid_index;
DROP INDEX eth.log_mh_index; DROP INDEX eth.log_mh_index;
DROP INDEX eth.log_cid_index;
-- access list indexes -- access list indexes
DROP INDEX eth.access_list_storage_keys_index; DROP INDEX eth.access_list_storage_keys_index;
+51 -4
View File
@@ -23,6 +23,13 @@ SET row_security = off;
CREATE SCHEMA eth; CREATE SCHEMA eth;
--
-- Name: eth_meta; Type: SCHEMA; Schema: -; Owner: -
--
CREATE SCHEMA eth_meta;
SET default_tablespace = ''; SET default_tablespace = '';
SET default_table_access_method = heap; SET default_table_access_method = heap;
@@ -402,6 +409,30 @@ CREATE TABLE eth.uncle_cids (
); );
--
-- Name: known_gaps; Type: TABLE; Schema: eth_meta; Owner: -
--
CREATE TABLE eth_meta.known_gaps (
starting_block_number bigint NOT NULL,
ending_block_number bigint,
checked_out boolean,
processing_key bigint
);
--
-- Name: watched_addresses; Type: TABLE; Schema: eth_meta; Owner: -
--
CREATE TABLE eth_meta.watched_addresses (
address character varying(66) NOT NULL,
created_at bigint NOT NULL,
watched_at bigint NOT NULL,
last_filled_at bigint DEFAULT 0 NOT NULL
);
-- --
-- Name: blocks; Type: TABLE; Schema: public; Owner: - -- Name: blocks; Type: TABLE; Schema: public; Owner: -
-- --
@@ -562,6 +593,22 @@ ALTER TABLE ONLY eth.uncle_cids
ADD CONSTRAINT uncle_cids_pkey PRIMARY KEY (block_hash); ADD CONSTRAINT uncle_cids_pkey PRIMARY KEY (block_hash);
--
-- Name: known_gaps known_gaps_pkey; Type: CONSTRAINT; Schema: eth_meta; Owner: -
--
ALTER TABLE ONLY eth_meta.known_gaps
ADD CONSTRAINT known_gaps_pkey PRIMARY KEY (starting_block_number);
--
-- Name: watched_addresses watched_addresses_pkey; Type: CONSTRAINT; Schema: eth_meta; Owner: -
--
ALTER TABLE ONLY eth_meta.watched_addresses
ADD CONSTRAINT watched_addresses_pkey PRIMARY KEY (address);
-- --
-- Name: blocks blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- Name: blocks blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
-- --
@@ -626,14 +673,14 @@ CREATE INDEX block_number_index ON eth.header_cids USING brin (block_number);
-- Name: header_cid_index; Type: INDEX; Schema: eth; Owner: - -- Name: header_cid_index; Type: INDEX; Schema: eth; Owner: -
-- --
CREATE INDEX header_cid_index ON eth.header_cids USING btree (cid); CREATE UNIQUE INDEX header_cid_index ON eth.header_cids USING btree (cid);
-- --
-- Name: header_mh_index; Type: INDEX; Schema: eth; Owner: - -- Name: header_mh_index; Type: INDEX; Schema: eth; Owner: -
-- --
CREATE INDEX header_mh_index ON eth.header_cids USING btree (mh_key); CREATE UNIQUE INDEX header_mh_index ON eth.header_cids USING btree (mh_key);
-- --
@@ -815,7 +862,7 @@ CREATE INDEX timestamp_index ON eth.header_cids USING brin ("timestamp");
-- Name: tx_cid_index; Type: INDEX; Schema: eth; Owner: - -- Name: tx_cid_index; Type: INDEX; Schema: eth; Owner: -
-- --
CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid); CREATE UNIQUE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid);
-- --
@@ -836,7 +883,7 @@ CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
-- Name: tx_mh_index; Type: INDEX; Schema: eth; Owner: - -- Name: tx_mh_index; Type: INDEX; Schema: eth; Owner: -
-- --
CREATE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key); CREATE UNIQUE INDEX tx_mh_index ON eth.transaction_cids USING btree (mh_key);
-- --