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

[mpm] Fix mpm integration test call api state.get_with_proof_by_root_raw #3664

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

jolestar
Copy link
Member

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?

Must flush state tree after state tree change, otherwise, get state proof will raise the error Missing node at HashValue

Other information

@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #3664 (788234e) into master (75de44e) will increase coverage by 0.08%.
The diff coverage is 0.00%.

❗ Current head 788234e differs from pull request most recent head 36cdcd7. Consider uploading reports for the commit 36cdcd7 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3664      +/-   ##
==========================================
+ Coverage   28.57%   28.64%   +0.08%     
==========================================
  Files         591      591              
  Lines       50686    50687       +1     
  Branches    23868    23869       +1     
==========================================
+ Hits        14476    14513      +37     
+ Misses      22013    21959      -54     
- Partials    14197    14215      +18     
Flag Coverage Δ
unittests 28.64% <0.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
...starcoin-transactional-test-harness/src/context.rs 0.00% <0.00%> (ø)
storage/src/db_storage/mod.rs 38.73% <0.00%> (-3.82%) ⬇️
network/api/src/tests.rs 25.00% <0.00%> (-2.77%) ⬇️
network-p2p/src/protocol.rs 41.67% <0.00%> (-2.77%) ⬇️
network-p2p/src/protocol/generic_proto/handler.rs 41.20% <0.00%> (-2.24%) ⬇️
commons/service-registry/src/handler_proxy.rs 37.50% <0.00%> (-2.08%) ⬇️
...ons/forkable-jellyfish-merkle/src/node_type/mod.rs 69.84% <0.00%> (-1.69%) ⬇️
vm/compiler/src/lib.rs 32.29% <0.00%> (-1.57%) ⬇️
network-p2p/src/service.rs 29.67% <0.00%> (-1.53%) ⬇️
...ync/src/block_connector/block_connector_service.rs 28.78% <0.00%> (-1.43%) ⬇️
... and 65 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 75de44e...36cdcd7. Read the comment docs.

@jolestar jolestar enabled auto-merge (squash) August 17, 2022 02:00
@jolestar jolestar merged commit c4dca75 into master Aug 17, 2022
@jolestar jolestar deleted the fix_mpm_integration_test branch August 17, 2022 02:38
@github-actions
Copy link

Benchmark for 98cba42

Click to view benchmark
Test Base PR %
accumulator_append 605.1±32.06µs 608.9±31.33µs +0.63%
block_apply/block_apply_10 639.1±4.27ms 631.4±1.83ms -1.20%
block_apply/block_apply_1000 64.7±0.07s 64.9±0.05s +0.31%
get_with_proof/db_store 36.5±0.41µs 36.2±0.24µs -0.82%
get_with_proof/mem_store 31.5±0.19µs 31.3±0.21µs -0.63%
put_and_commit/db_store/1 95.9±5.23µs 96.4±4.92µs +0.52%
put_and_commit/db_store/10 872.7±40.18µs 860.5±42.98µs -1.40%
put_and_commit/db_store/100 7.4±0.30ms 7.4±0.33ms 0.00%
put_and_commit/db_store/5 439.2±21.85µs 444.1±35.08µs +1.12%
put_and_commit/db_store/50 3.8±0.16ms 3.8±0.16ms 0.00%
put_and_commit/mem_store/1 61.7±5.71µs 61.5±5.68µs -0.32%
put_and_commit/mem_store/10 576.5±46.44µs 575.9±47.04µs -0.10%
put_and_commit/mem_store/100 5.6±0.34ms 5.7±0.83ms +1.79%
put_and_commit/mem_store/5 290.9±24.35µs 290.3±24.73µs -0.21%
put_and_commit/mem_store/50 2.8±0.18ms 2.8±0.19ms 0.00%
query_block/query_block_in(10)_times(100) 5.5±0.17ms 5.6±0.26ms +1.82%
query_block/query_block_in(10)_times(1000) 54.6±1.23ms 53.7±2.71ms -1.65%
query_block/query_block_in(10)_times(10000) 544.2±13.92ms 545.3±13.64ms +0.20%
query_block/query_block_in(1000)_times(100) 981.9±30.31µs 967.8±12.74µs -1.44%
query_block/query_block_in(1000)_times(1000) 9.8±0.11ms 9.6±0.10ms -2.04%
query_block/query_block_in(1000)_times(10000) 98.6±0.99ms 96.3±0.82ms -2.33%
storage_transaction 1101.8±352.47µs 1127.9±349.66µs +2.37%
vm/transaction_execution/1 712.6±2.91ms 711.3±1.12ms -0.18%
vm/transaction_execution/10 179.1±3.36ms 176.7±0.41ms -1.34%
vm/transaction_execution/20 153.6±2.66ms 152.9±0.82ms -0.46%
vm/transaction_execution/5 235.4±1.14ms 234.7±1.51ms -0.30%
vm/transaction_execution/50 167.7±1.03ms 167.4±1.16ms -0.18%

@baichuan3
Copy link

call api state.get_with_proof_by_root_raw 验证ok了。

然后又在block checkpoint的初始化上卡住了。

// TODO figure out how to call genesis init script in integration tests

//# run --signers creator
script{
    use StarcoinFramework::StdlibUpgradeScripts;
    
    fun main(){
        StdlibUpgradeScripts::upgrade_from_v11_to_v12();
    }
}

对应checkpoint init的方法:

    public fun checkpoints_init(){

        assert!(!exists<Checkpoints>(CoreAddresses::GENESIS_ADDRESS()), Errors::already_published(ERR_ALREADY_INITIALIZED));
        let signer = GenesisSignerCapability::get_genesis_signer();
        
        let checkpoints = Ring::create_with_capacity<Checkpoint>(CHECKPOINT_LENGTH);
        move_to<Checkpoints>(
            &signer,
            Checkpoints {
               checkpoints  : checkpoints,
               index        : 0,
               last_number  : 0,
        });
    }

错误信息输出

task 2 'run'. lines 7-14:
{
  "gas_used": 17743,
  "status": {
    "MoveAbort": {
      "location": {
        "Module": {
          "address": "0x00000000000000000000000000000001",
          "name": "Block"
        }
      },
      "abort_code": "5382"
    }
  }
}

可以直接执行 https://github.com/starcoinorg/starcoin-framework/blob/dao_integration_test/integration-tests/daospace/xdao.move 来复现。

@baichuan3
Copy link

验证通过

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