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

rpc&&miner: Update miner && related apis #2534

Merged
merged 1 commit into from
May 26, 2021
Merged

rpc&&miner: Update miner && related apis #2534

merged 1 commit into from
May 26, 2021

Conversation

sanlee42
Copy link
Member

@sanlee42 sanlee42 commented May 25, 2021

APIs change:

  1. Return block hash in minting.submit
  2. Add prevous_hash in subscribe MintBlockEvent
  3. Add new rpc mining.get_job for getting MintBlockEvent

Optimize codes:

  1. Clean struct MintBlock
  2. Send seal event to MinerService instead of bus

APIs change:
1. Return block hash in minting.submit
2. Add prevous_hash in subscribe MintBlockEvent
3. Add new rpc mining.get_job for getting MintBlockEvent
Optimize codes:
1. Clean struct MintBlock
2. Send seal event to MinerService instead of bus
@sanlee42 sanlee42 marked this pull request as ready for review May 25, 2021 18:31
@codecov
Copy link

codecov bot commented May 25, 2021

Codecov Report

Merging #2534 (9af92be) into master (614ea16) will increase coverage by 0.24%.
The diff coverage is 17.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2534      +/-   ##
==========================================
+ Coverage   32.93%   33.17%   +0.24%     
==========================================
  Files         498      498              
  Lines       43219    43287      +68     
  Branches    19574    19593      +19     
==========================================
+ Hits        14230    14356     +126     
+ Misses      14383    14224     -159     
- Partials    14606    14707     +101     
Flag Coverage Δ
unittests 33.17% <17.08%> (+0.24%) ⬆️

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

Impacted Files Coverage Δ
cmd/miner_client/src/job_client.rs 0.00% <0.00%> (ø)
node/src/node.rs 12.99% <0.00%> (ø)
rpc/api/src/miner.rs 0.00% <0.00%> (ø)
rpc/api/src/types.rs 16.55% <0.00%> (+0.98%) ⬆️
rpc/api/src/types/pubsub.rs 29.79% <0.00%> (ø)
rpc/client/src/lib.rs 14.59% <0.00%> (+0.47%) ⬆️
rpc/client/src/pubsub_client.rs 24.33% <0.00%> (ø)
rpc/server/src/module/miner_rpc.rs 9.68% <0.00%> (-5.32%) ⬇️
stratum/src/rpc.rs 2.44% <0.00%> (ø)
stratum/src/stratum.rs 17.65% <0.00%> (+0.34%) ⬆️
... and 48 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 614ea16...9af92be. Read the comment docs.

@github-actions
Copy link

Benchmark for 6d49546

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 2.7±0.80ms 2.5±0.11ms +8.00%
block_apply/block_apply_10 483.3±6.72ms 479.2±15.08ms +0.86%
block_apply/block_apply_1000 49.2±1.06s 48.3±0.90s +1.86%
get_with_proof/db_store 38.3±0.24µs 38.2±0.38µs +0.26%
get_with_proof/mem_store 31.7±0.22µs 31.5±0.25µs +0.63%
put_and_commit/db_store/1 1506.4±55.39µs 1760.1±194.97µs -14.41%
put_and_commit/db_store/10 2.7±0.44ms 2.8±0.57ms -3.57%
put_and_commit/db_store/100 9.8±1.24ms 9.9±1.34ms -1.01%
put_and_commit/db_store/5 2.1±0.20ms 2.2±0.21ms -4.55%
put_and_commit/db_store/50 6.1±0.89ms 6.0±0.85ms +1.67%
put_and_commit/mem_store/1 63.9±5.78µs 63.1±5.56µs +1.27%
put_and_commit/mem_store/10 589.6±48.22µs 584.7±45.63µs +0.84%
put_and_commit/mem_store/100 5.7±0.81ms 5.7±0.80ms 0.00%
put_and_commit/mem_store/5 298.3±25.07µs 297.4±23.82µs +0.30%
put_and_commit/mem_store/50 2.9±0.18ms 2.9±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 2.9±0.11ms 2.9±0.06ms 0.00%
query_block/query_block_in(10)_times(1000) 29.3±0.84ms 29.2±0.24ms +0.34%
query_block/query_block_in(10)_times(10000) 297.2±7.41ms 289.2±6.03ms +2.77%
query_block/query_block_in(1000)_times(100) 929.8±14.39µs 908.5±2.02µs +2.34%
query_block/query_block_in(1000)_times(1000) 9.2±0.05ms 9.1±0.05ms +1.10%
query_block/query_block_in(1000)_times(10000) 93.0±0.42ms 91.3±0.39ms +1.86%
storage_transaction 64.8±4.26ms 60.2±5.14ms +7.64%
vm/transaction_execution/1 332.3±0.86ms 332.4±2.07ms -0.03%
vm/transaction_execution/10 111.6±0.55ms 113.1±5.93ms -1.33%
vm/transaction_execution/20 105.0±0.37ms 105.4±1.27ms -0.38%
vm/transaction_execution/5 133.5±0.54ms 134.2±2.23ms -0.52%
vm/transaction_execution/50 120.8±0.76ms 122.0±5.01ms -0.98%

@jolestar jolestar merged commit 810630d into master May 26, 2021
@jolestar jolestar deleted the mining branch May 26, 2021 08:49
naughtyvenom pushed a commit to naughtyvenom/starcoin that referenced this pull request Jul 19, 2021
APIs change:
1. Return block hash in minting.submit
2. Add prevous_hash in subscribe MintBlockEvent
3. Add new rpc mining.get_job for getting MintBlockEvent
Optimize codes:
1. Clean struct MintBlock
2. Send seal event to MinerService instead of bus
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