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

[dev branch] move update use new gas meter imp #3795

Merged
merged 70 commits into from
Jan 8, 2023
Merged

[dev branch] move update use new gas meter imp #3795

merged 70 commits into from
Jan 8, 2023

Conversation

nkysg
Copy link
Collaborator

@nkysg nkysg commented Nov 13, 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

@nkysg nkysg changed the title [WIP] move update use new gas meter imp [WIP dev branch] move update use new gas meter imp Nov 13, 2022
@nkysg nkysg changed the title [WIP dev branch] move update use new gas meter imp [wip dev branch] move update use new gas meter imp Nov 13, 2022
@codecov
Copy link

codecov bot commented Nov 14, 2022

Codecov Report

Merging #3795 (cd3ebc9) into dev (74264b7) will decrease coverage by 1.12%.
The diff coverage is 59.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #3795      +/-   ##
==========================================
- Coverage   55.72%   54.61%   -1.11%     
==========================================
  Files         597      612      +15     
  Lines       64366    67236    +2870     
==========================================
+ Hits        35864    36716     +852     
- Misses      28502    30520    +2018     
Flag Coverage Δ
unittests 54.61% <59.98%> (-1.11%) ⬇️

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

Impacted Files Coverage Δ
abi/decoder/src/lib.rs 1.35% <0.00%> (-7.56%) ⬇️
abi/types/src/lib.rs 28.98% <0.00%> (-9.14%) ⬇️
cmd/starcoin/src/account/accept_token_cmd.rs 0.00% <0.00%> (ø)
cmd/starcoin/src/cli_state.rs 0.00% <0.00%> (-15.80%) ⬇️
cmd/starcoin/src/dev/compile_cmd.rs 0.00% <0.00%> (ø)
cmd/starcoin/src/view.rs 0.00% <0.00%> (ø)
config/src/lib.rs 60.59% <ø> (-3.41%) ⬇️
config/src/tests.rs 98.15% <ø> (-0.02%) ⬇️
executor/src/block_executor.rs 89.37% <ø> (ø)
...reate_block_template/test_create_block_template.rs 100.00% <ø> (ø)
... and 178 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 faf9bb4...cd3ebc9. Read the comment docs.

@nkysg nkysg changed the title [wip dev branch] move update use new gas meter imp [dev branch] move update use new gas meter imp Dec 7, 2022
@nkysg
Copy link
Collaborator Author

nkysg commented Dec 7, 2022

现在正在重新跑下main和barnard的历史数据确定没有问题

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Benchmark for 6ea337f

Click to view benchmark
Test Base PR %
accumulator_append 607.5±29.08µs 604.5±29.72µs -0.49%
block_apply/block_apply_10 265.2±0.54ms 285.2±5.11ms +7.54%
block_apply/block_apply_1000 27.0±0.02s 29.0±0.04s +7.41%
get_with_proof/db_store 36.6±0.29µs 36.7±0.23µs +0.27%
get_with_proof/mem_store 31.7±0.28µs 31.7±0.23µs 0.00%
put_and_commit/db_store/1 96.3±5.11µs 97.2±8.49µs +0.93%
put_and_commit/db_store/10 858.6±38.92µs 861.9±42.65µs +0.38%
put_and_commit/db_store/100 7.4±0.37ms 7.4±0.30ms 0.00%
put_and_commit/db_store/5 440.9±23.70µs 445.4±22.73µs +1.02%
put_and_commit/db_store/50 3.9±0.20ms 3.8±0.16ms -2.56%
put_and_commit/mem_store/1 62.1±5.70µs 62.0±5.65µs -0.16%
put_and_commit/mem_store/10 580.9±49.25µs 577.6±47.27µs -0.57%
put_and_commit/mem_store/100 5.7±0.82ms 5.7±0.84ms 0.00%
put_and_commit/mem_store/5 293.4±25.53µs 291.9±25.10µs -0.51%
put_and_commit/mem_store/50 2.8±0.18ms 2.8±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 4.0±0.08ms 4.1±0.13ms +2.50%
query_block/query_block_in(10)_times(1000) 40.3±0.58ms 39.9±1.41ms -0.99%
query_block/query_block_in(10)_times(10000) 397.1±8.56ms 406.2±11.18ms +2.29%
query_block/query_block_in(1000)_times(100) 992.0±9.80µs 958.0±8.09µs -3.43%
query_block/query_block_in(1000)_times(1000) 9.8±0.06ms 9.5±0.07ms -3.06%
query_block/query_block_in(1000)_times(10000) 98.8±0.92ms 95.5±0.62ms -3.34%
storage_transaction 1069.2±353.47µs 1034.9±315.10µs -3.21%
vm/transaction_execution/1 314.7±0.51ms 333.4±0.47ms +5.94%
vm/transaction_execution/10 99.9±0.23ms 104.7±1.32ms +4.80%
vm/transaction_execution/20 93.7±1.38ms 97.3±0.37ms +3.84%
vm/transaction_execution/5 121.3±0.13ms 127.8±0.30ms +5.36%
vm/transaction_execution/50 108.4±0.28ms 111.7±0.26ms +3.04%

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Benchmark for ac5635a

Click to view benchmark
Test Base PR %
accumulator_append 606.4±30.65µs 606.2±27.50µs -0.03%
block_apply/block_apply_10 265.0±0.28ms 284.0±1.17ms +7.17%
block_apply/block_apply_1000 27.1±0.01s 28.9±0.03s +6.64%
get_with_proof/db_store 36.7±0.25µs 36.4±0.21µs -0.82%
get_with_proof/mem_store 31.5±0.17µs 31.4±0.16µs -0.32%
put_and_commit/db_store/1 96.5±5.07µs 96.3±4.97µs -0.21%
put_and_commit/db_store/10 860.0±41.27µs 858.2±40.74µs -0.21%
put_and_commit/db_store/100 7.3±0.28ms 7.4±0.32ms +1.37%
put_and_commit/db_store/5 438.6±21.76µs 441.0±22.97µs +0.55%
put_and_commit/db_store/50 3.8±0.17ms 3.8±0.17ms 0.00%
put_and_commit/mem_store/1 61.5±5.69µs 61.4±5.67µs -0.16%
put_and_commit/mem_store/10 574.5±47.71µs 574.0±47.16µs -0.09%
put_and_commit/mem_store/100 5.7±0.84ms 5.6±0.34ms -1.75%
put_and_commit/mem_store/5 290.0±24.81µs 290.9±25.19µs +0.31%
put_and_commit/mem_store/50 2.8±0.18ms 2.8±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 4.0±0.09ms 4.1±0.12ms +2.50%
query_block/query_block_in(10)_times(1000) 39.9±1.10ms 40.9±1.51ms +2.51%
query_block/query_block_in(10)_times(10000) 405.0±6.08ms 402.0±7.83ms -0.74%
query_block/query_block_in(1000)_times(100) 978.2±10.46µs 942.4±5.59µs -3.66%
query_block/query_block_in(1000)_times(1000) 9.8±0.05ms 9.4±0.09ms -4.08%
query_block/query_block_in(1000)_times(10000) 98.2±0.72ms 94.1±1.25ms -4.18%
storage_transaction 1005.5±277.65µs 1008.5±277.86µs +0.30%
vm/transaction_execution/1 312.7±0.43ms 336.2±0.57ms +7.52%
vm/transaction_execution/10 99.6±0.41ms 105.1±0.23ms +5.52%
vm/transaction_execution/20 93.1±0.77ms 97.6±0.62ms +4.83%
vm/transaction_execution/5 120.8±0.14ms 128.5±0.32ms +6.37%
vm/transaction_execution/50 108.0±0.40ms 112.4±0.30ms +4.07%

pub fn from_v5_to_v4(m: &CompiledModule) -> Result<Vec<u8>> {
anyhow::ensure!(m.version() == VERSION_5, "bytecode version is not v5");
let mut bytes = vec![];
m.serialize_for_version(Some(VERSION_4), &mut bytes)?;
Copy link
Member

Choose a reason for hiding this comment

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

应该需要过滤掉一部分 v4 不支持的 bytecode

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

应该需要过滤掉一部分 v4 不支持的 bytecode

从这注释看 是没有新添加bytecode,只有metadata(这部分怎么处理我还没有搞清楚)
https://github.com/starcoinorg/move/blob/dev/language/move-binary-format/src/file_format_common.rs#L382-#L385

/// Version 5: changes compared with version 4
///  +/- script and public(script) verification is now adapter specific
///  + metadata

https://github.com/starcoinorg/move/blob/dev/language/move-binary-format/src/file_format_common.rs#L390-#L392

// Mark which oldest version is supported.
// TODO(#145): finish v4 compatibility; as of now, only metadata is implemented
pub const VERSION_MIN: u32 = VERSION_5;

Copy link
Member

Choose a reason for hiding this comment

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

那可以试试看

@jolestar jolestar mentioned this pull request Dec 12, 2022
7 tasks
@nkysg nkysg force-pushed the dev_gas_meter branch 2 times, most recently from 6f17ecc to 95299df Compare December 26, 2022 14:38
@github-actions
Copy link

Benchmark for 82bccb5

Click to view benchmark
Test Base PR %
accumulator_append 603.7±30.69µs 607.0±28.69µs +0.55%
block_apply/block_apply_10 264.2±0.98ms 264.5±1.08ms +0.11%
block_apply/block_apply_1000 27.2±0.02s 27.2±0.03s 0.00%
get_with_proof/db_store 36.6±0.37µs 36.6±0.38µs 0.00%
get_with_proof/mem_store 31.5±0.22µs 31.6±0.38µs +0.32%
put_and_commit/db_store/1 95.9±4.73µs 95.7±4.94µs -0.21%
put_and_commit/db_store/10 857.5±40.04µs 862.1±38.40µs +0.54%
put_and_commit/db_store/100 7.3±0.28ms 7.3±0.28ms 0.00%
put_and_commit/db_store/5 441.4±22.47µs 441.6±21.70µs +0.05%
put_and_commit/db_store/50 3.8±0.16ms 3.8±0.17ms 0.00%
put_and_commit/mem_store/1 61.7±5.68µs 61.6±5.64µs -0.16%
put_and_commit/mem_store/10 581.4±48.08µs 580.9±49.24µs -0.09%
put_and_commit/mem_store/100 5.7±0.85ms 5.7±0.82ms 0.00%
put_and_commit/mem_store/5 293.7±25.58µs 290.8±24.43µs -0.99%
put_and_commit/mem_store/50 2.9±0.19ms 2.9±0.19ms 0.00%
query_block/query_block_in(10)_times(100) 4.0±0.18ms 3.9±0.11ms -2.50%
query_block/query_block_in(10)_times(1000) 40.2±1.18ms 40.0±0.72ms -0.50%
query_block/query_block_in(10)_times(10000) 400.7±8.69ms 398.0±8.10ms -0.67%
query_block/query_block_in(1000)_times(100) 984.6±13.19µs 977.9±4.85µs -0.68%
query_block/query_block_in(1000)_times(1000) 9.8±0.13ms 9.7±0.09ms -1.02%
query_block/query_block_in(1000)_times(10000) 98.1±0.51ms 96.7±0.70ms -1.43%
storage_transaction 999.4±287.60µs 989.2±276.19µs -1.02%
vm/transaction_execution/1 313.0±0.82ms 311.8±0.54ms -0.38%
vm/transaction_execution/10 99.5±0.16ms 98.6±0.51ms -0.90%
vm/transaction_execution/20 93.0±0.26ms 92.2±0.54ms -0.86%
vm/transaction_execution/5 121.2±0.32ms 120.7±2.30ms -0.41%
vm/transaction_execution/50 107.9±0.38ms 107.6±1.67ms -0.28%

@github-actions
Copy link

Benchmark for d6164dd

Click to view benchmark
Test Base PR %
accumulator_append 599.6±28.30µs 604.1±28.32µs +0.75%
block_apply/block_apply_10 263.6±0.27ms 263.5±0.86ms -0.04%
block_apply/block_apply_1000 27.2±0.13s 27.1±0.04s -0.37%
get_with_proof/db_store 37.0±0.51µs 36.3±0.28µs -1.89%
get_with_proof/mem_store 31.9±0.19µs 31.3±0.14µs -1.88%
put_and_commit/db_store/1 95.9±4.46µs 96.3±4.81µs +0.42%
put_and_commit/db_store/10 854.2±39.15µs 858.2±39.11µs +0.47%
put_and_commit/db_store/100 7.3±0.29ms 7.4±0.30ms +1.37%
put_and_commit/db_store/5 441.5±22.11µs 445.5±23.06µs +0.91%
put_and_commit/db_store/50 3.9±0.16ms 3.8±0.16ms -2.56%
put_and_commit/mem_store/1 61.7±5.60µs 62.5±5.58µs +1.30%
put_and_commit/mem_store/10 576.9±46.81µs 584.7±48.54µs +1.35%
put_and_commit/mem_store/100 5.7±0.83ms 5.7±0.82ms 0.00%
put_and_commit/mem_store/5 291.2±24.92µs 297.0±25.35µs +1.99%
put_and_commit/mem_store/50 2.8±0.18ms 2.9±0.18ms +3.57%
query_block/query_block_in(10)_times(100) 4.0±0.13ms 4.0±0.15ms 0.00%
query_block/query_block_in(10)_times(1000) 40.5±0.63ms 38.9±0.94ms -3.95%
query_block/query_block_in(10)_times(10000) 404.3±8.25ms 393.9±5.88ms -2.57%
query_block/query_block_in(1000)_times(100) 971.0±7.82µs 966.1±15.05µs -0.50%
query_block/query_block_in(1000)_times(1000) 9.7±0.07ms 9.5±0.07ms -2.06%
query_block/query_block_in(1000)_times(10000) 96.9±0.69ms 95.3±0.76ms -1.65%
storage_transaction 1003.4±309.14µs 984.9±276.58µs -1.84%
vm/transaction_execution/1 310.4±0.24ms 307.4±0.76ms -0.97%
vm/transaction_execution/10 98.7±0.16ms 97.1±0.35ms -1.62%
vm/transaction_execution/20 92.4±0.20ms 90.7±0.29ms -1.84%
vm/transaction_execution/5 120.1±0.22ms 118.3±0.21ms -1.50%
vm/transaction_execution/50 107.6±0.46ms 105.5±0.21ms -1.95%

@nkysg nkysg merged commit e7df159 into dev Jan 8, 2023
@nkysg nkysg deleted the dev_gas_meter branch January 8, 2023 04:05
nkysg added a commit that referenced this pull request Jan 31, 2023
gas_schedule: change max gas unit of test env to 400_000_000

[dev branch] move update use new  gas meter imp (#3795)

* use GasParameter replace costTable

* compat GasCost and GasConstants

* ErrorContext change to ErrorDescription

* update GasConstants member function

* ErrorContext change to ErrorDescription

* update move TableHandle def

* 1.refactor gas-algebra-ext
2.add gas_params for starcoin_vm

* 1.fix mpm code
2.fix TableHandle code

* 1.fix mpm code

2.fix TableHandle code

* fix NativeGasParams

* 1.add move stdlib nursery GasParam

* update starcoin_natives gas_params

* update VmConfig to gas_params

* fix GasParams names

* add vmconfig to gas_schedule test

* add gas meter calc function

* remove debug info

* fix simple_instruction

* fix complex instr and gas_meter

* fix gas_meter related charge implement

* update starcoin_vm get gas_params

* temp remove table_info column

* fix charge_move_to and charge_borrow_global

* add debug info for gas_meter

* fix vector append remove reverse

* fix sha2_256 sha3_256 native_function cal zero str

* update starcoin-framework

* fix gas-algebra config

* add test stdlib precompiled

* fix test_init_script and test_signer_cap_internal_type_error

* update move_stdlib params

* Package transaction publish bundle logic

* Update move dep for fixing transactional test harness

* comment StarcoinFramework checkpoint

* compatible legacy AccountDataCache

* Fix task help

* move bytecode v6

* update starcoin-framework

Co-authored-by: jolestar <[email protected]>
Co-authored-by: fikgol <[email protected]>
Co-authored-by: WGB5445 <[email protected]>
nkysg added a commit that referenced this pull request Jan 31, 2023
fix harness test

gas_schedule: change max gas unit of test env to 400_000_000

[dev branch] move update use new  gas meter imp (#3795)

* use GasParameter replace costTable

* compat GasCost and GasConstants

* ErrorContext change to ErrorDescription

* update GasConstants member function

* ErrorContext change to ErrorDescription

* update move TableHandle def

* 1.refactor gas-algebra-ext
2.add gas_params for starcoin_vm

* 1.add move stdlib nursery GasParam

* update starcoin_natives gas_params

* update VmConfig to gas_params

* add vmconfig to gas_schedule test

* add gas meter calc function

* update starcoin_vm get gas_params

* temp remove table_info column

* add debug info for gas_meter

* update starcoin-framework

* add test stdlib precompiled

* update move_stdlib params

* Package transaction publish bundle logic

* Update move dep for fixing transactional test harness

* comment StarcoinFramework checkpoint

* compatible legacy AccountDataCache

* move bytecode v6

* update starcoin-framework

Co-authored-by: jolestar <[email protected]>
Co-authored-by: fikgol <[email protected]>
Co-authored-by: WGB5445 <[email protected]>
@nkysg nkysg restored the dev_gas_meter branch February 6, 2023 15:27
nkysg added a commit that referenced this pull request Feb 10, 2023
* [compiler] update move
[compiler] Upgrade Move and fix compiler error
[clippy] Fix clippy error

* Merge branch 'master' into update_move

* gen new stdlib

* fix warning: add phantom for merkle distributor

* update move version
fix merkle tree test

* fix Identifier merge

* Update module_upgrade_test.rs

* update script
update move

* check commit

* 1.add table native functions
2.gen new stdlib
3.add table native function gas cost in vmconfig

* 1.add StateKey,MoveExt, SessionId,MoveResolveExt
2.add session finish_with_extension
3.change WriteSet , TransactionOutput, StateKeyView

* add contract_api.json

* 1.add halley genesis

* gen new stdlib

* Merge branch 'master' into update_move

* add move table extension flush

* add statedb support move table extension with commit and flush

* add table item test code

* fix  warnings

* update move repo

* fix fmt

* reset proxima

* add proxima genesis_config.json

* branch update_move add docker build

* add table_info storage

* update starcoin-framework repo

* fix clippy warnings

* gen new stdlib, reset proxima genesis

* add TableItemProof

* add TableItemProof

* fmt Cargo.toml

* add TableItemProof unit_test

* change StateKeyView serde Field attributes

* [Feature]Add string module (#3626)

* add string

* fix string

* add string in stdlib

* new stdlib

* Fix String module native

* Fix cargo move

* add pr build_test

* fix execute script (#3705)

* add config

* fix run script

* fix mpm package table test (#3715)

* [dev branch]table extension compatible dry run (#3706)

* change dry_out return value

* reset proxima

* close #3732

* mpm: remove tmp code

* [dev]Update docker_build.yml docker/setup-buildx-action to 2,  Dockerfile rustup version to 1.25.1 (#3771)

* Update docker_build.yml

* Update Dockerfile

* [dev] remove starcoin-x package,update script and config (#3772)

* [dev] remove starcoin-x package

* remove in toml

* update mold flag

* remove starcoin-x alias

* add back test scripts

* fix powershell

* use BAD_TRANSACTION_FEE_CURRENCY for test

gas_schedule: change max gas unit of test env to 400_000_000

[dev branch] move update use new  gas meter imp (#3795)

* use GasParameter replace costTable

* compat GasCost and GasConstants

* ErrorContext change to ErrorDescription

* update GasConstants member function

* ErrorContext change to ErrorDescription

* update move TableHandle def

* 1.refactor gas-algebra-ext
2.add gas_params for starcoin_vm

* 1.add move stdlib nursery GasParam

* update starcoin_natives gas_params

* update VmConfig to gas_params

* add vmconfig to gas_schedule test

* add gas meter calc function

* update starcoin_vm get gas_params

* temp remove table_info column

* update starcoin-framework

* add test stdlib precompiled

* update move_stdlib params

* Package transaction publish bundle logic

* Update move dep for fixing transactional test harness

* comment StarcoinFramework checkpoint

* compatible legacy AccountDataCache

* move bytecode v6

* update starcoin-framework

Co-authored-by: jolestar <[email protected]>
Co-authored-by: fikgol <[email protected]>
Co-authored-by: WGB5445 <[email protected]>

* abi support u16, u32, u256

* update rpc schema

---------

Co-authored-by: LemonHX <[email protected]>
Co-authored-by: WGB5445 <[email protected]>
Co-authored-by: caojiafeng <[email protected]>
Co-authored-by: jiangying <[email protected]>
Co-authored-by: jolestar <[email protected]>
Co-authored-by: fikgol <[email protected]>
@nkysg nkysg deleted the dev_gas_meter branch August 7, 2024 00:58
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.

4 participants