Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db: Add a field to the Tx table which holds the block index #94

Merged
merged 5 commits into from
May 19, 2020

Conversation

erikd
Copy link
Contributor

@erikd erikd commented May 17, 2020

No description provided.

@erikd erikd requested a review from rhyslbw May 17, 2020 22:46
Copy link
Contributor

@ksaric ksaric left a comment

Choose a reason for hiding this comment

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

@erikd Could you just extend the migration to include the latest change as the new migration instead of dropping the whole migration path?
I have some code changes that depend on these migration paths and it's not trivial to change this.
This is the exact reason why we have migrations.

Update: After discussing this with Erik, I have accepted this to be fine in this instance since we have to iterate over the history of the blocks anyway, and it's safer since we are actually syncing the data from the blockchain.

erikd added 4 commits May 18, 2020 17:43
This new field is the index of the transaction within a block. There
is no easy way to write a migration for this, so the database needs to
be dropped and recreated.

Closes: #91
The addition of a 'block_index' column to the 'tx' table required
that the database be dropped and recreated, so it makes sense to
flatten the migrations in the same PR.
@erikd erikd force-pushed the erikd/tx-index branch 2 times, most recently from ef2ce4a to bb868af Compare May 18, 2020 23:05
Only update last row of the epoch table when the block being processed
is within 15 blocks (5 minutes) of the tip.

This improves sync speed of the current epoch.
@erikd erikd merged commit a85b14b into master May 19, 2020
@iohk-bors iohk-bors bot deleted the erikd/tx-index branch May 19, 2020 07:58
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.

None yet

3 participants