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

(BIDS-2330) misc: add command fix-blocks #2730

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

guybrush
Copy link
Collaborator

@guybrush guybrush commented Nov 27, 2023

🤖[deprecated] Generated by Copilot at 0569bfe

This pull request introduces new commands and fixes for the database and node synchronization. It adds fix-exec-txs and fix-block-roots commands to cmd/misc/main.go to correct data inconsistencies. It also improves the dry-run flag functionality and the error handling and concurrency logic in the main package.

@guybrush guybrush force-pushed the BIDS-2330/fix-historic-orphan-blocks branch 2 times, most recently from 0a510bb to d30a9db Compare November 27, 2023 11:47
@guybrush guybrush force-pushed the BIDS-2330/fix-historic-orphan-blocks branch from d30a9db to 223c15a Compare November 28, 2023 11:47
@guybrush guybrush force-pushed the BIDS-2330/fix-historic-orphan-blocks branch from 2ee9b7d to e031e71 Compare December 18, 2023 15:09
Copy link
Collaborator

@D13ce D13ce left a comment

Choose a reason for hiding this comment

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

utACK

Just found two minor issues.

Comment on lines +1564 to +1571
lastEpoch := uint64(0)
for _, slot := range slots {
epoch := utils.EpochOfSlot(slot)
if epoch != lastEpoch {
epochs = append(epochs, epoch)
}
lastEpoch = epoch
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question: With this logic, slots of epoch 0 will not cause epoch 0 to be part of epochs, right?
For the ticket this PR is meant for, this should not cause an issue. But maybe this should be cleaned up nonetheless as you want to keep the PR.

Comment on lines +1748 to +1750
if iEnd > finalizedSlot+1 {
iEnd = finalizedSlot + 1
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: This should also include something like

if iEnd > end {
	iEnd = end
}

Because right now it could happen that start is something like end - 3 and in that case end would still be iEnd would still result in start + 1000.

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

2 participants