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

fix: save last finalized block #8473

Merged
merged 21 commits into from
Jun 6, 2024

Conversation

fgimenez
Copy link
Member

@fgimenez fgimenez commented May 29, 2024

Closes #1712

Prevents potential issues with fixed finality depth on adverse conditions, there are no fixed bounds to finality depth and the actual finalized block can be earlier than a last_finalized_block_number initialized to a fixed value.

@github-actions github-actions bot added A-blockchain-tree Related to sidechains, reorgs and pending blocks A-staged-sync Related to staged sync (pipelines and stages) C-enhancement New feature or request labels May 29, 2024
@fgimenez fgimenez force-pushed the fgimenez/init-last-finalized-block-number branch from d261633 to 3b11598 Compare May 29, 2024 15:36
@fgimenez fgimenez changed the title WIP fix: save last finalized block fix: save last finalized block May 29, 2024
@fgimenez fgimenez marked this pull request as ready for review May 29, 2024 16:18
@fgimenez fgimenez added the C-security Issue or pull request related to security. label May 29, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, storing finalized is sound imo because finalized, hehe

pending @rkrasiuk

@joshieDo
Copy link
Collaborator

unwinds should probably clear this one out if it goes beyond this block. this can happen when manually calling unwind

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

makes sense to me

@mattsse
Copy link
Collaborator

mattsse commented May 30, 2024

unwinds should probably clear this one out if it goes beyond this block. this can happen when manually calling unwind

what are you suggesting? what needs to be done?

@joshieDo
Copy link
Collaborator

joshieDo commented May 31, 2024

if there's a pipeline unwind that goes beyond that block, replace it with a lower one on Finish stage unwind fn

@fgimenez
Copy link
Member Author

if there's a pipeline unwind that goes beyond that block, replace it with a lower one on Finish stage unwind fn

@joshieDo cool thx! we should save the lowest one that results from the unwind operation, right? either to-block or the lowest end resulting from num-blocks?

@fgimenez fgimenez force-pushed the fgimenez/init-last-finalized-block-number branch 2 times, most recently from e5ebb0b to eaec49d Compare June 3, 2024 10:10
@fgimenez
Copy link
Member Author

fgimenez commented Jun 3, 2024

if there's a pipeline unwind that goes beyond that block, replace it with a lower one on Finish stage unwind fn

@joshieDo ok done here eaec49d by introducing a FinalizedBlockProvider trait with default methods, ptal

@fgimenez fgimenez requested a review from joshieDo June 4, 2024 12:33
@fgimenez fgimenez force-pushed the fgimenez/init-last-finalized-block-number branch from 9c91eb7 to 6750cea Compare June 5, 2024 08:33
@fgimenez fgimenez requested a review from rkrasiuk June 6, 2024 07:58
@fgimenez fgimenez added this pull request to the merge queue Jun 6, 2024
Merged via the queue into main with commit a583def Jun 6, 2024
29 checks passed
@fgimenez fgimenez deleted the fgimenez/init-last-finalized-block-number branch June 6, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-tree Related to sidechains, reorgs and pending blocks A-staged-sync Related to staged sync (pipelines and stages) C-enhancement New feature or request C-security Issue or pull request related to security.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save last finalized block
5 participants