Skip to content

Merge n2n server agency (develop/yaci_node) branch to next#132

Open
satran004 wants to merge 59 commits intonextfrom
develop/yaci-node
Open

Merge n2n server agency (develop/yaci_node) branch to next#132
satran004 wants to merge 59 commits intonextfrom
develop/yaci-node

Conversation

@satran004
Copy link
Member

No description provided.

nemo83 and others added 30 commits March 10, 2025 17:11
* feat: adding isClient (or isServer) to State and Agents

* chore: updated all states

* chore: updated agents w/ default isClient falg
Introduced serialization and deserialization methods in various serializers, including LocalRollForward, Rollbackward, RequestNext, and others. Updated `ReplyTxIds` and `TxSubmissionClient` to support the Conway era and adjusted related logic accordingly.
Introduced `HybridYaciNode` to enable Yaci to function as both a Cardano client (for chain synchronization) and a server (to serve blockchain data to other clients). This implementation supports pipelined sync for improved performance, selective body fetch strategies, and adaptive sync transitions between bulk and real-time modes. Additionally, features include monitoring, rollback handling, and support for in-memory and RocksDB-based chain state storage.
Replaced `log.info` with `log.debug` in debug-level logs wrapped with `isDebugEnabled` checks to optimize performance. Removed commented-out code and temporary debugging statements for cleaner and more maintainable codebase. Updated log file paths for better clarity and organization.
Initialized Quarkus-based Yaci Node project with configuration files, core interfaces, and API implementation. Added support for client/server modes, syncing capabilities, and basic health checks. Includes gradle setup, YAML config, and test scaffolding.
Updated the trace log to include the size of TxIdAndSizeMap for better debugging clarity. This ensures meaningful log output during the deserialization process.
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.
satran004 and others added 29 commits August 30, 2025 20:24
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.
- Add global per-type ordering via SubscriptionOptions.priority
    - Map @DomainEventListener(order) → SubscriptionOptions.priority
    - SimpleEventBus keeps per-type subscriptions sorted by (priority asc, registrationSeq asc)
    - Publish path remains lock-free; stable tie-break by registration order
- Async semantics
    - Offload only when @DomainEventListener(async = true)
    - Executor selection: use defaults.executor if provided; else shared virtual-thread executor
    - Manual subscriptions: non-null executor forces async regardless of annotation
- API cleanup
    - Remove DomainEventListener.concurrency and DomainEventListener.filter
    - Remove SubscriptionOptions.concurrency
    - Simplify PublishOptions (remove async/priority; empty builder remains)
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.
 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
Chainsync pipelining fixes + EventListener and Plugin framework
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
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

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.

2 participants