Skip to content

Chainsync pipelining fixes + EventListener and Plugin framework#126

Merged
satran004 merged 52 commits intodevelop/yaci-nodefrom
feat/chainsync_pipeline_2
Feb 9, 2026
Merged

Chainsync pipelining fixes + EventListener and Plugin framework#126
satran004 merged 52 commits intodevelop/yaci-nodefrom
feat/chainsync_pipeline_2

Conversation

@satran004
Copy link
Copy Markdown
Member

No description provided.

satran004 and others added 30 commits August 4, 2025 23:48
Introduced mandatory chainstate continuity checks to prevent gaps while storing blocks or headers. Enhanced recovery logic in `BodyFetchManager` for immediate resumption near the chain tip. Added robust tests for gap detection, debugging, and header/block existence validation.
Introduced a mechanism to notify the server when new blocks are stored during the STEADY_STATE phase. This ensures minimal notifications during initial sync and provides real-time updates only when the node is at the blockchain tip. Updated `PipelineDataListener` to invoke the new method in `YaciNode` for block notifications.
Refactored the first block retrieval to dynamically determine the starting point without relying on hardcoded metadata keys. Updated `BodyFetchManager` to use the new dynamic approach, ensuring compatibility across networks and enhanced syncing performance. Removed unused serialization methods and redundant metadata updates.
Deleted outdated test files including ChainStateDebugTest, ChainStateGapDetectionTest, ChainStateRecoveryTest, and HeaderGapAnalysisTest. These files are no longer relevant and contain redundant or unused code for chainstate debugging and analysis.
Introduced dynamic next phase selection for sync based on the distance to the remote tip. The new logic transitions to STEADY_STATE or INITIAL_SYNC depending on whether the distance threshold (1000 slots) is met. Improved logging to include detailed phase transition and distance information.
The testDirectRocksDBChainState_HeaderTipSupport() method is now annotated with @disabled. This change might be temporary to address issues or avoid test failures during development or refactoring.
Added test logging to display events such as started, passed, skipped, and failed. Configured full exception format and enabled standard stream output for better debugging and test transparency.
Introduced SyncTipContext to facilitate sharing the latest network tip between HeaderSyncManager and BodyFetchManager. Updated the initialization and constructors of both managers to include SyncTipContext, enabling improved logging and decision-making near the network tip. This enhances synchronization accuracy and reduces redundant logging during steady-state and initial sync phases.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@satran004 satran004 changed the title Feat/chainsync pipeline 2 (WIP) Chainsync pipelining fixes + EventListener and Plugin framework (WIP) Nov 18, 2025
@satran004 satran004 marked this pull request as draft November 18, 2025 05:26
satran004 and others added 11 commits November 19, 2025 13:50
Add NodeClientConfig to provide fine-grained control over connection behavior,
  addressing the issue where automatic reconnection was problematic for short-lived
  connections like peer discovery.
- Fix IPv4/IPv6 address byte order in PeerSharingSerializers to use little-endian
- Add support for both V11-12 (8 elements) and V13+ (6 elements) IPv6 peer address formats
- Reduce PeerSharingAgent timeout from 30s to 5s
chore: Bump version for 0.4.0 and README change
fix: Correct byte order for IPv4/IPv6 peer address serialization
 Rename currenState -> currentState across all 16 protocol agent files.

 Fix TOCTOU race in Agent.writeMessage() where channel could become null
 between the null-check and synchronized(channel) block during reconnection.

 Changes: make channel field volatile, synchronize setChannel(), capture
 channel to local variable in writeMessage(), and pass it as parameter to
 writeSingleSegment/writeSegmentedMessage. Cross-agent synchronization on
 the shared Channel object is preserved
# Conflicts:
#	core/src/main/java/com/bloxbean/cardano/yaci/core/network/Session.java
#	gradle.properties
@satran004 satran004 marked this pull request as ready for review February 9, 2026 11:54
@satran004 satran004 changed the title Chainsync pipelining fixes + EventListener and Plugin framework (WIP) Chainsync pipelining fixes + EventListener and Plugin framework Feb 9, 2026
@satran004 satran004 changed the base branch from develop/yaci-node to next February 9, 2026 12:01
@satran004 satran004 changed the base branch from next to develop/yaci-node February 9, 2026 12:01
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@satran004 satran004 merged commit f32168d into develop/yaci-node Feb 9, 2026
1 of 2 checks passed
@satran004 satran004 deleted the feat/chainsync_pipeline_2 branch February 9, 2026 12:12
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