Enhance ChainState initialization and add genesis header validation tests - #1
Open
RLforlife wants to merge 2 commits into
Open
Enhance ChainState initialization and add genesis header validation tests#1RLforlife wants to merge 2 commits into
RLforlife wants to merge 2 commits into
Conversation
…ests - Modified the `ChainState::new` method to seed the block index with the genesis header, ensuring proper parent linkage for the first headers-message from peers. - Introduced a new test to validate that the genesis header hash matches across all network types (Mainnet, Testnet4, Regtest, Signet). - Improved DNS seed resolution in `PeerManager` by adding error handling and logging for unresolved seeds, and implemented a shuffle mechanism for discovered addresses before connection attempts. - Enhanced peer handshake error handling in `run_peer_inner` to provide more informative debug logs. These changes improve the robustness of the chain state initialization and enhance peer connection reliability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ChainState::newmethod to seed the block index with the genesis header, ensuring proper parent linkage for the first headers-message from peers.PeerManagerby adding error handling and logging for unresolved seeds, and implemented a shuffle mechanism for discovered addresses before connection attempts.run_peer_innerto provide more informative debug logs.These changes improve the robustness of the chain state initialization and enhance peer connection reliability.