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

Set and get blocks tip without filtering #548

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Conversation

bacv
Copy link
Member

@bacv bacv commented Jan 2, 2024

Store the tip in a variable and return it when asked.

@bacv bacv added the consensus label Jan 2, 2024
@bacv bacv self-assigned this Jan 2, 2024
@bacv bacv marked this pull request as ready for review January 2, 2024 13:53
@@ -99,6 +97,7 @@ impl<O: Overlay> Carnot<O> {
let mut new_state = self.clone();
if new_state.block_is_safe(block.clone()) {
new_state.safe_blocks.insert(block.id, block.clone());
new_state.tip = block.clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

if block.view > new_state.tip.view ...

@bacv bacv force-pushed the consensus-graceful-errors branch from 44353c0 to 0c16e70 Compare January 2, 2024 14:01
@bacv bacv requested a review from zeegomo January 2, 2024 14:01
@bacv bacv merged commit 361b41c into master Jan 2, 2024
7 checks passed
@bacv bacv deleted the consensus-graceful-errors branch January 2, 2024 14:15
Comment on lines +35 to +36
safe_blocks: [(genesis_block.id, genesis_block.clone())].into(),
tip: genesis_block,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: The tip could be just the safe_blocks index.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would actually be much nicer. I'll focus now on a testnet instance, do you mind taking this over?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure! I'll do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants