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

Chain metadata service not updating metadata on reorgs #1890

Merged
merged 1 commit into from
May 20, 2020

Conversation

neonknight64
Copy link
Contributor

Description

  • Fixed an issue with the chain metadata service where it was not updating its copy of the chain metadata on reorg events. This could have resulted in some nodes on the network reporting outdated chain metadata.
  • The chain metadata service will look for both block add and reorg events to determine if the blockchain db state was updated and the latest chain metadata needs to be retrieved.
    -Also, chained the max send retries used by the Message protocol to 1.

Motivation and Context

The chain metadata service keeps an internal copy of the chain metadata that it distributes to remote nodes. It should keep this copy uptodate with the blockchain db based on received BlockEvents. It only updated the metadata on block add events and not reorg events, this could have resulted in outdated metadata being shared on the network.

How Has This Been Tested?

Existing tests remain functioning.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

…data that it distributes to remote nodes. It should keep this copy uptodate with the blockchain db based on received BlockEvents. It only updated the metadata on block add events and not reorg events, this could have resulted in outdated metadata being shared on the network.

- Fixed an issue with the chain metadata service where it was not updating its copy of the chain metadata on reorg events. This could have resulted in some nodes on the network reporting outdated chain metadata.
- The chain metadata service will look for both block add and reorg events to determine if the blockchain db state was updated and the latest chain metadata needs to be retrieved.
- Also, chained the max send retries used by the Message protocol to 1.
@neonknight64 neonknight64 force-pushed the yuko-chainmetadata_service_update branch from 504d087 to bb3ada5 Compare May 19, 2020 13:46
Copy link
Contributor

@philipr-za philipr-za left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

👍

@@ -42,4 +42,4 @@ pub const MESSAGING_EVENTS_BUFFER_SIZE: usize = 100;
pub const MESSAGING_REQUEST_BUFFER_SIZE: usize = 50;
/// The default maximum number of times to retry sending a failed message before publishing a SendMessageFailed event.
/// This can be low because dialing a peer is already attempted a number of times.
pub const MESSAGING_MAX_SEND_RETRIES: usize = 2;
pub const MESSAGING_MAX_SEND_RETRIES: usize = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Might need to watch this for wallets, but agree with this in general. Good to see that tests pass, seems to indicate this retry (originally in response to test flakiness) might not be needed at all!

@sdbondi sdbondi merged commit 4136b1b into development May 20, 2020
@sdbondi sdbondi deleted the yuko-chainmetadata_service_update branch May 22, 2020 11:46
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.

3 participants