Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Fix: chainsync can break on old data#178

Merged
JannikSt merged 2 commits into
developfrom
fix/chainsync-breaks-on-chain-restart
Mar 27, 2025
Merged

Fix: chainsync can break on old data#178
JannikSt merged 2 commits into
developfrom
fix/chainsync-breaks-on-chain-restart

Conversation

@JannikSt
Copy link
Copy Markdown
Member

No description provided.

@JannikSt JannikSt requested a review from Copilot March 27, 2025 01:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses potential failures when syncing node data by adding robust error handling and refactoring inline error-prone code into a dedicated async function. Key changes include:

  • Replacing unwrap calls with error handling via map_err.
  • Introducing the async function sync_single_node to encapsulate node synchronization logic.
  • Updating error types from Result<()> to Result<(), Error> for improved error propagation.
Comments suppressed due to low confidence (2)

discovery/src/chainsync/sync.rs:36

  • [nitpick] The variable 'n' is ambiguous. Consider renaming it to a more descriptive name such as 'updated_node' for better code clarity.
let mut n = node.clone();

discovery/src/chainsync/sync.rs:40

  • [nitpick] Consider using a structured logging framework instead of eprintln for error reporting to better support production diagnostics and log management.
eprintln!("Failed to parse provider address: {}", e);

@JannikSt JannikSt merged commit 8934a12 into develop Mar 27, 2025
JannikSt added a commit that referenced this pull request Apr 12, 2025
* fix chainsync can break on old data

* cleanup
@JannikSt JannikSt deleted the fix/chainsync-breaks-on-chain-restart branch June 25, 2025 13:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants