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

Implement account provider #3259

Merged
merged 2 commits into from Mar 3, 2022
Merged

Implement account provider #3259

merged 2 commits into from Mar 3, 2022

Conversation

sanlee42
Copy link
Member

@sanlee42 sanlee42 commented Mar 3, 2022

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

@sanlee42 sanlee42 requested a review from jolestar March 3, 2022 01:23
@sanlee42
Copy link
Member Author

sanlee42 commented Mar 3, 2022

the private key provider can implement by local db provider through import key.

@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #3259 (0691705) into master (abb263c) will increase coverage by 0.21%.
The diff coverage is 16.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3259      +/-   ##
==========================================
+ Coverage   31.78%   31.98%   +0.21%     
==========================================
  Files         493      499       +6     
  Lines       46062    46240     +178     
  Branches    21152    21215      +63     
==========================================
+ Hits        14635    14787     +152     
+ Misses      17429    17425       -4     
- Partials    13998    14028      +30     
Flag Coverage Δ
unittests 31.98% <16.49%> (+0.21%) ⬆️

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

Impacted Files Coverage Δ
account/api/src/lib.rs 100.00% <ø> (ø)
account/provider/src/local_provider.rs 0.00% <0.00%> (ø)
config/src/lib.rs 35.06% <0.00%> (+2.65%) ⬆️
account/provider/src/provider/mod.rs 10.00% <10.00%> (ø)
cmd/starcoin/src/dev/tests.rs 14.96% <14.29%> (+1.55%) ⬆️
account/provider/src/rpc_provider.rs 18.37% <18.37%> (ø)
cmd/starcoin/src/cli_state.rs 48.79% <37.50%> (-1.21%) ⬇️
config/src/account_provider_config.rs 52.18% <52.18%> (ø)
account/api/src/provider.rs 75.00% <75.00%> (ø)
account/provider/src/lib.rs 100.00% <100.00%> (ø)
... and 91 more

Continue to review full report at Codecov.

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

Copy link
Member

@jolestar jolestar left a comment

Choose a reason for hiding this comment

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

LGTM

  1. cmd 的集成测试现在临时被注释掉了,可以在本地运行一下,确保命令行兼容没问题。
  2. 进一步需要增加一些 local provider 的测试用例。
  3. 需要补充一些 local provider 的使用文档(Readme.md 里的例子也可以更新一下)。

account/provider/Cargo.toml Outdated Show resolved Hide resolved
cmd/starcoin/src/cli_state.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

Benchmark for e36339e

Click to view benchmark
Test Base PR %
accumulator_append 590.9±9.54µs 592.6±22.74µs +0.29%
block_apply/block_apply_10 269.2±1.69ms 269.7±0.91ms +0.19%
block_apply/block_apply_1000 27.6±0.03s 27.7±0.02s +0.36%
get_with_proof/db_store 36.4±0.80µs 36.4±2.04µs 0.00%
get_with_proof/mem_store 31.0±0.69µs 31.3±0.29µs +0.97%
put_and_commit/db_store/1 94.6±4.90µs 95.5±5.50µs +0.95%
put_and_commit/db_store/10 852.6±41.51µs 847.4±40.51µs -0.61%
put_and_commit/db_store/100 7.3±0.31ms 7.3±0.32ms 0.00%
put_and_commit/db_store/5 441.2±24.22µs 433.1±22.33µs -1.84%
put_and_commit/db_store/50 3.8±0.17ms 3.8±0.15ms 0.00%
put_and_commit/mem_store/1 61.4±5.63µs 61.0±5.53µs -0.65%
put_and_commit/mem_store/10 573.2±48.02µs 572.6±47.43µs -0.10%
put_and_commit/mem_store/100 5.6±0.80ms 5.6±0.81ms 0.00%
put_and_commit/mem_store/5 288.8±23.92µs 291.3±24.70µs +0.87%
put_and_commit/mem_store/50 2.8±0.18ms 2.8±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 3.8±0.10ms 3.8±0.10ms 0.00%
query_block/query_block_in(10)_times(1000) 38.6±0.99ms 38.3±0.64ms -0.78%
query_block/query_block_in(10)_times(10000) 390.2±8.80ms 385.4±5.19ms -1.23%
query_block/query_block_in(1000)_times(100) 959.4±14.45µs 951.2±15.39µs -0.85%
query_block/query_block_in(1000)_times(1000) 9.5±0.11ms 9.5±0.07ms 0.00%
query_block/query_block_in(1000)_times(10000) 96.1±0.89ms 93.9±0.94ms -2.29%
storage_transaction 1055.6±295.82µs 1077.3±342.21µs +2.06%
vm/transaction_execution/1 315.1±0.79ms 317.0±0.96ms +0.60%
vm/transaction_execution/10 99.0±0.41ms 99.2±0.55ms +0.20%
vm/transaction_execution/20 91.0±0.58ms 95.7±11.04ms +5.16%
vm/transaction_execution/5 121.5±1.05ms 121.7±0.82ms +0.16%
vm/transaction_execution/50 103.4±1.16ms 103.5±1.01ms +0.10%

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

Benchmark for 3f64cff

Click to view benchmark
Test Base PR %
accumulator_append 602.0±13.27µs 588.1±11.62µs -2.31%
block_apply/block_apply_10 266.8±1.04ms 267.6±1.45ms +0.30%
block_apply/block_apply_1000 27.1±0.05s 27.4±0.06s +1.11%
get_with_proof/db_store 36.2±0.30µs 35.7±0.32µs -1.38%
get_with_proof/mem_store 31.2±0.34µs 31.3±0.27µs +0.32%
put_and_commit/db_store/1 97.4±4.68µs 94.6±4.65µs -2.87%
put_and_commit/db_store/10 850.4±42.79µs 854.5±39.44µs +0.48%
put_and_commit/db_store/100 7.3±0.31ms 7.3±0.30ms 0.00%
put_and_commit/db_store/5 434.0±22.73µs 434.3±28.30µs +0.07%
put_and_commit/db_store/50 3.8±0.16ms 3.8±0.18ms 0.00%
put_and_commit/mem_store/1 61.4±5.48µs 61.3±5.45µs -0.16%
put_and_commit/mem_store/10 573.4±46.39µs 573.9±48.53µs +0.09%
put_and_commit/mem_store/100 5.6±0.81ms 5.6±0.81ms 0.00%
put_and_commit/mem_store/5 289.1±24.36µs 292.8±23.68µs +1.28%
put_and_commit/mem_store/50 2.8±0.18ms 2.8±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 3.9±0.12ms 3.9±0.07ms 0.00%
query_block/query_block_in(10)_times(1000) 39.1±0.95ms 39.1±1.10ms 0.00%
query_block/query_block_in(10)_times(10000) 389.4±7.53ms 389.1±7.40ms -0.08%
query_block/query_block_in(1000)_times(100) 959.7±6.48µs 926.0±9.69µs -3.51%
query_block/query_block_in(1000)_times(1000) 9.6±0.08ms 9.3±0.09ms -3.12%
query_block/query_block_in(1000)_times(10000) 95.4±0.52ms 92.4±0.68ms -3.14%
storage_transaction 1071.7±332.25µs 1035.8±232.70µs -3.35%
vm/transaction_execution/1 318.3±1.27ms 317.4±1.92ms -0.28%
vm/transaction_execution/10 99.9±0.75ms 99.1±0.39ms -0.80%
vm/transaction_execution/20 92.9±2.82ms 91.8±1.10ms -1.18%
vm/transaction_execution/5 122.0±0.42ms 121.7±0.99ms -0.25%
vm/transaction_execution/50 104.0±1.50ms 103.6±1.07ms -0.38%

@sanlee42 sanlee42 merged commit 93c9a9f into master Mar 3, 2022
@sanlee42 sanlee42 deleted the account branch March 3, 2022 04:51
@jolestar jolestar mentioned this pull request Jun 30, 2022
7 tasks
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.

[cli] Extract abstract account provider for support remote RPC with local account provider
2 participants