-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync state subscription #244
base: master
Are you sure you want to change the base?
Sync state subscription #244
Commits on Oct 13, 2023
-
Add sync state change notifications in consensus process
This update adds notifications for sync state changes in the consensus process. These changes were necessary to keep track of the block syncing progress. `ConsensusServices` was modified to include the notification root, and the `syncStateChangedRequest` and `syncStateChangedNotification` RPC calls were added to allow remote retrieval of sync state. Minor syntactical improvements were also made to adhere to best coding practices.
Configuration menu - View commit details
-
Copy full SHA for cabbf26 - Browse repository at this point
Copy the full SHA cabbf26View commit details -
"Add IBD progress reporting to notification system"
This commit introduces the ability to report the progress of Initial Block Download (IBD) to the notification system. This feature was added to the `ProgressReporter` struct in the `progress.rs` file, where a callback function was incorporated to handle the reporting. The callback function is invoked during batch processing and completion reporting in the IBD. Furthermore, new changes were made for the `SyncStateChangedNotification`, adding a variant for header progress reporting. Consequently, this needed adjustment also in proto files for proper message handling. This improves the communication and interaction with the wallet; hence enhancing user experience by keeping them updated on the IBD progress.
Configuration menu - View commit details
-
Copy full SHA for 76910de - Browse repository at this point
Copy the full SHA 76910deView commit details -
Add sync state
Blocks
for block synchronizationThe extra sync state, "Blocks", has been added for the purpose of block synchronization. The changes include adding the fields `blocks` and `progress` to the `BlocksState` message in the `rpc.proto` file, as well as corresponding implementations across the codebase. This allows the synchronization state to be accurately monitored and predicted, which can help improve the performance and stability of the system. These changes are expected to improve the system's understanding of state changes during block synchronization and alter respective notifications.
Configuration menu - View commit details
-
Copy full SHA for 717ad0f - Browse repository at this point
Copy the full SHA 717ad0fView commit details -
Add UTXO resync notification feature
Implemented the UTXO resync notification feature in the UTXO Index, notifying the user when the UTXO index starts resyncing. This is done by adding a new UtxoResyncState in the SyncStateChangedNotification enum and notifying the user when the resync event occurs. Dependencies were updated in Cargo.toml and the notification was integrated into the GRPC layer.
Configuration menu - View commit details
-
Copy full SHA for 869f2ec - Browse repository at this point
Copy the full SHA 869f2ecView commit details -
Add UtxoSync to SyncStateChangedNotification
Implemented UtxoSync mechanism in the SyncStateChangedNotification. It is designed to provide more detailed information about sync state by additionally conveying the number of chunks and total progress in its structure. This enhances the UTXO synchronization process by allowing users to track the status of synced chunks, significantly improving process visibility and debuggability.
Configuration menu - View commit details
-
Copy full SHA for 5cf40d6 - Browse repository at this point
Copy the full SHA 5cf40d6View commit details -
Add TrustSync state to SyncStateChangedNotification
Added a new state called TrustSync to the SyncStateChangedNotification enum to share information about the processing of trusted blocks. The addition of TrustSync allows the program to notify about the number of trusted blocks processed in the last one second and the total number of such blocks processed till now. This is essential for improving the supervision of the synchronization process.
Configuration menu - View commit details
-
Copy full SHA for 5663b00 - Browse repository at this point
Copy the full SHA 5663b00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01019f0 - Browse repository at this point
Copy the full SHA 01019f0View commit details -
Refactor notification_root usage in ibd/flow.rs
This commit removes a redundant `take().unwrap()` of the `notification_root` field and the subsequent reassignment of it. Now the field is directly accessed via `as_ref().unwrap()`. This change removes unnecessary operations, and might slightly improve performance.
Configuration menu - View commit details
-
Copy full SHA for 4bd6210 - Browse repository at this point
Copy the full SHA 4bd6210View commit details -
"Add Synced state to SyncStateChangedNotification"
Added a new "Synced" state to the `SyncStateChangedNotification` enum, which gives more precise control over sync state notifications. This was reflected across RPC and consensus notify modules, including additions to GRPC proto definitions and corresponding conversion functions. This change enables better tracking and handling of the sync completed state.
Configuration menu - View commit details
-
Copy full SHA for 8f5523d - Browse repository at this point
Copy the full SHA 8f5523dView commit details -
Refactor DAA parameters into dedicated struct
Modified the consensus parameters to group Difficulty Adjustment Algorithm (DAA) parameters into their dedicated struct. The changes affect how these parameters are retrieved and set across the mining, testing and consensus codebase. Structured DAA parameters within their own entity enhances code readability and manageability.
Configuration menu - View commit details
-
Copy full SHA for 6779125 - Browse repository at this point
Copy the full SHA 6779125View commit details -
Refactor sync state initialisation and value capture
remove the use of set method to assign consensus_manager in integration_tests.rs
Configuration menu - View commit details
-
Copy full SHA for 7eb1abf - Browse repository at this point
Copy the full SHA 7eb1abfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0431b0e - Browse repository at this point
Copy the full SHA 0431b0eView commit details -
Remove unused SYNC_STATE import from integration tests
The SYNC_STATE import was removed from the integration_tests.rs file because it was unused. This was probably a leftover from some previously refactored code, and its presence might have led to confusion, hence it has been removed.
Configuration menu - View commit details
-
Copy full SHA for f01fc2b - Browse repository at this point
Copy the full SHA f01fc2bView commit details -
Add SyncStateChanged to GRPC core
Added SyncStateChanged handling in various files including kaspad.rs, message.rs and notification.rs in the GRPC core, which allows the system to notify and handle changes in the sync state.
Configuration menu - View commit details
-
Copy full SHA for 82bce93 - Browse repository at this point
Copy the full SHA 82bce93View commit details -
Add SyncStateChangedNotification to RpcApiOps
The commit includes `SyncStateChangedNotification` into `RpcApiOps` array in the `client.rs` file. This will allow further operations to incorporate the latest sync state changes effectively.
Configuration menu - View commit details
-
Copy full SHA for 1fe5bd8 - Browse repository at this point
Copy the full SHA 1fe5bd8View commit details -
Fix incorrect function call for SerdeJson encoding
This change corrects the function call made for the SerdeJson encoding in the connection.rs file. Previously, it was mistakenly referencing the Borsh encoding function instead of the appropriate SerdeJson one.
Configuration menu - View commit details
-
Copy full SHA for 05adc29 - Browse repository at this point
Copy the full SHA 05adc29View commit details -
Fix regex pattern for block headers in IBD
A typo in the regex pattern for processing block headers during Initial Block Download(IBD) resulted in incorrect matches. This commit fixes the regex by removing the extra square brackets.
Configuration menu - View commit details
-
Copy full SHA for 420a046 - Browse repository at this point
Copy the full SHA 420a046View commit details -
"Remove unused sync_state.rs file and refactor consensus"
The sync_state.rs file in the consensus/src directory has been removed as it is no longer needed. All references to SYNC_STATE which was previously declared in this file have been replaced with suitable alternatives. This was done to streamline the consensus and avoid unnecessary complexities.
Configuration menu - View commit details
-
Copy full SHA for 0af3950 - Browse repository at this point
Copy the full SHA 0af3950View commit details -
"Refactor DAA sync condition for readability"
Refactored the sync condition calculation in both pruning_proof/mod.rs and virtual_processor/processor.rs by moving the logic to the daa_window_params.is_nearly_synced method. This eliminates redundant code and enhances readability
Configuration menu - View commit details
-
Copy full SHA for 9d7d602 - Browse repository at this point
Copy the full SHA 9d7d602View commit details -
Refactor sink handling in processor.rs
The sink processing was streamlined to eliminate an unnecessary step. The compact header data is now directly retrieved from the headers_store using a new_sink variable. This change simplifies the codebase and may potentially enhance the performance of headers_store data retrieval.
Configuration menu - View commit details
-
Copy full SHA for 8787288 - Browse repository at this point
Copy the full SHA 8787288View commit details -
Refactor checking state sync in pruning_proof
Improve handling of 'is_nearly_synced' state in processor.rs, adding a guard not to send 'SyncStateChangedNotification' continuously. Now 'SyncStateChangedNotification' is sent only when the state changes. The state 'is_nearly_synced' is now calculated outside of the if block to handle cases when getting 'ghostdag_data.selected_parent' might fail. 'previous_synced' flag was added to 'VirtualStateProcessor' structure to store previous state and send notification only when the state changes. This reduces redundant notifications, improving the performance. In 'pruning_proof', we now use a safe get by 'is_ok_and' method and inside use a lambda to calculate 'is_synced'. This change makes it easier to understand the code and handle the state correctly.
Configuration menu - View commit details
-
Copy full SHA for 4053ddd - Browse repository at this point
Copy the full SHA 4053dddView commit details -
Configuration menu - View commit details
-
Copy full SHA for c8a045e - Browse repository at this point
Copy the full SHA c8a045eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80eb07e - Browse repository at this point
Copy the full SHA 80eb07eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1961717 - Browse repository at this point
Copy the full SHA 1961717View commit details