Skip to content

Update header table constraints#58

Merged
elizabethengelman merged 1 commit intostagingfrom
update-header-table-constraints
Feb 27, 2020
Merged

Update header table constraints#58
elizabethengelman merged 1 commit intostagingfrom
update-header-table-constraints

Conversation

@elizabethengelman
Copy link
Copy Markdown

removing the block hash from the constraint

removing the block hash from the constraint
Copy link
Copy Markdown

@gslaughl gslaughl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! My only question is whether we want to do anything on conflict, since right now it looks like InternalInsertHeader doesn't do anything if it runs into a conflict. Could that result in us discarding the correct header, and keeping the bad header in a reorg?

created TIMESTAMP NOT NULL DEFAULT NOW(),
updated TIMESTAMP NOT NULL DEFAULT NOW(),
UNIQUE (block_number, hash, eth_node_id)
UNIQUE (block_number, eth_node_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like my concern about potentially discarding the canonical header is misplaced, since if that happens it'll get fixed when the header is validated 👍

err error
timestamp string
db *postgres.DB
db = test_config.NewTestDB(test_config.NewTestNode())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯


_, err = repo.InternalInsertHeader(headerTwo)
Expect(err).To(HaveOccurred())
Expect(err).To(MatchError(repositories.ErrValidHeaderExists))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@elizabethengelman elizabethengelman merged commit 2c6d59a into staging Feb 27, 2020
@elizabethengelman elizabethengelman deleted the update-header-table-constraints branch February 27, 2020 18:11
elizabethengelman pushed a commit that referenced this pull request Feb 28, 2020
* Update header table constraint to block_number and node_id (#58)

removing the block hash from the constraint

* VDB-1219: handle eof errors (#59)

* Don't return UnexpectedEOF when extracting logs

* Remove logging redundant logs in EventWatcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants