Skip to content
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

Clean the pruning log and add config for parallel and parents count #4372

Open
wants to merge 22 commits into
base: dag-master
Choose a base branch
from

Conversation

jackzhhuang
Copy link
Collaborator

@jackzhhuang jackzhhuang commented Jan 16, 2025

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

Summary by CodeRabbit

Release Notes

  • Configuration Enhancements

    • Added configurable maximum parents count for miners.
    • Introduced lightweight sync configuration with max gap setting.
  • Synchronization Improvements

    • Enhanced block synchronization logic with more flexible gap checking.
    • Improved block connection and verification processes.
  • Performance Optimizations

    • Updated block DAG management to handle pruning points more efficiently.
    • Modified storage write operations for potential performance gains.
  • New Features

    • Added ability to configure maximum number of parent blocks.
    • Implemented more granular block synchronization controls.
    • Introduced a method for accessing the k value in the GhostdagManager.
    • Added a method to check historical blocks in the BlockDAG.
    • Enhanced ghost data verification by incorporating the latest pruning point.
    • Improved pruning logic with early exit conditions based on pruning points.
    • Updated logic in the BlockConnectorService for configurable gap checks.

Copy link

coderabbitai bot commented Jan 16, 2025

Walkthrough

This pull request introduces several configuration and functionality enhancements across the Starcoin blockchain's core components. The primary changes focus on improving block production, synchronization, and pruning processes. Key modifications include adding a new G_MAX_PARENTS_COUNT constant, updating configuration options for miners and synchronization, and refining block verification and ghostdata management logic. The changes aim to provide more flexibility in handling block relationships, parent count, and synchronization strategies.

Changes

File Change Summary
chain/mock/src/mock_chain.rs Added import for G_MAX_PARENTS_COUNT
chain/src/chain.rs Updated verify_and_ghostdata method to include latest pruning point
config/src/lib.rs Made miner_config module public
config/src/miner_config.rs Added G_MAX_PARENTS_COUNT constant and maximum_parents_count configuration
config/src/sync_config.rs Added lightweight_sync_max_gap configuration option
flexidag/src/blockdag.rs Enhanced block verification, ghostdata, and tip calculation logic
flexidag/src/consensusdb/db.rs Changed write batch method from synchronous to potentially asynchronous
flexidag/src/ghostdag/protocol.rs Added public k() method to GhostdagManager
flexidag/tests/tests.rs Added import for G_MAX_PARENTS_COUNT in tests
sync/src/block_connector/block_connector_service.rs Updated is_near_block method with configurable gap logic
flexidag/src/prune/pruning_point_manager.rs Added early exit condition in prune method for zero pruning point

Possibly related PRs

  • Pruning logic #4194: The changes in this PR involve enhancements to pruning logic, which is directly related to the main PR's introduction of G_MAX_PARENTS_COUNT for managing parent blocks during pruning operations.
  • Reset dag chain #4227: This PR focuses on resetting the DAG chain, which may involve similar pruning logic as seen in the main PR, particularly in how blocks are managed and produced for pruning.
  • Enhance parallel #4369: The modifications in this PR enhance parallel processing, which could relate to the overall efficiency of block production and pruning, aligning with the main PR's focus on managing parent blocks.

Suggested reviewers

  • jolestar
  • nkysg
  • sanlee42
  • yourmoonlight
  • simonjiao

Poem

🐰 Blocks dance in the DAG's embrace,
Parents counted with newfound grace.
Configuration's gentle art,
Sync and prune, a rabbit's smart start!
Blockchain evolves, one hop at a time. 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e8ef5f and f2e126b.

📒 Files selected for processing (1)
  • flexidag/src/blockdag.rs (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • flexidag/src/blockdag.rs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build and test

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jackzhhuang jackzhhuang marked this pull request as draft January 16, 2025 02:08
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (7)
flexidag/src/blockdag.rs (3)

106-111: Consider refactoring duplicated error handling code

The error handling logic in lines 106-111 is similar to the code in lines 121-126. To improve maintainability and reduce code duplication, consider refactoring this logic into a helper function.


121-126: Consider refactoring duplicated error handling code

Similar to lines 106-111, the error handling in lines 121-126 can be refactored into a helper function to enhance code readability and reduce duplication.


719-721: Format multi-line expression as a single line

The pipeline warning indicates that the multi-line expression in lines 719-721 should be formatted as a single line to adhere to code style guidelines.

Consider reformatting the code as:

let next_pruning_point = self.pruning_point_manager().next_pruning_point(previous_pruning_point, previous_ghostdata, &next_ghostdata, pruning_depth, pruning_finality)?;
🧰 Tools
🪛 GitHub Actions: Build and Test

[warning] 719-721: Code formatting issue: Multi-line expression should be formatted as a single line

config/src/miner_config.rs (2)

10-10: Document the rationale for G_MAX_PARENTS_COUNT value.

Please add a doc comment explaining why 16 was chosen as the default maximum parents count. This helps future maintainers understand the reasoning behind this constant.

+/// Default maximum number of parent blocks allowed.
+/// Set to 16 because... <add rationale here>
 pub static G_MAX_PARENTS_COUNT: u64 = 16;

70-72: Add documentation for the maximum_parents_count method.

The method lacks documentation explaining its purpose and behavior.

+    /// Returns the configured maximum number of parent blocks allowed.
+    /// If not configured, returns the default value from G_MAX_PARENTS_COUNT.
     pub fn maximum_parents_count(&self) -> u64 {
         self.maximum_parents_count.unwrap_or(G_MAX_PARENTS_COUNT)
     }
flexidag/src/ghostdag/protocol.rs (1)

489-491: Add documentation for the k method.

Please add documentation explaining the purpose of this method and what the k value represents in the GHOSTDAG protocol.

+    /// Returns the k parameter of the GHOSTDAG protocol.
+    /// This parameter limits the size of the anticone that can be blue.
+    /// For more details, see: https://eprint.iacr.org/2018/104.pdf
     pub fn k(&self) -> KType {
         self.k
     }
chain/src/chain.rs (1)

1384-1397: LGTM! Good addition of latest pruning point to ghostdata verification.

The changes properly handle the pruning point retrieval with appropriate error handling. Consider extracting the pruning point retrieval logic into a separate method for better readability.

 impl ChainReader for BlockChain {
+    fn get_latest_pruning_point(&self) -> Result<Option<HashValue>> {
+        Ok(match self.storage.get_startup_info()? {
+            Some(startup_info) => self
+                .storage
+                .get_block_header_by_hash(startup_info.main)?
+                .map(|head_block| head_block.pruning_point()),
+            None => None,
+        })
+    }
+
     fn verify_and_ghostdata(
         &self,
         uncles: &[BlockHeader],
         header: &BlockHeader,
     ) -> Result<starcoin_dag::types::ghostdata::GhostdagData> {
-        let latest_pruning_point = {
-            match self.storage.get_startup_info().unwrap_or(None) {
-                Some(startup_info) => self
-                    .storage
-                    .get_block_header_by_hash(startup_info.main)
-                    .unwrap_or(None)
-                    .map(|head_block| head_block.pruning_point()),
-                None => None,
-            }
-        };
-
+        let latest_pruning_point = self.get_latest_pruning_point()?;
         Ok(self
             .dag()
             .verify_and_ghostdata(uncles, header, latest_pruning_point)?)
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d448e3 and f2e442e.

📒 Files selected for processing (10)
  • chain/mock/src/mock_chain.rs (2 hunks)
  • chain/src/chain.rs (1 hunks)
  • config/src/lib.rs (1 hunks)
  • config/src/miner_config.rs (4 hunks)
  • config/src/sync_config.rs (3 hunks)
  • flexidag/src/blockdag.rs (9 hunks)
  • flexidag/src/consensusdb/db.rs (1 hunks)
  • flexidag/src/ghostdag/protocol.rs (1 hunks)
  • flexidag/tests/tests.rs (3 hunks)
  • sync/src/block_connector/block_connector_service.rs (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • flexidag/tests/tests.rs
🧰 Additional context used
🪛 GitHub Actions: Build and Test
flexidag/src/blockdag.rs

[error] 709-709: Left behind trailing whitespace at the end of line


[error] 726-726: Left behind trailing whitespace at the end of line


[warning] 719-721: Code formatting issue: Multi-line expression should be formatted as a single line

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: run benchmark
🔇 Additional comments (9)
config/src/sync_config.rs (3)

32-42: Well-defined addition of 'lightweight_sync_max_gap' field

The addition of the lightweight_sync_max_gap field enhances synchronization configuration flexibility. The field is properly annotated with serialization attributes and command-line argument definitions.


54-56: Accessor method for 'lightweight_sync_max_gap' is correctly implemented

The lightweight_sync_max_gap method provides convenient access to the new configuration field.


69-71: Correct merging logic for 'lightweight_sync_max_gap'

The merge_with_opt method appropriately updates lightweight_sync_max_gap from command-line options if provided.

flexidag/src/consensusdb/db.rs (1)

107-107: Verify impact of changing from synchronous to asynchronous batch write

Switching from raw_write_batch_sync to raw_write_batch may affect data durability guarantees. Ensure that this change does not introduce data consistency issues, especially in scenarios involving system crashes or power failures.

To confirm whether data durability is maintained, please review the write options and ensure that write-ahead logging or synchronous writes are appropriately configured if required.

config/src/miner_config.rs (1)

116-119: LGTM!

The implementation of merging the maximum_parents_count configuration is correct.

chain/mock/src/mock_chain.rs (1)

7-7: LGTM!

The import and usage of G_MAX_PARENTS_COUNT is appropriate for the pruning functionality.

Also applies to: 270-270

config/src/lib.rs (1)

36-36: LGTM!

Making the miner_config module public is appropriate as it contains the new G_MAX_PARENTS_COUNT constant that needs to be accessible from other crates.

sync/src/block_connector/block_connector_service.rs (2)

139-152: LGTM! Good improvements to the gap calculation logic.

The changes make the gap configurable while maintaining safe arithmetic operations. The added debug logging will help with troubleshooting synchronization issues.


456-456: LGTM! Good addition of configurable maximum parents count.

The change allows flexible configuration of the maximum number of parent blocks during mining.

flexidag/src/blockdag.rs Show resolved Hide resolved
flexidag/src/blockdag.rs Outdated Show resolved Hide resolved
flexidag/src/blockdag.rs Outdated Show resolved Hide resolved
config/src/miner_config.rs Outdated Show resolved Hide resolved
…ain net

2, add checking for the first pruning point
@jackzhhuang jackzhhuang marked this pull request as ready for review January 16, 2025 06:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
flexidag/src/blockdag.rs (1)

777-796: Adjust logging levels for detailed messages

Multiple info! log statements are used within check_historical_block for detailed conditional messages. Consider using debug! or trace! levels for these logs to prevent cluttering the info logs and to better categorize log severity.

chain/src/chain.rs (1)

1385-1394: Simplify nested unwrap_or calls for better readability.

The nested unwrap_or calls make the code harder to follow. Consider refactoring for better readability and error handling.

-        let latest_pruning_point = {
-            match self.storage.get_startup_info().unwrap_or(None) {
-                Some(startup_info) => self
-                    .storage
-                    .get_block_header_by_hash(startup_info.main)
-                    .unwrap_or(None)
-                    .map(|head_block| head_block.pruning_point()),
-                None => None,
-            }
-        };
+        let latest_pruning_point = self
+            .storage
+            .get_startup_info()
+            .ok()
+            .flatten()
+            .and_then(|startup_info| {
+                self.storage
+                    .get_block_header_by_hash(startup_info.main)
+                    .ok()
+                    .flatten()
+                    .map(|head_block| head_block.pruning_point())
+            });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2e442e and d2eaca8.

📒 Files selected for processing (10)
  • chain/mock/src/mock_chain.rs (2 hunks)
  • chain/src/chain.rs (2 hunks)
  • config/src/lib.rs (1 hunks)
  • config/src/miner_config.rs (4 hunks)
  • config/src/sync_config.rs (3 hunks)
  • flexidag/src/blockdag.rs (9 hunks)
  • flexidag/src/consensusdb/db.rs (1 hunks)
  • flexidag/src/ghostdag/protocol.rs (1 hunks)
  • flexidag/tests/tests.rs (3 hunks)
  • sync/src/block_connector/block_connector_service.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • config/src/lib.rs
  • flexidag/tests/tests.rs
  • flexidag/src/ghostdag/protocol.rs
  • chain/mock/src/mock_chain.rs
  • flexidag/src/consensusdb/db.rs
  • config/src/miner_config.rs
🔇 Additional comments (5)
config/src/sync_config.rs (3)

31-42: LGTM

The addition of lightweight_sync_max_gap to SyncConfig is implemented correctly, enhancing synchronization flexibility.


54-56: LGTM

The new method lightweight_sync_max_gap correctly returns the configuration value.


69-71: LGTM

The merge_with_opt method properly merges the lightweight_sync_max_gap option from command-line arguments.

sync/src/block_connector/block_connector_service.rs (1)

139-152: LGTM

The updated logic in is_near_block correctly utilizes the new lightweight_sync_max_gap configuration parameter, improving synchronization behavior.

chain/src/chain.rs (1)

1396-1398: LGTM! The DAG verification call is properly updated.

The changes correctly pass the latest pruning point to the DAG's verify_and_ghostdata method while maintaining proper error handling.

flexidag/src/blockdag.rs Show resolved Hide resolved
@jackzhhuang jackzhhuang marked this pull request as draft January 16, 2025 06:27
Copy link

Benchmark for 94baa71

Click to view benchmark
Test Base PR %
accumulator_append 816.4±215.63µs 836.5±105.71µs +2.46%
block_apply/block_apply_10 533.6±54.93ms 367.0±10.12ms -31.22%
block_apply/block_apply_1000 42.6±1.53s 40.8±0.73s -4.23%
get_with_proof/db_store 44.0±2.12µs 45.3±2.90µs +2.95%
get_with_proof/mem_store 35.8±1.29µs 37.0±2.01µs +3.35%
put_and_commit/db_store/1 116.4±5.19µs 129.1±18.61µs +10.91%
put_and_commit/db_store/10 1081.3±66.53µs 1076.9±154.05µs -0.41%
put_and_commit/db_store/100 9.7±0.71ms 9.9±0.75ms +2.06%
put_and_commit/db_store/5 537.8±23.89µs 589.0±65.08µs +9.52%
put_and_commit/db_store/50 4.9±0.23ms 4.9±0.39ms 0.00%
put_and_commit/mem_store/1 73.2±9.36µs 85.4±21.25µs +16.67%
put_and_commit/mem_store/10 660.8±54.40µs 681.6±80.44µs +3.15%
put_and_commit/mem_store/100 6.6±0.52ms 6.3±0.27ms -4.55%
put_and_commit/mem_store/5 343.6±35.47µs 334.7±43.22µs -2.59%
put_and_commit/mem_store/50 3.2±0.13ms 3.3±0.30ms +3.13%
query_block/query_block_in(10)_times(100) 8.3±0.22ms 8.5±0.51ms +2.41%
query_block/query_block_in(10)_times(1000) 83.9±2.40ms 85.3±5.97ms +1.67%
query_block/query_block_in(10)_times(10000) 1009.4±267.30ms 862.3±53.00ms -14.57%
query_block/query_block_in(1000)_times(100) 1232.1±43.24µs 1265.7±76.72µs +2.73%
query_block/query_block_in(1000)_times(1000) 12.2±0.43ms 15.7±5.71ms +28.69%
query_block/query_block_in(1000)_times(10000) 121.0±4.54ms 142.4±13.91ms +17.69%
storage_transaction 1072.6±418.12µs 1174.5±524.08µs +9.50%
vm/transaction_execution/1 415.8±15.51ms 424.4±17.90ms +2.07%
vm/transaction_execution/10 127.8±3.26ms 134.4±5.32ms +5.16%
vm/transaction_execution/20 117.7±4.36ms 131.9±33.87ms +12.06%
vm/transaction_execution/5 155.7±5.46ms 163.8±11.05ms +5.20%
vm/transaction_execution/50 140.8±13.55ms 146.2±9.13ms +3.84%

@jackzhhuang jackzhhuang marked this pull request as ready for review January 16, 2025 13:47
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
flexidag/src/blockdag.rs (1)

654-692: ⚠️ Potential issue

Replace panic with safe error handling in the sorting comparator.

Using panic! inside a sorting comparator is dangerous as it can crash the application. Consider using unwrap_or_default() or a default comparison when get_blue_work fails.

This is a duplicate of a previous review comment. The suggested fix remains the same:

  • Replace panic with safe error handling
  • Use default values when ghost data retrieval fails
🧹 Nitpick comments (2)
flexidag/src/prune/pruning_point_manager.rs (2)

45-47: Document the zero hash case handling.

The special handling of HashValue::zero() should be documented to explain why this case warrants immediate return of current tips. This helps maintainers understand the relationship between zero hash and pruning point equality.

Add a comment explaining the zero hash case:

+    // HashValue::zero() indicates [explain special case], which should be treated
+    // the same as when current and next pruning points match
     if next_pruning_point == HashValue::zero() {
         return Ok(dag_state.tips.clone());
     }

45-50: Consider refactoring duplicate return logic.

Both conditions (HashValue::zero() and equality check) return the same result. Consider combining them to improve maintainability.

-    if next_pruning_point == HashValue::zero() {
-        return Ok(dag_state.tips.clone());
-    }
-    if current_pruning_point == next_pruning_point {
+    if next_pruning_point == HashValue::zero() || current_pruning_point == next_pruning_point {
         return Ok(dag_state.tips.clone());
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2eaca8 and adf48be.

📒 Files selected for processing (2)
  • flexidag/src/blockdag.rs (10 hunks)
  • flexidag/src/prune/pruning_point_manager.rs (1 hunks)
🔇 Additional comments (4)
flexidag/src/blockdag.rs (4)

Line range hint 106-126: LGTM! Improved error handling implementation.

The refactored error handling is more efficient and provides better error messages. Using has() checks instead of direct retrieval is a good optimization.


767-803: LGTM! Well-documented historical block check implementation.

The function is well-structured with:

  • Clear documentation explaining the purpose and special cases
  • Comprehensive logging for each decision path
  • Proper handling of edge cases, especially for the Vega chain

806-817: LGTM! Clean implementation of verification logic.

The function effectively:

  • Uses the new historical block check to determine processing path
  • Properly delegates to appropriate processing methods
  • Maintains clean error handling

Line range hint 323-355: Fix inconsistent parent hash usage in virtual selected parent hints.

There's an inconsistency in the parent hash used for hinting virtual selected parent:

  • In the first implementation (lines 330), it uses header.parent_hash()
  • In the second implementation (line 485), it also uses header.parent_hash()
  • However, in the first case, this is used when header.pruning_point() is zero, while in the second case, it's used when the pruning point differs from the reindex root.

This inconsistency could lead to different behavior in these two scenarios.

Let's verify the impact:

Also applies to: 483-490

Copy link

Benchmark for 646872f

Click to view benchmark
Test Base PR %
accumulator_append 828.7±132.03µs 790.9±83.23µs -4.56%
block_apply/block_apply_10 405.6±13.57ms 376.9±23.76ms -7.08%
block_apply/block_apply_1000 44.4±1.49s 40.7±1.13s -8.33%
get_with_proof/db_store 42.9±0.79µs 43.7±1.64µs +1.86%
get_with_proof/mem_store 39.1±6.20µs 37.0±2.33µs -5.37%
put_and_commit/db_store/1 119.6±7.55µs 121.9±9.98µs +1.92%
put_and_commit/db_store/10 1094.5±65.20µs 1075.1±73.09µs -1.77%
put_and_commit/db_store/100 9.6±0.47ms 10.3±0.60ms +7.29%
put_and_commit/db_store/5 574.0±38.40µs 588.9±89.39µs +2.60%
put_and_commit/db_store/50 5.2±0.58ms 4.9±0.23ms -5.77%
put_and_commit/mem_store/1 69.7±7.20µs 69.8±7.55µs +0.14%
put_and_commit/mem_store/10 674.0±67.81µs 650.4±57.51µs -3.50%
put_and_commit/mem_store/100 6.8±0.56ms 6.7±0.73ms -1.47%
put_and_commit/mem_store/5 335.0±41.59µs 335.5±43.38µs +0.15%
put_and_commit/mem_store/50 3.5±0.46ms 3.3±0.37ms -5.71%
query_block/query_block_in(10)_times(100) 13.8±2.46ms 8.4±0.39ms -39.13%
query_block/query_block_in(10)_times(1000) 94.1±17.52ms 89.2±10.26ms -5.21%
query_block/query_block_in(10)_times(10000) 871.6±45.21ms 842.9±23.64ms -3.29%
query_block/query_block_in(1000)_times(100) 1276.4±129.50µs 1258.0±112.22µs -1.44%
query_block/query_block_in(1000)_times(1000) 12.2±0.34ms 12.2±0.38ms 0.00%
query_block/query_block_in(1000)_times(10000) 125.3±9.28ms 121.7±3.91ms -2.87%
storage_transaction 1125.5±438.05µs 1246.7±557.75µs +10.77%
vm/transaction_execution/1 456.1±39.99ms 418.7±20.94ms -8.20%
vm/transaction_execution/10 161.6±19.74ms 151.1±30.86ms -6.50%
vm/transaction_execution/20 174.7±9.44ms 119.9±4.16ms -31.37%
vm/transaction_execution/5 175.6±8.71ms 158.8±13.70ms -9.57%
vm/transaction_execution/50 147.4±8.30ms 143.2±10.72ms -2.85%

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 27.21519% with 115 lines in your changes missing coverage. Please review.

Please upload report for BASE (dag-master@8d448e3). Learn more about missing BASE report.

Files with missing lines Patch % Lines
flexidag/src/blockdag.rs 26.17% 79 Missing ⚠️
...ync/src/block_connector/block_connector_service.rs 0.00% 12 Missing ⚠️
flexidag/src/prune/pruning_point_manager.rs 0.00% 9 Missing ⚠️
config/src/miner_config.rs 28.58% 5 Missing ⚠️
config/src/sync_config.rs 28.58% 5 Missing ⚠️
flexidag/src/ghostdag/protocol.rs 0.00% 3 Missing ⚠️
chain/mock/src/mock_chain.rs 0.00% 1 Missing ⚠️
chain/src/chain.rs 90.91% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             dag-master    #4372   +/-   ##
=============================================
  Coverage              ?   54.06%           
=============================================
  Files                 ?      648           
  Lines                 ?    79547           
  Branches              ?        0           
=============================================
  Hits                  ?    42997           
  Misses                ?    36550           
  Partials              ?        0           
Flag Coverage Δ
unittests 54.06% <27.22%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
config/src/lib.rs 57.29% <ø> (ø)
flexidag/src/consensusdb/db.rs 94.21% <100.00%> (ø)
chain/mock/src/mock_chain.rs 50.98% <0.00%> (ø)
chain/src/chain.rs 59.96% <90.91%> (ø)
flexidag/src/ghostdag/protocol.rs 53.85% <0.00%> (ø)
config/src/miner_config.rs 68.26% <28.58%> (ø)
config/src/sync_config.rs 64.00% <28.58%> (ø)
flexidag/src/prune/pruning_point_manager.rs 10.72% <0.00%> (ø)
...ync/src/block_connector/block_connector_service.rs 50.77% <0.00%> (ø)
flexidag/src/blockdag.rs 53.18% <26.17%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d448e3...7e8ef5f. Read the comment docs.

Copy link

Benchmark for 573e35e

Click to view benchmark
Test Base PR %
accumulator_append 809.1±97.35µs 1025.4±281.71µs +26.73%
block_apply/block_apply_10 455.7±46.05ms 372.1±9.99ms -18.35%
block_apply/block_apply_1000 48.6±3.56s 42.0±0.73s -13.58%
get_with_proof/db_store 63.3±10.65µs 45.8±3.56µs -27.65%
get_with_proof/mem_store 40.4±8.88µs 38.5±2.25µs -4.70%
put_and_commit/db_store/1 120.2±11.27µs 126.6±18.33µs +5.32%
put_and_commit/db_store/10 1436.9±264.65µs 1136.8±91.78µs -20.89%
put_and_commit/db_store/100 10.0±0.57ms 9.9±0.63ms -1.00%
put_and_commit/db_store/5 586.9±62.43µs 606.1±96.35µs +3.27%
put_and_commit/db_store/50 5.4±0.44ms 6.2±1.84ms +14.81%
put_and_commit/mem_store/1 70.5±9.50µs 75.1±15.33µs +6.52%
put_and_commit/mem_store/10 930.5±158.02µs 679.4±80.25µs -26.99%
put_and_commit/mem_store/100 6.5±0.50ms 7.1±1.24ms +9.23%
put_and_commit/mem_store/5 343.6±49.89µs 341.9±37.88µs -0.49%
put_and_commit/mem_store/50 3.3±0.42ms 3.4±0.63ms +3.03%
query_block/query_block_in(10)_times(100) 8.6±1.03ms 8.3±0.62ms -3.49%
query_block/query_block_in(10)_times(1000) 85.6±3.09ms 84.8±4.26ms -0.93%
query_block/query_block_in(10)_times(10000) 871.3±55.13ms 906.1±63.83ms +3.99%
query_block/query_block_in(1000)_times(100) 1388.2±167.21µs 1244.9±47.78µs -10.32%
query_block/query_block_in(1000)_times(1000) 13.7±1.54ms 12.8±0.72ms -6.57%
query_block/query_block_in(1000)_times(10000) 136.9±7.95ms 123.0±2.76ms -10.15%
storage_transaction 1093.3±422.42µs 995.9±359.51µs -8.91%
vm/transaction_execution/1 453.0±54.84ms 436.3±25.83ms -3.69%
vm/transaction_execution/10 154.7±26.01ms 141.0±7.14ms -8.86%
vm/transaction_execution/20 132.4±10.61ms 140.3±17.99ms +5.97%
vm/transaction_execution/5 169.8±7.93ms 176.8±24.35ms +4.12%
vm/transaction_execution/50 149.6±7.74ms 150.3±9.63ms +0.47%

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