Skip to content

Enhance ChainState initialization and add genesis header validation tests - #1

Open
RLforlife wants to merge 2 commits into
AmazingAng:mainfrom
RLforlife:main
Open

Enhance ChainState initialization and add genesis header validation tests#1
RLforlife wants to merge 2 commits into
AmazingAng:mainfrom
RLforlife:main

Conversation

@RLforlife

Copy link
Copy Markdown
  • 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.

…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.
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.

1 participant