forked from cerc-io/ipld-eth-server
Sync only missing blocks on cold import
= Add eth_node_fingerprint to block that can be imitated by both hot and cold imports - Only sync missing blocks (blocks that are missing or don't share a fingerprint) on cold import - Set block is_final status after import
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE blocks
|
||||
DROP COLUMN eth_node_fingerprint;
|
||||
@@ -0,0 +1,14 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE blocks
|
||||
ADD COLUMN eth_node_fingerprint VARCHAR(128);
|
||||
|
||||
UPDATE blocks
|
||||
SET eth_node_fingerprint = (
|
||||
SELECT eth_node_id FROM eth_nodes WHERE eth_nodes.id = blocks.eth_node_id
|
||||
);
|
||||
|
||||
ALTER TABLE blocks
|
||||
ALTER COLUMN eth_node_fingerprint SET NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
+2
-1
@@ -83,7 +83,8 @@ CREATE TABLE public.blocks (
|
||||
miner character varying(42),
|
||||
extra_data character varying,
|
||||
reward double precision,
|
||||
uncles_reward double precision
|
||||
uncles_reward double precision,
|
||||
eth_node_fingerprint character varying(128) NOT NULL
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user