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: don't block unfinalised dot source when can't find events #4301

Merged
merged 4 commits into from Dec 1, 2023

Conversation

kylezs
Copy link
Contributor

@kylezs kylezs commented Dec 1, 2023

Pull Request

Closes: PRO-1010

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

Previously in the case of a dot reorg it was possible that the dot source would wait forever to try to get events from a hash that didn't exist, causing dot chain tracking to stop. Now it just makes 2 attempts, and fails out, allowing the chain tracking to continue in such a case.

@kylezs kylezs force-pushed the fix/dot-chain-tracking-stops-on-no-events branch from 67dea9a to 57dd6f8 Compare December 1, 2023 11:05
@@ -155,7 +155,8 @@ impl<
async fn stream_and_client(
&self,
) -> (BoxChainStream<'_, Self::Index, Self::Hash, Self::Data>, Self::Client) {
polkadot_source!(self, subscribe_finalized_heads, NoRetryLimit, |raw_events| { raw_events })
let unwrap_events = |raw_events| raw_events;
Copy link
Contributor

Choose a reason for hiding this comment

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

you could dedup this by putting the var inside the macro.

@kylezs kylezs enabled auto-merge (squash) December 1, 2023 15:13
@kylezs kylezs merged commit 9e28910 into main Dec 1, 2023
40 checks passed
@kylezs kylezs deleted the fix/dot-chain-tracking-stops-on-no-events branch December 1, 2023 15:47
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