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

Add db set store #4154

Closed
wants to merge 21 commits into from
Closed

Add db set store #4154

wants to merge 21 commits into from

Conversation

simonjiao
Copy link
Collaborator

@simonjiao simonjiao commented Jul 9, 2024

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

  • Enhancements

    • Improved database handling and caching for better performance and reliability.
    • Expanded trait implementations for Interval struct to support more operations.
  • Removed

    • Deprecated fields from ReachabilityData struct, simplifying data structures.
  • New Features

    • Added new schema definitions and methods for enhanced database interactions.
  • Bug Fixes

    • Updated initialization and data insertion methods to align with new schema changes.

Copy link

coderabbitai bot commented Jul 9, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent changes to the FlexiDag project involve significant updates to the consensus database and type structures. These include new schema definitions, caching mechanisms, and database operations, along with modifications to handle these new features. The updates improve the functionality for reachability data, batch writing, and data caching.

Changes

Files/Modules Summary of Changes
flexidag/src/consensusdb/consensus_reachability.rs Added new schema definitions, caching mechanisms, and updated methods for handling reachability data.
flexidag/src/consensusdb/set_access.rs Introduced DbSetAccess and CachedDbSetAccess for database operations and caching.
flexidag/src/types/reachability.rs Removed children and future_covering_set fields from ReachabilityData.
flexidag/src/consensusdb/db.rs Added new methods for batch writing and flushing operations in FlexiDagStorage, utilizing rocksdb.
flexidag/src/types/interval.rs Added PartialOrd and Ord traits to the Interval struct.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConsensusDb
    participant Cache
    participant FlexiDagStorage
    User->>ConsensusDb: initialize()
    ConsensusDb->>Cache: Create CachedDbSetAccess
    User->>ConsensusDb: append_child()
    ConsensusDb->>Cache: Update children_access
    User->>ConsensusDb: insert_future_covering_item()
    ConsensusDb->>Cache: Update fcs_access
    User->>FlexiDagStorage: write_batch()
    FlexiDagStorage->>RocksDB: Write data with batch
    User->>FlexiDagStorage: flush_opt(wait)
    FlexiDagStorage->>RocksDB: Flush data with options
Loading

Poem

In fields of data, changes bloom bright,
Reachability's path now shines in light.
With keys and caches, swift access found,
FlexiDag's storage stands profound.
Like intervals in time, traits align,
A future in code, redefined.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@simonjiao simonjiao force-pushed the add-db-set-store branch 2 times, most recently from eeb2672 to b6c8dbc Compare July 11, 2024 09:30
Copy link

Benchmark for bdb9978

Click to view benchmark
Test Base PR %
accumulator_append 865.8±174.60µs 786.4±123.76µs -9.17%
block_apply/block_apply_10 373.1±12.86ms 404.3±36.63ms +8.36%
block_apply/block_apply_1000 43.6±2.00s 43.7±2.65s +0.23%
get_with_proof/db_store 46.6±1.47µs 46.8±2.57µs +0.43%
get_with_proof/mem_store 37.0±1.18µs 37.2±1.16µs +0.54%
put_and_commit/db_store/1 127.1±18.15µs 123.8±15.25µs -2.60%
put_and_commit/db_store/10 1062.3±79.28µs 1104.8±159.69µs +4.00%
put_and_commit/db_store/100 12.1±2.77ms 14.2±3.51ms +17.36%
put_and_commit/db_store/5 559.9±72.62µs 566.4±65.67µs +1.16%
put_and_commit/db_store/50 5.0±0.29ms 5.3±0.72ms +6.00%
put_and_commit/mem_store/1 72.8±7.57µs 75.9±14.07µs +4.26%
put_and_commit/mem_store/10 810.8±210.31µs 716.0±151.79µs -11.69%
put_and_commit/mem_store/100 6.6±0.30ms 6.6±0.40ms 0.00%
put_and_commit/mem_store/5 376.2±82.48µs 351.0±39.64µs -6.70%
put_and_commit/mem_store/50 3.5±0.31ms 4.1±1.24ms +17.14%
query_block/query_block_in(10)_times(100) 4.8±0.30ms 5.0±0.36ms +4.17%
query_block/query_block_in(10)_times(1000) 50.5±4.43ms 55.3±11.02ms +9.50%
query_block/query_block_in(10)_times(10000) 466.6±15.89ms 700.4±180.86ms +50.11%
query_block/query_block_in(1000)_times(100) 1223.1±28.14µs 1212.3±149.60µs -0.88%
query_block/query_block_in(1000)_times(1000) 13.4±2.51ms 11.8±0.32ms -11.94%
query_block/query_block_in(1000)_times(10000) 126.0±8.90ms 120.3±5.01ms -4.52%
storage_transaction 1160.6±423.06µs 1033.4±432.36µs -10.96%
vm/transaction_execution/1 440.5±31.50ms 419.5±16.48ms -4.77%
vm/transaction_execution/10 144.4±14.96ms 142.8±12.05ms -1.11%
vm/transaction_execution/20 127.1±8.19ms 131.5±8.90ms +3.46%
vm/transaction_execution/5 189.6±13.58ms 171.3±11.15ms -9.65%
vm/transaction_execution/50 165.0±18.42ms 145.6±5.01ms -11.76%

Copy link

Benchmark for 2719b3c

Click to view benchmark
Test Base PR %
accumulator_append 1191.3±289.51µs 916.6±238.45µs -23.06%
block_apply/block_apply_10 386.5±28.67ms 386.0±27.64ms -0.13%
block_apply/block_apply_1000 46.4±3.00s 43.8±2.47s -5.60%
get_with_proof/db_store 53.1±10.42µs 60.0±12.66µs +12.99%
get_with_proof/mem_store 57.5±13.67µs 48.8±13.64µs -15.13%
put_and_commit/db_store/1 148.7±37.61µs 209.8±13.30µs +41.09%
put_and_commit/db_store/10 1172.6±230.84µs 1359.0±270.74µs +15.90%
put_and_commit/db_store/100 11.4±1.87ms 11.6±1.88ms +1.75%
put_and_commit/db_store/5 633.4±111.55µs 735.7±151.74µs +16.15%
put_and_commit/db_store/50 5.3±0.70ms 5.1±0.40ms -3.77%
put_and_commit/mem_store/1 78.9±11.26µs 86.0±21.54µs +9.00%
put_and_commit/mem_store/10 783.4±158.18µs 772.7±119.95µs -1.37%
put_and_commit/mem_store/100 6.7±0.67ms 7.2±1.20ms +7.46%
put_and_commit/mem_store/5 372.4±86.68µs 433.8±105.45µs +16.49%
put_and_commit/mem_store/50 3.4±0.26ms 3.7±0.83ms +8.82%
query_block/query_block_in(10)_times(100) 5.3±0.79ms 4.9±0.57ms -7.55%
query_block/query_block_in(10)_times(1000) 53.6±12.81ms 49.4±6.13ms -7.84%
query_block/query_block_in(10)_times(10000) 597.3±115.65ms 540.5±67.94ms -9.51%
query_block/query_block_in(1000)_times(100) 1372.1±173.22µs 1220.4±60.58µs -11.06%
query_block/query_block_in(1000)_times(1000) 14.3±2.51ms 15.0±3.66ms +4.90%
query_block/query_block_in(1000)_times(10000) 169.7±23.44ms 151.1±27.10ms -10.96%
storage_transaction 1173.2±461.46µs 1077.8±399.50µs -8.13%
vm/transaction_execution/1 440.7±48.82ms 460.5±39.95ms +4.49%
vm/transaction_execution/10 163.3±19.72ms 172.9±19.65ms +5.88%
vm/transaction_execution/20 161.8±16.12ms 151.8±13.98ms -6.18%
vm/transaction_execution/5 192.3±17.57ms 205.8±14.01ms +7.02%
vm/transaction_execution/50 174.3±11.34ms 181.0±22.95ms +3.84%

Copy link

Benchmark for c631527

Click to view benchmark
Test Base PR %
accumulator_append 1091.5±226.56µs 891.4±199.99µs -18.33%
block_apply/block_apply_10 387.8±29.00ms 374.7±18.10ms -3.38%
block_apply/block_apply_1000 43.5±2.85s 43.4±3.27s -0.23%
get_with_proof/db_store 46.8±1.99µs 52.4±11.76µs +11.97%
get_with_proof/mem_store 36.7±0.85µs 59.5±11.49µs +62.13%
put_and_commit/db_store/1 118.8±7.24µs 122.6±19.00µs +3.20%
put_and_commit/db_store/10 1080.1±80.84µs 1100.5±116.37µs +1.89%
put_and_commit/db_store/100 11.2±1.98ms 11.0±1.55ms -1.79%
put_and_commit/db_store/5 582.9±96.60µs 563.3±52.99µs -3.36%
put_and_commit/db_store/50 6.9±1.39ms 5.5±1.08ms -20.29%
put_and_commit/mem_store/1 82.0±19.70µs 80.4±17.37µs -1.95%
put_and_commit/mem_store/10 680.9±57.57µs 714.5±76.59µs +4.93%
put_and_commit/mem_store/100 7.5±1.45ms 7.1±1.26ms -5.33%
put_and_commit/mem_store/5 357.4±64.85µs 355.0±56.14µs -0.67%
put_and_commit/mem_store/50 3.8±0.74ms 3.3±0.19ms -13.16%
query_block/query_block_in(10)_times(100) 6.2±1.16ms 4.9±0.49ms -20.97%
query_block/query_block_in(10)_times(1000) 72.0±20.65ms 47.8±5.16ms -33.61%
query_block/query_block_in(10)_times(10000) 705.5±128.22ms 596.6±68.23ms -15.44%
query_block/query_block_in(1000)_times(100) 1449.7±167.04µs 1333.5±134.24µs -8.02%
query_block/query_block_in(1000)_times(1000) 13.6±1.52ms 17.5±3.93ms +28.68%
query_block/query_block_in(1000)_times(10000) 121.1±4.61ms 130.4±13.79ms +7.68%
storage_transaction 1097.3±349.88µs 1076.8±349.50µs -1.87%
vm/transaction_execution/1 482.2±75.05ms 452.5±32.85ms -6.16%
vm/transaction_execution/10 150.1±12.20ms 158.9±17.69ms +5.86%
vm/transaction_execution/20 142.4±8.31ms 135.3±8.44ms -4.99%
vm/transaction_execution/5 189.2±8.84ms 184.9±14.69ms -2.27%
vm/transaction_execution/50 159.2±11.15ms 170.9±11.30ms +7.35%

Copy link

Benchmark for 5377aee

Click to view benchmark
Test Base PR %
accumulator_append 955.5±246.27µs 810.8±140.83µs -15.14%
block_apply/block_apply_10 389.1±21.54ms 415.4±43.91ms +6.76%
block_apply/block_apply_1000 43.1±1.98s 41.8±1.78s -3.02%
get_with_proof/db_store 49.1±7.16µs 49.1±8.64µs 0.00%
get_with_proof/mem_store 40.9±9.38µs 43.9±9.96µs +7.33%
put_and_commit/db_store/1 119.1±13.92µs 125.0±16.94µs +4.95%
put_and_commit/db_store/10 1378.5±328.64µs 1059.9±97.52µs -23.11%
put_and_commit/db_store/100 10.8±1.94ms 9.7±0.83ms -10.19%
put_and_commit/db_store/5 534.3±62.47µs 653.5±176.85µs +22.31%
put_and_commit/db_store/50 5.7±0.84ms 5.3±0.75ms -7.02%
put_and_commit/mem_store/1 73.9±8.98µs 81.8±22.11µs +10.69%
put_and_commit/mem_store/10 678.3±63.21µs 669.6±52.37µs -1.28%
put_and_commit/mem_store/100 7.1±1.28ms 6.6±0.47ms -7.04%
put_and_commit/mem_store/5 376.1±90.79µs 342.6±28.66µs -8.91%
put_and_commit/mem_store/50 3.3±0.30ms 3.3±0.17ms 0.00%
query_block/query_block_in(10)_times(100) 4.6±0.24ms 4.7±0.25ms +2.17%
query_block/query_block_in(10)_times(1000) 50.5±3.21ms 46.1±1.48ms -8.71%
query_block/query_block_in(10)_times(10000) 497.3±41.74ms 463.4±29.55ms -6.82%
query_block/query_block_in(1000)_times(100) 1225.7±86.76µs 1449.9±334.22µs +18.29%
query_block/query_block_in(1000)_times(1000) 12.2±0.28ms 12.0±0.34ms -1.64%
query_block/query_block_in(1000)_times(10000) 124.3±7.25ms 134.7±23.26ms +8.37%
storage_transaction 1110.8±495.67µs 1123.3±452.11µs +1.13%
vm/transaction_execution/1 475.6±81.40ms 443.6±19.63ms -6.73%
vm/transaction_execution/10 157.4±9.57ms 147.9±11.22ms -6.04%
vm/transaction_execution/20 145.6±18.13ms 143.9±15.49ms -1.17%
vm/transaction_execution/5 191.3±11.54ms 169.9±6.36ms -11.19%
vm/transaction_execution/50 157.8±14.52ms 155.3±13.86ms -1.58%

Copy link

Benchmark for 13702db

Click to view benchmark
Test Base PR %
accumulator_append 912.2±223.93µs 843.6±160.03µs -7.52%
block_apply/block_apply_10 375.6±10.65ms 376.2±20.60ms +0.16%
block_apply/block_apply_1000 41.4±1.41s 40.9±1.47s -1.21%
get_with_proof/db_store 52.8±11.52µs 48.5±3.15µs -8.14%
get_with_proof/mem_store 49.4±14.50µs 40.1±8.05µs -18.83%
put_and_commit/db_store/1 145.1±35.83µs 120.9±7.98µs -16.68%
put_and_commit/db_store/10 1139.6±198.15µs 1083.0±71.06µs -4.97%
put_and_commit/db_store/100 10.1±0.84ms 10.4±1.49ms +2.97%
put_and_commit/db_store/5 608.5±134.90µs 556.3±45.94µs -8.58%
put_and_commit/db_store/50 5.1±0.26ms 5.0±0.55ms -1.96%
put_and_commit/mem_store/1 78.0±11.68µs 75.2±10.43µs -3.59%
put_and_commit/mem_store/10 740.0±115.06µs 681.5±76.21µs -7.91%
put_and_commit/mem_store/100 6.8±0.80ms 6.5±0.53ms -4.41%
put_and_commit/mem_store/5 383.3±104.55µs 361.7±45.01µs -5.64%
put_and_commit/mem_store/50 3.3±0.14ms 3.3±0.17ms 0.00%
query_block/query_block_in(10)_times(100) 4.9±0.63ms 4.6±0.11ms -6.12%
query_block/query_block_in(10)_times(1000) 59.7±15.22ms 48.7±3.44ms -18.43%
query_block/query_block_in(10)_times(10000) 493.3±81.70ms 550.8±151.92ms +11.66%
query_block/query_block_in(1000)_times(100) 1268.0±155.34µs 1237.2±85.61µs -2.43%
query_block/query_block_in(1000)_times(1000) 12.4±1.04ms 12.6±0.50ms +1.61%
query_block/query_block_in(1000)_times(10000) 165.1±47.91ms 123.7±3.52ms -25.08%
storage_transaction 1043.0±329.62µs 1198.5±499.36µs +14.91%
vm/transaction_execution/1 434.1±43.56ms 437.6±36.29ms +0.81%
vm/transaction_execution/10 140.4±6.80ms 148.0±9.65ms +5.41%
vm/transaction_execution/20 131.4±9.98ms 140.1±12.18ms +6.62%
vm/transaction_execution/5 170.0±7.35ms 179.2±12.63ms +5.41%
vm/transaction_execution/50 167.5±29.43ms 156.3±10.68ms -6.69%

@simonjiao simonjiao marked this pull request as ready for review July 15, 2024 01:03
@simonjiao simonjiao requested review from sanlee42 and nkysg as code owners July 15, 2024 01:03
@simonjiao
Copy link
Collaborator Author

@coderabbitai

Copy link

coderabbitai bot commented Jul 15, 2024

@simonjiao: I will review the changes.

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bed5324 and 6b0ce59.

Files selected for processing (11)
  • flexidag/src/consensusdb/access.rs (1 hunks)
  • flexidag/src/consensusdb/consensus_reachability.rs (1 hunks)
  • flexidag/src/consensusdb/consensus_relations.rs (8 hunks)
  • flexidag/src/consensusdb/db.rs (3 hunks)
  • flexidag/src/consensusdb/item.rs (1 hunks)
  • flexidag/src/consensusdb/mod.rs (1 hunks)
  • flexidag/src/consensusdb/set_access.rs (1 hunks)
  • flexidag/src/consensusdb/writer.rs (4 hunks)
  • storage/src/db_storage/mod.rs (4 hunks)
  • storage/src/storage.rs (2 hunks)
  • sync/tests/common_test_sync_libs.rs (2 hunks)
Files skipped from review due to trivial changes (5)
  • flexidag/src/consensusdb/access.rs
  • flexidag/src/consensusdb/consensus_reachability.rs
  • flexidag/src/consensusdb/item.rs
  • storage/src/storage.rs
  • sync/tests/common_test_sync_libs.rs
Additional comments not posted (26)
flexidag/src/consensusdb/mod.rs (1)

12-12: Addition of set_access module looks good.

The new module set_access is correctly declared.

flexidag/src/consensusdb/writer.rs (4)

11-15: Addition of put_inner method to DbWriter trait looks good.

The method signature is correct and follows the trait's style.


44-56: Addition of put_inner method to DirectDbWriter implementation looks good.

The method correctly follows the put operation logic and handles errors appropriately.


83-90: Addition of put_inner method to BatchDbWriter implementation looks good.

The method correctly follows the put operation logic and handles errors appropriately.


104-111: Addition of put_inner method to DbWriter implementation for &mut T looks good.

The method correctly delegates the put_inner operation.

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

110-112: Addition of write_batch method to FlexiDagStorage looks good.

The method correctly delegates the batch write operation and handles errors appropriately.


114-122: Addition of write_batch_opt method to FlexiDagStorage looks good.

The method correctly delegates the batch write operation with options and handles errors appropriately.


124-129: Addition of flush_opt method to FlexiDagStorage looks good.

The method correctly delegates the flush operation and handles errors appropriately.

flexidag/src/consensusdb/set_access.rs (6)

15-21: Addition of DbSetAccess::new method looks good.

The method correctly initializes the DbSetAccess struct.


23-27: Addition of DbSetAccess::read method looks good.

The method correctly reads data from the database and handles errors appropriately.


29-43: Addition of DbSetAccess::write method looks good.

The method correctly writes data to the database and handles errors appropriately.


45-70: Addition of DbSetAccess::seek_iterator method looks good.

The method correctly seeks the iterator in the database and handles errors appropriately.


79-84: Addition of CachedDbSetAccess::new method looks good.

The method correctly initializes the CachedDbSetAccess struct.


104-121: Addition of CachedDbSetAccess::write method looks good.

The method correctly writes data to the database with caching and handles errors appropriately.

flexidag/src/consensusdb/consensus_relations.rs (7)

6-6: Import added: Ensure usage of CachedDbSetAccess.

The import of CachedDbSetAccess seems appropriate. Verify its correct usage in the file.


33-33: Schema definition modified: Verify correctness.

The RelationChildren schema definition was changed from Arc<Vec<Hash>> to Hash. Ensure that the new definition is correct and compatible with the rest of the code.


63-69: ValueCodec implementation modified: Verify correctness.

The ValueCodec implementation for RelationChildren was changed from Arc<Vec<Hash>> to Hash. Ensure that the new implementation is correct and compatible with the rest of the code.


79-79: Field type updated: Verify correctness.

The children_access field in DbRelationsStore was updated to use CachedDbSetAccess. Ensure that the new field type is correct and used appropriately in the struct.


88-88: Constructor updated: Verify correctness.

The constructor of DbRelationsStore was updated to initialize the new children_access field type. Ensure that the constructor correctly initializes the new field type.


110-116: Method updated: Verify correctness.

The insert_batch method was updated to handle the new children_access field type. Ensure that the method correctly performs the necessary operations with the new field type.


128-132: Method updated: Verify correctness.

The get_children method was updated to use the new children_access field type. Ensure that the method correctly retrieves the children using the new field type.

storage/src/db_storage/mod.rs (5)

471-479: Method added: Verify correctness.

The raw_iterator_cf_opt method was added. Ensure that the method is correctly implemented and used appropriately in the file.


481-483: Method added: Verify correctness.

The raw_iterator_opt method was added. Ensure that the method is correctly implemented and used appropriately in the file.


Line range hint 485-492:
Method added: Verify correctness.

The raw_get_pinned_cf method was added. Ensure that the method is correctly implemented and used appropriately in the file.


497-500: Method added: Verify correctness.

The raw_write_batch method was added. Ensure that the method is correctly implemented and used appropriately in the file.


502-510: Methods added: Verify correctness.

The raw_write_batch_opt and flush_opt methods were added. Ensure that the methods are correctly implemented and used appropriately in the file.

@simonjiao simonjiao requested review from welbon and jackzhhuang July 15, 2024 03:26
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

Outside diff range, codebase verification and nitpick comments (1)
flexidag/tests/tests.rs (1)

163-165: Inconsistent return type for get_children function.

The get_children function has inconsistent return types across different files. While some instances return Arc<RwLock<Vec<HashValue>>>, others return BlockHashes. This inconsistency can lead to potential issues.

  • Files and Lines to Review:
    • sync/src/tasks/mock.rs: Line 1
    • flexidag/src/reachability/tests.rs: Line 1
    • flexidag/src/reachability/extensions.rs: Lines 1, 2
    • flexidag/src/reachability/inquirer.rs: Line 1
    • flexidag/src/reachability/reindex.rs: Lines 1, 2, 3, 4, 5, 6, 7, 8
    • flexidag/src/blockdag.rs: Line 1
    • flexidag/src/consensusdb/consensus_relations.rs: Lines 1, 2
    • flexidag/src/consensusdb/consensus_reachability.rs: Lines 1, 2, 3, 4, 5, 6, 7, 8
    • chain/service/src/chain_service.rs: Line 1

Please ensure that all instances of get_children return Arc<RwLock<Vec<HashValue>>> to maintain consistency across the codebase.

Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to get_children match the new return type.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `get_children` match the new return type.

# Test: Search for the function usage. Expect: Only occurances of the new return type.
rg --type rust -A 5 $'get_children'

Length of output: 13515

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6b0ce59 and fb97b92.

Files selected for processing (6)
  • chain/service/src/chain_service.rs (1 hunks)
  • flexidag/src/blockdag.rs (2 hunks)
  • flexidag/src/consensusdb/consensus_relations.rs (9 hunks)
  • flexidag/src/reachability/relations_service.rs (2 hunks)
  • flexidag/tests/tests.rs (2 hunks)
  • sync/src/tasks/mock.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • flexidag/src/consensusdb/consensus_relations.rs
Additional comments not posted (5)
flexidag/src/reachability/relations_service.rs (1)

27-29: LGTM!

The change to return Arc<RwLock<Vec<HashValue>>> for better concurrency handling is appropriate.

flexidag/src/blockdag.rs (1)

243-248: LGTM!

The change to return Arc<RwLock<Vec<HashValue>>> for better concurrency handling is appropriate.

sync/src/tasks/mock.rs (1)

400-400: LGTM!

The change to handle read and iteration over block children using Arc<RwLock<Vec<HashValue>>> is appropriate.

chain/service/src/chain_service.rs (1)

451-451: LGTM!

The change to handle read and iteration over block children using Arc<RwLock<Vec<HashValue>>> is appropriate.

flexidag/tests/tests.rs (1)

224-233: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to get_children match the new return type.

Copy link

Benchmark for dc596bf

Click to view benchmark
Test Base PR %
accumulator_append 981.4±254.67µs 796.1±115.57µs -18.88%
block_apply/block_apply_10 409.7±79.15ms 401.2±26.49ms -2.07%
block_apply/block_apply_1000 43.2±2.17s 41.2±0.98s -4.63%
get_with_proof/db_store 46.1±1.58µs 47.0±2.55µs +1.95%
get_with_proof/mem_store 39.5±6.26µs 50.6±12.15µs +28.10%
put_and_commit/db_store/1 117.4±7.13µs 127.7±19.54µs +8.77%
put_and_commit/db_store/10 1106.5±130.88µs 1082.2±54.87µs -2.20%
put_and_commit/db_store/100 10.2±0.69ms 9.8±0.65ms -3.92%
put_and_commit/db_store/5 542.1±42.03µs 532.8±23.30µs -1.72%
put_and_commit/db_store/50 6.2±1.49ms 5.0±0.17ms -19.35%
put_and_commit/mem_store/1 75.4±11.89µs 73.0±6.75µs -3.18%
put_and_commit/mem_store/10 677.6±47.55µs 677.5±49.98µs -0.01%
put_and_commit/mem_store/100 6.7±0.43ms 6.7±0.30ms 0.00%
put_and_commit/mem_store/5 342.8±33.32µs 346.6±55.71µs +1.11%
put_and_commit/mem_store/50 3.6±0.63ms 3.3±0.19ms -8.33%
query_block/query_block_in(10)_times(100) 6.2±1.34ms 4.7±0.27ms -24.19%
query_block/query_block_in(10)_times(1000) 47.2±3.26ms 44.8±1.48ms -5.08%
query_block/query_block_in(10)_times(10000) 487.1±28.94ms 461.6±11.49ms -5.24%
query_block/query_block_in(1000)_times(100) 1172.6±69.98µs 1175.8±29.28µs +0.27%
query_block/query_block_in(1000)_times(1000) 11.4±0.36ms 12.2±1.26ms +7.02%
query_block/query_block_in(1000)_times(10000) 141.8±41.31ms 125.2±15.39ms -11.71%
storage_transaction 1095.5±365.20µs 1149.5±484.96µs +4.93%
vm/transaction_execution/1 464.6±30.57ms 426.9±11.84ms -8.11%
vm/transaction_execution/10 151.0±15.83ms 146.9±13.83ms -2.72%
vm/transaction_execution/20 146.7±9.14ms 125.1±7.43ms -14.72%
vm/transaction_execution/5 185.0±14.39ms 181.7±17.90ms -1.78%
vm/transaction_execution/50 178.8±14.94ms 151.1±9.37ms -15.49%

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

Outside diff range, codebase verification and nitpick comments (5)
flexidag/src/types/reachability.rs (1)

1-13: Struct definition update: Removal of fields

The removal of children and future_covering_set fields from ReachabilityData struct has not been fully propagated throughout the codebase. The following files still contain references to these fields and need to be updated or removed:

  • sync/tests/common_test_sync_libs.rs: Lines 1-5
  • sync/src/verified_rpc_client.rs: Lines 1-10
  • sync/src/tasks/mock.rs: Lines 1-10
  • sync/src/tasks/tests.rs: Lines 1-10
  • sync/src/tasks/mod.rs: Lines 1-10
  • sync/src/tasks/block_sync_task.rs: Lines 1-10
  • storage/src/tests/test_block.rs: Lines 1-10
  • storage/src/block/mod.rs: Lines 1-10
  • network-rpc/src/rpc.rs: Lines 1-10
  • network-rpc/api/src/lib.rs: Lines 1-10
  • flexidag/src/blockdag.rs: Lines 1-10
  • flexidag/src/reachability/relations_service.rs: Lines 1-10
  • flexidag/tests/tests.rs: Lines 1-10
  • flexidag/src/ghostdag/protocol.rs: Lines 1-10
  • flexidag/src/reachability/tests.rs: Lines 1-10
  • flexidag/src/reachability/reindex.rs: Lines 1-10
  • flexidag/src/reachability/inquirer.rs: Lines 1-10
  • flexidag/src/consensusdb/consensus_relations.rs: Lines 1-10
  • flexidag/src/consensusdb/consensus_reachability.rs: Lines 1-10
  • flexidag/src/reachability/extensions.rs: Lines 1-10
  • flexidag/src/reachability/tree.rs: Lines 1-10
  • chain/api/src/service.rs: Lines 1-10
  • chain/service/src/chain_service.rs: Lines 1-10
  • commons/forkable-jellyfish-merkle/src/lib.rs: Lines 1-10
  • commons/forkable-jellyfish-merkle/src/jellyfish_merkle_test.rs: Lines 1-10
  • commons/forkable-jellyfish-merkle/src/iterator/mod.rs: Lines 1-10
  • commons/forkable-jellyfish-merkle/src/node_type/node_type_test.rs: Lines 1-10
  • commons/forkable-jellyfish-merkle/src/node_type/mod.rs: Lines 1-10
  • commons/accumulator/src/tree.rs: Lines 1-10

Please ensure that all references and manipulations related to these fields are updated or removed in the entire codebase to maintain consistency.

Analysis chain

Struct definition update: Removal of fields

The removal of children and future_covering_set fields from ReachabilityData struct simplifies the data structure but could have broader implications on data management and access patterns in the system. Ensure that all references and manipulations related to these fields are updated or removed in the entire codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all references to the removed fields are updated or removed.

# Test: Search for the usage of `children` and `future_covering_set`. Expect: No occurrences.
rg --type rust -A 5 $'children|future_covering_set'

Length of output: 97908

flexidag/src/consensusdb/consensus_reachability.rs (4)

Line range hint 14-55: Introduction of new caching mechanisms and schema definitions

The addition of new schemas (ReachabilityChildren, ReachabilityFcs) and caching mechanisms (CachedDbSetAccess) appears to enhance data handling efficiency. Ensure that these new schemas are integrated properly across the system, and consider adding unit tests to validate their behavior and performance.

Consider further optimization by exploring fixed-length constants for store prefixes as noted in the TODO comment. This could potentially improve performance in key lookups.


Line range hint 65-141: Codec implementations for new schemas

The implementation of KeyCodec and ValueCodec for the new schemas is crucial for ensuring data integrity and efficient serialization/deserialization. Review and test these implementations thoroughly to prevent data corruption or performance issues.

Consider adding more detailed error handling or logging within these codec implementations to aid in debugging and maintenance.


Line range hint 222-239: Method updates in DbReachabilityStore

The updates to methods like append_child and insert_future_covering_item to utilize the new caching layers need careful testing to ensure they handle data correctly and efficiently.

Would you like me to help in setting up more comprehensive tests for these updated methods?


Line range hint 270-587: Handling of children and future covering sets in reader methods

The methods get_children and get_future_covering_set now utilize the new caching layers. It's important to ensure that these methods return accurate and up-to-date data. The TODO comments suggest potential improvements like removing unnecessary cloning, which should be addressed to optimize performance.

- Ok(Arc::new(self.children_acess.read(hash)?.read().clone()))
+ Ok(self.children_acess.read(hash)?.read().clone())

This change removes unnecessary use of Arc which could improve performance by reducing memory overhead.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fb97b92 and 7e0f513.

Files selected for processing (3)
  • flexidag/src/consensusdb/consensus_reachability.rs (18 hunks)
  • flexidag/src/consensusdb/set_access.rs (1 hunks)
  • flexidag/src/types/reachability.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • flexidag/src/consensusdb/set_access.rs
Additional comments not posted (1)
flexidag/src/consensusdb/consensus_reachability.rs (1)

Line range hint 147-209: Updates to DbReachabilityStore with new access layers

The modifications to DbReachabilityStore to handle children_access and fcs_access are significant. It's essential to ensure that these changes do not disrupt existing functionalities and that they are compatible with the rest of the system's architecture.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7e0f513 and f55fc79.

Files selected for processing (1)
  • flexidag/src/consensusdb/db.rs (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • flexidag/src/consensusdb/db.rs

Copy link

Benchmark for 94e2b50

Click to view benchmark
Test Base PR %
accumulator_append 799.2±137.43µs 771.2±127.81µs -3.50%
block_apply/block_apply_10 361.7±8.44ms 376.8±20.00ms +4.17%
block_apply/block_apply_1000 43.1±2.07s 39.0±1.44s -9.51%
get_with_proof/db_store 49.2±6.04µs 47.1±4.55µs -4.27%
get_with_proof/mem_store 44.6±12.01µs 37.7±2.83µs -15.47%
put_and_commit/db_store/1 127.7±18.13µs 121.6±13.33µs -4.78%
put_and_commit/db_store/10 1145.9±200.98µs 1059.7±82.72µs -7.52%
put_and_commit/db_store/100 9.4±0.38ms 9.6±0.46ms +2.13%
put_and_commit/db_store/5 553.7±46.11µs 634.7±154.40µs +14.63%
put_and_commit/db_store/50 5.0±0.47ms 5.1±0.63ms +2.00%
put_and_commit/mem_store/1 72.4±6.64µs 76.6±17.73µs +5.80%
put_and_commit/mem_store/10 760.5±188.57µs 685.9±79.55µs -9.81%
put_and_commit/mem_store/100 6.5±0.27ms 6.5±0.28ms 0.00%
put_and_commit/mem_store/5 348.2±41.30µs 343.3±29.79µs -1.41%
put_and_commit/mem_store/50 3.5±0.55ms 3.3±0.14ms -5.71%
query_block/query_block_in(10)_times(100) 4.9±0.51ms 4.6±0.19ms -6.12%
query_block/query_block_in(10)_times(1000) 50.7±9.79ms 46.4±1.39ms -8.48%
query_block/query_block_in(10)_times(10000) 702.5±173.65ms 466.8±14.47ms -33.55%
query_block/query_block_in(1000)_times(100) 1241.7±136.04µs 1148.5±13.72µs -7.51%
query_block/query_block_in(1000)_times(1000) 13.2±1.45ms 11.5±0.17ms -12.88%
query_block/query_block_in(1000)_times(10000) 128.7±14.08ms 118.8±3.49ms -7.69%
storage_transaction 1140.5±484.17µs 1052.6±444.90µs -7.71%
vm/transaction_execution/1 426.2±17.28ms 416.3±14.32ms -2.32%
vm/transaction_execution/10 137.9±10.00ms 131.4±8.27ms -4.71%
vm/transaction_execution/20 129.4±6.47ms 128.0±14.12ms -1.08%
vm/transaction_execution/5 163.5±6.48ms 165.8±10.08ms +1.41%
vm/transaction_execution/50 142.5±7.39ms 143.1±7.18ms +0.42%

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f55fc79 and 49f220e.

Files selected for processing (3)
  • flexidag/src/consensusdb/consensus_reachability.rs (18 hunks)
  • flexidag/src/consensusdb/set_access.rs (1 hunks)
  • flexidag/src/types/interval.rs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • flexidag/src/consensusdb/consensus_reachability.rs
  • flexidag/src/consensusdb/set_access.rs
Additional comments not posted (1)
flexidag/src/types/interval.rs (1)

4-4: LGTM! The addition of PartialOrd and Ord traits is appropriate.

This change allows Interval instances to be used in ordered collections and comparisons.

@simonjiao simonjiao marked this pull request as draft July 18, 2024 09:02
Copy link

Benchmark for 6a23ea7

Click to view benchmark
Test Base PR %
accumulator_append 815.1±145.69µs 786.6±112.43µs -3.50%
block_apply/block_apply_10 367.9±14.82ms 367.3±18.94ms -0.16%
block_apply/block_apply_1000 39.2±1.05s 39.8±2.77s +1.53%
get_with_proof/db_store 46.1±1.10µs 47.7±3.51µs +3.47%
get_with_proof/mem_store 37.5±1.06µs 43.8±10.34µs +16.80%
put_and_commit/db_store/1 118.8±13.06µs 114.5±4.85µs -3.62%
put_and_commit/db_store/10 1173.7±266.58µs 1113.2±144.20µs -5.15%
put_and_commit/db_store/100 11.1±2.85ms 10.0±0.52ms -9.91%
put_and_commit/db_store/5 517.9±28.36µs 528.7±29.90µs +2.09%
put_and_commit/db_store/50 4.8±0.20ms 4.9±0.21ms +2.08%
put_and_commit/mem_store/1 77.6±16.76µs 73.5±10.53µs -5.28%
put_and_commit/mem_store/10 683.0±66.57µs 676.5±63.44µs -0.95%
put_and_commit/mem_store/100 6.6±0.50ms 6.5±0.42ms -1.52%
put_and_commit/mem_store/5 343.9±38.54µs 343.3±37.63µs -0.17%
put_and_commit/mem_store/50 3.3±0.38ms 3.5±0.59ms +6.06%
query_block/query_block_in(10)_times(100) 4.7±0.29ms 4.6±0.13ms -2.13%
query_block/query_block_in(10)_times(1000) 50.7±7.71ms 46.2±1.31ms -8.88%
query_block/query_block_in(10)_times(10000) 466.4±12.50ms 467.6±36.13ms +0.26%
query_block/query_block_in(1000)_times(100) 1212.8±74.52µs 1207.2±75.09µs -0.46%
query_block/query_block_in(1000)_times(1000) 12.2±0.32ms 13.0±1.55ms +6.56%
query_block/query_block_in(1000)_times(10000) 123.3±5.71ms 123.7±15.25ms +0.32%
storage_transaction 1112.9±451.83µs 1213.5±729.38µs +9.04%
vm/transaction_execution/1 428.0±17.16ms 447.0±38.69ms +4.44%
vm/transaction_execution/10 129.9±4.54ms 131.7±7.67ms +1.39%
vm/transaction_execution/20 124.7±7.54ms 124.8±6.10ms +0.08%
vm/transaction_execution/5 158.2±7.57ms 179.5±16.60ms +13.46%
vm/transaction_execution/50 142.1±6.20ms 143.6±6.74ms +1.06%

Copy link

Benchmark for 71bb247

Click to view benchmark
Test Base PR %
accumulator_append 966.9±234.90µs 894.3±214.94µs -7.51%
block_apply/block_apply_10 381.3±20.08ms 365.1±11.54ms -4.25%
block_apply/block_apply_1000 40.3±1.03s 40.1±1.20s -0.50%
get_with_proof/db_store 45.8±1.86µs 47.7±6.11µs +4.15%
get_with_proof/mem_store 36.6±0.63µs 38.0±3.44µs +3.83%
put_and_commit/db_store/1 118.8±5.84µs 124.7±16.83µs +4.97%
put_and_commit/db_store/10 1088.3±148.14µs 1071.0±146.85µs -1.59%
put_and_commit/db_store/100 9.5±0.38ms 10.0±0.62ms +5.26%
put_and_commit/db_store/5 551.1±24.08µs 571.7±85.26µs +3.74%
put_and_commit/db_store/50 5.0±0.42ms 5.3±0.64ms +6.00%
put_and_commit/mem_store/1 73.6±8.74µs 72.2±6.03µs -1.90%
put_and_commit/mem_store/10 691.2±81.06µs 685.6±54.81µs -0.81%
put_and_commit/mem_store/100 6.5±0.27ms 6.7±0.37ms +3.08%
put_and_commit/mem_store/5 355.1±50.19µs 412.3±125.56µs +16.11%
put_and_commit/mem_store/50 3.5±0.61ms 3.4±0.40ms -2.86%
query_block/query_block_in(10)_times(100) 5.3±0.93ms 4.6±0.18ms -13.21%
query_block/query_block_in(10)_times(1000) 48.3±4.55ms 44.9±1.43ms -7.04%
query_block/query_block_in(10)_times(10000) 509.5±63.06ms 470.9±38.67ms -7.58%
query_block/query_block_in(1000)_times(100) 1205.5±20.36µs 1231.8±57.03µs +2.18%
query_block/query_block_in(1000)_times(1000) 11.8±0.12ms 12.0±0.15ms +1.69%
query_block/query_block_in(1000)_times(10000) 118.9±1.77ms 126.8±8.17ms +6.64%
storage_transaction 1137.3±451.29µs 1041.2±405.29µs -8.45%
vm/transaction_execution/1 434.5±24.72ms 429.2±24.57ms -1.22%
vm/transaction_execution/10 152.0±12.98ms 165.6±15.37ms +8.95%
vm/transaction_execution/20 121.8±6.04ms 144.2±16.10ms +18.39%
vm/transaction_execution/5 177.4±16.06ms 205.6±32.58ms +15.90%
vm/transaction_execution/50 142.1±9.66ms 161.4±14.34ms +13.58%

Copy link

Benchmark for 4bb28ad

Click to view benchmark
Test Base PR %
accumulator_append 806.9±158.40µs 814.4±142.88µs +0.93%
block_apply/block_apply_10 367.9±15.83ms 401.7±67.45ms +9.19%
block_apply/block_apply_1000 40.0±1.74s 39.7±0.91s -0.75%
get_with_proof/db_store 65.1±18.28µs 45.6±1.35µs -29.95%
get_with_proof/mem_store 57.6±14.65µs 38.7±5.28µs -32.81%
put_and_commit/db_store/1 148.4±37.56µs 119.6±8.18µs -19.41%
put_and_commit/db_store/10 1031.3±54.30µs 1065.8±104.20µs +3.35%
put_and_commit/db_store/100 9.7±0.45ms 9.7±0.44ms 0.00%
put_and_commit/db_store/5 586.8±73.64µs 518.9±28.24µs -11.57%
put_and_commit/db_store/50 5.4±0.92ms 4.9±0.17ms -9.26%
put_and_commit/mem_store/1 78.3±7.08µs 86.9±27.19µs +10.98%
put_and_commit/mem_store/10 690.6±96.25µs 687.5±60.68µs -0.45%
put_and_commit/mem_store/100 6.6±0.47ms 6.7±0.50ms +1.52%
put_and_commit/mem_store/5 355.5±44.64µs 340.2±28.00µs -4.30%
put_and_commit/mem_store/50 3.3±0.19ms 3.3±0.17ms 0.00%
query_block/query_block_in(10)_times(100) 5.2±0.87ms 4.7±0.34ms -9.62%
query_block/query_block_in(10)_times(1000) 46.9±2.46ms 52.8±13.30ms +12.58%
query_block/query_block_in(10)_times(10000) 493.4±40.07ms 474.5±30.62ms -3.83%
query_block/query_block_in(1000)_times(100) 1140.5±21.36µs 1199.9±116.55µs +5.21%
query_block/query_block_in(1000)_times(1000) 12.1±1.07ms 12.6±1.90ms +4.13%
query_block/query_block_in(1000)_times(10000) 122.8±12.14ms 121.6±15.48ms -0.98%
storage_transaction 1172.1±526.35µs 1078.2±425.23µs -8.01%
vm/transaction_execution/1 442.7±29.42ms 463.6±64.00ms +4.72%
vm/transaction_execution/10 147.2±9.63ms 147.6±13.56ms +0.27%
vm/transaction_execution/20 155.3±17.83ms 135.4±11.59ms -12.81%
vm/transaction_execution/5 209.0±18.93ms 170.5±7.91ms -18.42%
vm/transaction_execution/50 155.6±8.51ms 159.9±19.85ms +2.76%

@simonjiao simonjiao force-pushed the add-db-set-store branch 2 times, most recently from afece09 to e1d180d Compare August 5, 2024 10:08
Copy link

github-actions bot commented Aug 5, 2024

Benchmark for cc4a9bd

Click to view benchmark
Test Base PR %
accumulator_append 756.2±90.27µs 872.0±188.12µs +15.31%
block_apply/block_apply_10 365.7±7.61ms 363.5±8.59ms -0.60%
block_apply/block_apply_1000 39.3±0.69s 40.5±1.92s +3.05%
get_with_proof/db_store 46.8±4.48µs 45.8±1.35µs -2.14%
get_with_proof/mem_store 38.1±3.10µs 36.7±0.99µs -3.67%
put_and_commit/db_store/1 121.9±13.78µs 115.2±6.90µs -5.50%
put_and_commit/db_store/10 1098.1±134.55µs 1100.4±152.47µs +0.21%
put_and_commit/db_store/100 9.7±0.73ms 10.2±0.73ms +5.15%
put_and_commit/db_store/5 555.7±54.48µs 541.3±42.83µs -2.59%
put_and_commit/db_store/50 4.9±0.57ms 5.1±0.35ms +4.08%
put_and_commit/mem_store/1 72.7±8.40µs 73.4±11.41µs +0.96%
put_and_commit/mem_store/10 685.9±64.14µs 753.6±191.30µs +9.87%
put_and_commit/mem_store/100 6.6±0.71ms 7.6±1.60ms +15.15%
put_and_commit/mem_store/5 336.1±27.67µs 338.7±34.05µs +0.77%
put_and_commit/mem_store/50 3.3±0.25ms 3.4±0.52ms +3.03%
query_block/query_block_in(10)_times(100) 4.5±0.24ms 4.9±0.99ms +8.89%
query_block/query_block_in(10)_times(1000) 45.7±0.91ms 47.1±6.12ms +3.06%
query_block/query_block_in(10)_times(10000) 472.0±44.40ms 467.8±49.33ms -0.89%
query_block/query_block_in(1000)_times(100) 1129.1±23.49µs 1126.4±19.67µs -0.24%
query_block/query_block_in(1000)_times(1000) 11.8±0.66ms 11.9±0.48ms +0.85%
query_block/query_block_in(1000)_times(10000) 110.6±2.72ms 119.2±7.07ms +7.78%
storage_transaction 1028.4±447.49µs 1310.4±527.71µs +27.42%
vm/transaction_execution/1 415.6±13.06ms 419.3±26.09ms +0.89%
vm/transaction_execution/10 131.2±3.78ms 145.8±12.34ms +11.13%
vm/transaction_execution/20 126.4±4.68ms 144.3±11.79ms +14.16%
vm/transaction_execution/5 165.2±10.64ms 184.1±15.51ms +11.44%
vm/transaction_execution/50 143.2±9.54ms 179.0±33.19ms +25.00%

Copy link

github-actions bot commented Aug 5, 2024

Benchmark for 0d76fe2

Click to view benchmark
Test Base PR %
accumulator_append 792.0±111.00µs 827.9±165.56µs +4.53%
block_apply/block_apply_10 368.8±13.26ms 367.4±21.68ms -0.38%
block_apply/block_apply_1000 41.6±1.16s 40.6±1.46s -2.40%
get_with_proof/db_store 45.8±1.88µs 66.1±20.29µs +44.32%
get_with_proof/mem_store 36.7±0.99µs 36.8±1.72µs +0.27%
put_and_commit/db_store/1 116.7±10.93µs 120.1±8.71µs +2.91%
put_and_commit/db_store/10 1219.5±259.59µs 1165.6±283.47µs -4.42%
put_and_commit/db_store/100 10.7±1.93ms 9.6±0.71ms -10.28%
put_and_commit/db_store/5 557.1±42.63µs 732.9±181.88µs +31.56%
put_and_commit/db_store/50 5.3±0.69ms 6.3±1.55ms +18.87%
put_and_commit/mem_store/1 75.6±10.74µs 89.1±21.85µs +17.86%
put_and_commit/mem_store/10 898.8±244.98µs 692.9±60.79µs -22.91%
put_and_commit/mem_store/100 7.8±1.90ms 7.5±1.94ms -3.85%
put_and_commit/mem_store/5 350.3±38.09µs 351.0±62.71µs +0.20%
put_and_commit/mem_store/50 3.4±0.47ms 3.9±0.87ms +14.71%
query_block/query_block_in(10)_times(100) 5.3±0.84ms 4.5±0.11ms -15.09%
query_block/query_block_in(10)_times(1000) 52.4±7.83ms 44.6±2.25ms -14.89%
query_block/query_block_in(10)_times(10000) 456.4±20.14ms 500.9±54.14ms +9.75%
query_block/query_block_in(1000)_times(100) 1250.1±172.68µs 1196.7±107.06µs -4.27%
query_block/query_block_in(1000)_times(1000) 12.4±2.09ms 11.5±0.24ms -7.26%
query_block/query_block_in(1000)_times(10000) 117.9±3.10ms 117.5±13.48ms -0.34%
storage_transaction 986.5±382.11µs 1015.6±308.17µs +2.95%
vm/transaction_execution/1 433.2±23.58ms 461.2±63.60ms +6.46%
vm/transaction_execution/10 142.1±9.78ms 140.7±12.37ms -0.99%
vm/transaction_execution/20 131.4±9.09ms 143.3±14.68ms +9.06%
vm/transaction_execution/5 176.9±13.74ms 170.6±15.39ms -3.56%
vm/transaction_execution/50 165.5±9.83ms 164.5±12.77ms -0.60%

1. fix a typo
2. remove unused codes
Copy link

github-actions bot commented Aug 6, 2024

Benchmark for 69ee51d

Click to view benchmark
Test Base PR %
accumulator_append 825.9±206.96µs 782.9±118.23µs -5.21%
block_apply/block_apply_10 377.6±10.90ms 372.1±10.99ms -1.46%
block_apply/block_apply_1000 42.1±2.73s 39.7±1.54s -5.70%
get_with_proof/db_store 44.7±1.12µs 47.3±5.00µs +5.82%
get_with_proof/mem_store 38.0±4.20µs 36.8±1.40µs -3.16%
put_and_commit/db_store/1 114.8±5.81µs 121.0±10.70µs +5.40%
put_and_commit/db_store/10 1028.4±96.72µs 1093.2±152.33µs +6.30%
put_and_commit/db_store/100 9.6±0.93ms 10.3±0.99ms +7.29%
put_and_commit/db_store/5 541.3±54.35µs 569.5±51.60µs +5.21%
put_and_commit/db_store/50 4.9±0.17ms 5.1±0.52ms +4.08%
put_and_commit/mem_store/1 73.1±9.81µs 72.0±7.46µs -1.50%
put_and_commit/mem_store/10 687.9±89.92µs 715.4±128.76µs +4.00%
put_and_commit/mem_store/100 6.5±0.43ms 6.6±0.57ms +1.54%
put_and_commit/mem_store/5 343.7±36.23µs 347.5±34.18µs +1.11%
put_and_commit/mem_store/50 3.2±0.13ms 3.3±0.16ms +3.13%
query_block/query_block_in(10)_times(100) 4.9±0.92ms 4.5±0.25ms -8.16%
query_block/query_block_in(10)_times(1000) 47.0±4.21ms 45.7±2.76ms -2.77%
query_block/query_block_in(10)_times(10000) 470.3±24.41ms 454.2±5.75ms -3.42%
query_block/query_block_in(1000)_times(100) 1141.2±37.41µs 1215.1±114.81µs +6.48%
query_block/query_block_in(1000)_times(1000) 11.4±0.34ms 13.4±2.03ms +17.54%
query_block/query_block_in(1000)_times(10000) 114.0±2.28ms 113.9±2.86ms -0.09%
storage_transaction 1143.3±440.27µs 1201.9±534.06µs +5.13%
vm/transaction_execution/1 442.2±24.24ms 420.3±13.96ms -4.95%
vm/transaction_execution/10 139.7±10.25ms 138.5±8.05ms -0.86%
vm/transaction_execution/20 133.6±11.52ms 135.0±11.38ms +1.05%
vm/transaction_execution/5 175.4±13.31ms 176.9±15.76ms +0.86%
vm/transaction_execution/50 153.7±9.33ms 156.4±16.24ms +1.76%

@simonjiao simonjiao closed this Aug 7, 2024
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