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: make canonical_chain atomic and canonical #11283

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Sep 27, 2024

closes #11282

this excludes the pending block from the canonical chain and captures all blocks at the time it is called.

some (incorrect) tests were updated by leveraging the intended insert block API.

@github-actions github-actions bot added the C-enhancement New feature or request label Sep 27, 2024
@mattsse mattsse added the C-bug An unexpected or incorrect behavior label Sep 27, 2024
@mattsse mattsse added this pull request to the merge queue Sep 27, 2024
///
/// This yields the blocks from newest to oldest (highest to lowest).
pub fn iter(self: Arc<Self>) -> impl Iterator<Item = Arc<Self>> {
std::iter::successors(Some(self), |state| state.parent.clone())
Copy link
Member

@DaniPopes DaniPopes Sep 27, 2024

Choose a reason for hiding this comment

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

Can also do this in chain/parent_state_chain?

Merged via the queue into main with commit 6757ab8 Sep 27, 2024
35 checks passed
@mattsse mattsse deleted the matt/canonical-atomic branch September 27, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

canonical_chain is not atomic and does include the pending block
3 participants