2022-08-30 17:05:51 +00:00
|
|
|
-- +goose Up
|
2022-08-30 17:06:01 +00:00
|
|
|
-- pending tx isn't tightly associated with a block height, so we can't insert the RLP encoded tx as an IPLD block
|
2023-02-09 00:35:07 +00:00
|
|
|
-- in ipld.blocks since it is denormalized by block number (we could do something hacky like using head height
|
2022-08-30 17:06:01 +00:00
|
|
|
-- when the block was seen, or 0 or -1 or something)
|
|
|
|
-- instead, what we are doing for the time being is embedding the RLP here
|
2022-08-30 17:05:51 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS eth.pending_txs (
|
|
|
|
tx_hash VARCHAR(66) NOT NULL PRIMARY KEY,
|
2023-02-10 16:38:31 +00:00
|
|
|
block_hash VARCHAR(66) NOT NULL, -- references block_hash in pending_blocks for the pending block this tx belongs to
|
2023-02-09 00:08:08 +00:00
|
|
|
timestamp BIGINT NOT NULL,
|
2022-08-30 17:06:01 +00:00
|
|
|
raw BYTEA NOT NULL
|
2022-08-30 17:05:51 +00:00
|
|
|
);
|
|
|
|
|
2023-02-10 16:38:31 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS eth.pending_blocks (
|
|
|
|
block_hash VARCHAR(66) NOT NULL PRIMARY KEY,
|
|
|
|
block_number BIGINT NOT NULL,
|
|
|
|
raw_header BYTEA NOT NULL
|
|
|
|
)
|
|
|
|
|
2022-08-30 17:05:51 +00:00
|
|
|
-- +goose Down
|
2023-02-10 16:38:31 +00:00
|
|
|
DROP TABLE eth.pending_blocks;
|
2022-08-30 17:05:51 +00:00
|
|
|
DROP TABLE eth.pending_txs;
|