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

[asset-mapping] add asset mapping contracts and unit tests #4379

Open
wants to merge 87 commits into
base: nkysg/compiler-v2-update
Choose a base branch
from

Conversation

welbon
Copy link
Contributor

@welbon welbon commented Jan 24, 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

welbon and others added 30 commits December 31, 2024 16:19
…s initialization function to avoid modifying the initial call of the Package
…s initialization function to avoid modifying the initial call of the Package
… old token string with Object<Metadata>; 3. Append test `test_asset_mapping_proof_coin_type_name`
…t support vector<vector<u8>>, we need to put all the data into a separate vector<u8> parameter when passing the proof parameter `sibilings`, and split it with `|` to ensure that the move layer can receive it smoothly.
@welbon welbon requested review from nkysg and jolestar as code owners January 24, 2025 07:42
Copy link

coderabbitai bot commented Jan 24, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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.


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.

Copy link

Benchmark for d5c6dfd

Click to view benchmark
Test Base PR %
accumulator_append 845.9±159.05µs 806.3±100.41µs -4.68%
block_apply/block_apply_10 537.0±39.46ms 509.0±21.49ms -5.21%
block_apply/block_apply_1000 58.2±1.75s 62.2±2.55s +6.87%
get_with_proof/db_store 43.4±1.20µs 52.3±12.54µs +20.51%
get_with_proof/mem_store 36.9±2.56µs 37.3±2.52µs +1.08%
put_and_commit/db_store/1 212.8±57.40µs 121.8±14.07µs -42.76%
put_and_commit/db_store/10 1038.4±91.49µs 1140.6±90.39µs +9.84%
put_and_commit/db_store/100 11.0±1.39ms 9.8±0.42ms -10.91%
put_and_commit/db_store/5 615.6±66.68µs 614.6±88.34µs -0.16%
put_and_commit/db_store/50 4.9±0.42ms 5.7±0.60ms +16.33%
put_and_commit/mem_store/1 86.2±14.50µs 70.9±7.43µs -17.75%
put_and_commit/mem_store/10 787.8±176.98µs 715.8±102.83µs -9.14%
put_and_commit/mem_store/100 6.5±0.49ms 6.5±0.50ms 0.00%
put_and_commit/mem_store/5 447.6±96.74µs 344.2±44.84µs -23.10%
put_and_commit/mem_store/50 3.2±0.18ms 3.3±0.34ms +3.13%
query_block/query_block_in(10)_times(100) 12.1±0.73ms 12.8±0.69ms +5.79%
query_block/query_block_in(10)_times(1000) 120.4±5.83ms 122.7±10.64ms +1.91%
query_block/query_block_in(10)_times(10000) 1290.6±65.05ms 1246.8±47.20ms -3.39%
query_block/query_block_in(1000)_times(100) 1227.3±44.82µs 1189.7±38.71µs -3.06%
query_block/query_block_in(1000)_times(1000) 14.7±3.29ms 12.7±1.19ms -13.61%
query_block/query_block_in(1000)_times(10000) 122.0±6.33ms 126.4±9.85ms +3.61%
storage_transaction 1220.4±525.91µs 1159.8±442.49µs -4.97%
vm/transaction_execution/1 656.3±27.02ms 769.6±86.09ms +17.26%
vm/transaction_execution/10 259.4±17.66ms 294.2±30.22ms +13.42%
vm/transaction_execution/20 234.0±12.91ms 272.2±17.12ms +16.32%
vm/transaction_execution/5 290.8±23.44ms 334.5±22.85ms +15.03%
vm/transaction_execution/50 343.0±41.83ms 360.0±27.93ms +4.96%

Copy link

Benchmark for 13ebc37

Click to view benchmark
Test Base PR %
accumulator_append 786.5±89.77µs 935.1±164.69µs +18.89%
block_apply/block_apply_10 500.7±32.37ms 589.4±106.83ms +17.72%
block_apply/block_apply_1000 63.9±4.45s 65.7±3.86s +2.82%
get_with_proof/db_store 51.9±7.34µs 63.1±11.81µs +21.58%
get_with_proof/mem_store 39.7±6.32µs 42.4±6.87µs +6.80%
put_and_commit/db_store/1 122.9±8.91µs 136.5±18.86µs +11.07%
put_and_commit/db_store/10 1351.0±244.21µs 1291.0±227.03µs -4.44%
put_and_commit/db_store/100 11.4±2.34ms 11.0±1.77ms -3.51%
put_and_commit/db_store/5 616.1±99.83µs 765.2±162.58µs +24.20%
put_and_commit/db_store/50 5.9±0.64ms 7.4±1.29ms +25.42%
put_and_commit/mem_store/1 75.1±14.44µs 84.4±14.03µs +12.38%
put_and_commit/mem_store/10 682.9±79.57µs 784.1±147.05µs +14.82%
put_and_commit/mem_store/100 7.5±1.16ms 7.0±0.94ms -6.67%
put_and_commit/mem_store/5 351.2±47.25µs 367.2±65.33µs +4.56%
put_and_commit/mem_store/50 3.5±0.48ms 4.2±0.90ms +20.00%
query_block/query_block_in(10)_times(100) 12.9±0.52ms 13.9±0.79ms +7.75%
query_block/query_block_in(10)_times(1000) 117.6±3.34ms 130.0±15.15ms +10.54%
query_block/query_block_in(10)_times(10000) 1467.5±142.00ms 1346.3±97.01ms -8.26%
query_block/query_block_in(1000)_times(100) 1344.3±122.25µs 1695.8±380.52µs +26.15%
query_block/query_block_in(1000)_times(1000) 14.8±2.60ms 14.5±1.21ms -2.03%
query_block/query_block_in(1000)_times(10000) 129.5±14.45ms 144.9±12.60ms +11.89%
storage_transaction 1122.3±434.57µs 1252.4±544.55µs +11.59%
vm/transaction_execution/1 673.5±37.69ms 836.2±116.09ms +24.16%
vm/transaction_execution/10 260.6±15.66ms 307.0±21.76ms +17.81%
vm/transaction_execution/20 250.6±19.15ms 301.2±34.93ms +20.19%
vm/transaction_execution/5 281.2±16.86ms 365.7±43.15ms +30.05%
vm/transaction_execution/50 297.5±28.29ms 417.8±42.02ms +40.44%

Copy link

Benchmark for 69ebc9a

Click to view benchmark
Test Base PR %
accumulator_append 884.9±174.87µs 844.6±138.46µs -4.55%
block_apply/block_apply_10 494.6±29.54ms 551.0±40.06ms +11.40%
block_apply/block_apply_1000 59.0±3.45s 63.6±2.84s +7.80%
get_with_proof/db_store 51.9±9.86µs 50.2±10.09µs -3.28%
get_with_proof/mem_store 39.9±7.09µs 38.2±4.50µs -4.26%
put_and_commit/db_store/1 168.5±37.54µs 141.6±29.43µs -15.96%
put_and_commit/db_store/10 1156.9±182.76µs 1054.0±80.84µs -8.89%
put_and_commit/db_store/100 10.5±0.86ms 10.0±0.49ms -4.76%
put_and_commit/db_store/5 542.6±25.05µs 765.6±190.71µs +41.10%
put_and_commit/db_store/50 5.2±0.31ms 5.4±0.30ms +3.85%
put_and_commit/mem_store/1 73.2±9.75µs 81.3±14.84µs +11.07%
put_and_commit/mem_store/10 675.5±88.68µs 696.7±90.53µs +3.14%
put_and_commit/mem_store/100 6.6±0.66ms 6.8±0.64ms +3.03%
put_and_commit/mem_store/5 352.6±60.23µs 356.2±64.77µs +1.02%
put_and_commit/mem_store/50 3.3±0.35ms 3.2±0.33ms -3.03%
query_block/query_block_in(10)_times(100) 15.8±2.46ms 13.6±2.20ms -13.92%
query_block/query_block_in(10)_times(1000) 143.6±29.51ms 132.7±10.50ms -7.59%
query_block/query_block_in(10)_times(10000) 1231.7±84.15ms 1351.7±170.33ms +9.74%
query_block/query_block_in(1000)_times(100) 1245.6±76.73µs 1195.6±80.23µs -4.01%
query_block/query_block_in(1000)_times(1000) 12.1±0.46ms 12.1±1.86ms 0.00%
query_block/query_block_in(1000)_times(10000) 131.8±16.25ms 137.7±17.71ms +4.48%
storage_transaction 1166.0±530.56µs 1155.1±483.16µs -0.93%
vm/transaction_execution/1 611.4±24.35ms 659.6±32.44ms +7.88%
vm/transaction_execution/10 251.4±19.07ms 290.0±29.45ms +15.35%
vm/transaction_execution/20 243.4±16.98ms 255.4±13.48ms +4.93%
vm/transaction_execution/5 283.2±17.56ms 331.8±38.17ms +17.16%
vm/transaction_execution/50 279.7±19.17ms 323.6±14.67ms +15.70%

…pping-1

# Conflicts:
#	config/src/genesis_config.rs
#	genesis/generated/barnard/genesis
#	genesis/generated/halley/genesis
#	genesis/generated/main/genesis
#	genesis/generated/proxima/genesis
#	genesis/generated/vega/genesis
#	vm/framework/starcoin-framework/doc/stc_genesis.md
Copy link

github-actions bot commented Feb 5, 2025

Benchmark for 53bece2

Click to view benchmark
Test Base PR %
accumulator_append 821.3±122.18µs 807.7±84.88µs -1.66%
block_apply/block_apply_10 478.3±20.25ms 513.0±20.86ms +7.25%
block_apply/block_apply_1000 58.4±1.15s 60.8±1.87s +4.11%
get_with_proof/db_store 44.2±3.31µs 44.1±2.10µs -0.23%
get_with_proof/mem_store 37.1±3.47µs 36.4±2.43µs -1.89%
put_and_commit/db_store/1 120.6±11.70µs 127.9±20.51µs +6.05%
put_and_commit/db_store/10 1114.1±125.60µs 1120.5±62.73µs +0.57%
put_and_commit/db_store/100 10.5±1.72ms 9.8±0.55ms -6.67%
put_and_commit/db_store/5 605.0±76.12µs 616.7±105.93µs +1.93%
put_and_commit/db_store/50 5.8±0.97ms 5.2±0.68ms -10.34%
put_and_commit/mem_store/1 85.4±19.50µs 71.9±8.67µs -15.81%
put_and_commit/mem_store/10 718.9±95.87µs 668.0±101.96µs -7.08%
put_and_commit/mem_store/100 6.8±0.84ms 6.7±0.41ms -1.47%
put_and_commit/mem_store/5 335.5±41.34µs 368.6±56.41µs +9.87%
put_and_commit/mem_store/50 3.4±0.35ms 3.2±0.18ms -5.88%
query_block/query_block_in(10)_times(100) 14.3±2.26ms 12.9±0.54ms -9.79%
query_block/query_block_in(10)_times(1000) 132.3±13.66ms 131.8±9.76ms -0.38%
query_block/query_block_in(10)_times(10000) 1272.5±92.92ms 1279.2±134.64ms +0.53%
query_block/query_block_in(1000)_times(100) 1390.2±218.46µs 1244.9±70.76µs -10.45%
query_block/query_block_in(1000)_times(1000) 13.5±1.55ms 11.9±0.89ms -11.85%
query_block/query_block_in(1000)_times(10000) 119.2±8.48ms 127.3±8.29ms +6.80%
storage_transaction 982.9±314.40µs 1122.3±468.09µs +14.18%
vm/transaction_execution/1 622.3±16.74ms 757.6±71.32ms +21.74%
vm/transaction_execution/10 236.9±13.63ms 275.7±10.12ms +16.38%
vm/transaction_execution/20 249.6±16.17ms 256.2±10.56ms +2.64%
vm/transaction_execution/5 312.1±24.83ms 299.9±13.67ms -3.91%
vm/transaction_execution/50 297.8±46.18ms 324.3±21.30ms +8.90%

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.

3 participants