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

support script function in rpc and cli #2312

Merged
merged 6 commits into from
Mar 23, 2021
Merged

support script function in rpc and cli #2312

merged 6 commits into from
Mar 23, 2021

Conversation

nanne007
Copy link
Member

  • dev api is removed.
  • transaction request support script function, and remove support for buildin script.
  • unify contract call structure.
  • cli is updated to use script function.

@nanne007 nanne007 requested review from guangyuz and jolestar and removed request for guangyuz and jolestar March 22, 2021 11:03
@github-actions
Copy link

Benchmark for a936ef1

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 1028.1±242.08µs 1015.0±67.89µs +1.29%
block_apply/block_apply_10 342.1±4.99ms 333.3±3.32ms +2.64%
block_apply/block_apply_1000 35.7±0.36s 35.8±0.24s -0.28%
get_with_proof/db_store 44.9±1.57µs 43.9±1.45µs +2.28%
get_with_proof/mem_store 34.3±0.76µs 34.0±0.94µs +0.88%
put_and_commit/db_store/1 391.9±51.89µs 404.3±43.43µs -3.07%
put_and_commit/db_store/10 1394.3±75.90µs 1416.5±69.81µs -1.57%
put_and_commit/db_store/100 9.5±0.46ms 9.1±0.48ms +4.40%
put_and_commit/db_store/5 906.2±590.16µs 848.1±85.39µs +6.85%
put_and_commit/db_store/50 5.1±0.26ms 5.1±0.27ms 0.00%
put_and_commit/mem_store/1 74.2±3.89µs 74.2±3.86µs 0.00%
put_and_commit/mem_store/10 669.5±36.81µs 665.9±35.51µs +0.54%
put_and_commit/mem_store/100 6.2±0.26ms 6.1±0.21ms +1.64%
put_and_commit/mem_store/5 340.8±16.85µs 339.6±19.64µs +0.35%
put_and_commit/mem_store/50 3.2±0.13ms 3.2±0.15ms 0.00%
query_block/query_block_in(10)_times(100) 3.2±0.05ms 3.3±0.12ms -3.03%
query_block/query_block_in(10)_times(1000) 31.9±0.74ms 33.2±0.73ms -3.92%
query_block/query_block_in(10)_times(10000) 324.0±6.32ms 327.8±7.37ms -1.16%
query_block/query_block_in(1000)_times(100) 1315.5±8.55µs 1341.0±15.85µs -1.90%
query_block/query_block_in(1000)_times(1000) 13.2±0.23ms 13.9±1.12ms -5.04%
query_block/query_block_in(1000)_times(10000) 130.3±1.25ms 135.1±1.38ms -3.55%
storage_transaction 9.5±0.46ms 9.4±0.27ms +1.06%
vm/transaction_execution/1 386.1±3.13ms 389.4±4.98ms -0.85%
vm/transaction_execution/10 127.5±6.93ms 127.7±5.28ms -0.16%
vm/transaction_execution/20 115.7±1.02ms 116.8±3.83ms -0.94%
vm/transaction_execution/5 153.8±7.73ms 150.6±0.91ms +2.12%
vm/transaction_execution/50 132.3±1.02ms 132.7±2.85ms -0.30%

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

/// builtin script name to execute
script_name: StdlibScript,
#[structopt(long = "function", name = "script-function")]
/// script function to execute, example: 0x1::TransferScripts::peer_to_peer
Copy link
Member

Choose a reason for hiding this comment

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

good api 👍

@github-actions
Copy link

Benchmark for 063dcb9

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 973.0±75.07µs 1026.2±107.54µs -5.18%
block_apply/block_apply_10 328.7±3.19ms 332.5±3.91ms -1.14%
block_apply/block_apply_1000 35.2±0.16s 35.3±0.16s -0.28%
get_with_proof/db_store 43.6±0.74µs 44.5±0.67µs -2.02%
get_with_proof/mem_store 33.1±0.77µs 33.4±0.62µs -0.90%
put_and_commit/db_store/1 367.7±36.07µs 378.9±68.29µs -2.96%
put_and_commit/db_store/10 1422.1±65.94µs 1391.4±174.45µs +2.21%
put_and_commit/db_store/100 9.1±0.53ms 9.6±2.27ms -5.21%
put_and_commit/db_store/5 836.4±87.53µs 841.4±73.57µs -0.59%
put_and_commit/db_store/50 5.1±1.30ms 5.1±0.30ms 0.00%
put_and_commit/mem_store/1 73.5±3.64µs 73.4±3.66µs +0.14%
put_and_commit/mem_store/10 653.7±33.15µs 655.6±32.57µs -0.29%
put_and_commit/mem_store/100 6.1±0.21ms 6.1±0.21ms 0.00%
put_and_commit/mem_store/5 337.2±17.46µs 331.2±17.54µs +1.81%
put_and_commit/mem_store/50 3.1±0.12ms 3.1±0.14ms 0.00%
query_block/query_block_in(10)_times(100) 3.2±0.06ms 3.2±0.07ms 0.00%
query_block/query_block_in(10)_times(1000) 33.3±1.03ms 32.6±0.35ms +2.15%
query_block/query_block_in(10)_times(10000) 328.5±5.38ms 324.6±4.02ms +1.20%
query_block/query_block_in(1000)_times(100) 1359.5±8.02µs 1346.8±37.54µs +0.94%
query_block/query_block_in(1000)_times(1000) 13.6±0.14ms 13.5±0.33ms +0.74%
query_block/query_block_in(1000)_times(10000) 132.9±1.42ms 134.2±0.75ms -0.97%
storage_transaction 8.8±0.17ms 9.5±0.26ms -7.37%
vm/transaction_execution/1 382.3±1.62ms 389.8±2.51ms -1.92%
vm/transaction_execution/10 123.7±0.94ms 125.4±1.36ms -1.36%
vm/transaction_execution/20 115.4±1.09ms 116.9±2.75ms -1.28%
vm/transaction_execution/5 152.2±8.48ms 152.7±3.02ms -0.33%
vm/transaction_execution/50 132.4±2.41ms 136.7±2.83ms -3.15%

@nanne007 nanne007 force-pushed the rpc/script-function branch from fcff033 to d8cb5c2 Compare March 23, 2021 00:20
@github-actions
Copy link

Benchmark for 20fa076

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 1259.5±76.13µs 1266.4±87.75µs -0.54%
block_apply/block_apply_10 375.9±26.96ms 371.9±2.05ms +1.08%
block_apply/block_apply_1000 38.9±0.09s 39.3±0.12s -1.02%
get_with_proof/db_store 43.3±0.74µs 44.6±2.62µs -2.91%
get_with_proof/mem_store 33.2±0.62µs 33.2±0.45µs 0.00%
put_and_commit/db_store/1 539.7±21.39µs 542.0±41.39µs -0.42%
put_and_commit/db_store/10 1693.7±153.84µs 1597.7±118.01µs +6.01%
put_and_commit/db_store/100 9.5±0.41ms 9.5±0.49ms 0.00%
put_and_commit/db_store/5 1027.3±87.49µs 1018.6±87.57µs +0.85%
put_and_commit/db_store/50 5.3±0.24ms 5.4±0.23ms -1.85%
put_and_commit/mem_store/1 74.0±5.10µs 73.3±3.71µs +0.95%
put_and_commit/mem_store/10 647.1±40.74µs 652.7±42.70µs -0.86%
put_and_commit/mem_store/100 6.1±0.22ms 6.0±0.20ms +1.67%
put_and_commit/mem_store/5 331.0±16.90µs 331.4±16.51µs -0.12%
put_and_commit/mem_store/50 3.1±0.13ms 3.1±0.12ms 0.00%
query_block/query_block_in(10)_times(100) 3.2±0.06ms 3.2±0.08ms 0.00%
query_block/query_block_in(10)_times(1000) 31.8±0.97ms 32.5±0.55ms -2.15%
query_block/query_block_in(10)_times(10000) 320.0±6.72ms 325.0±6.02ms -1.54%
query_block/query_block_in(1000)_times(100) 1329.7±6.47µs 1359.0±13.49µs -2.16%
query_block/query_block_in(1000)_times(1000) 13.3±0.09ms 13.5±0.16ms -1.48%
query_block/query_block_in(1000)_times(10000) 132.8±0.95ms 135.3±0.50ms -1.85%
storage_transaction 12.7±0.54ms 13.3±0.64ms -4.51%
vm/transaction_execution/1 381.5±1.45ms 380.9±1.70ms +0.16%
vm/transaction_execution/10 123.0±0.42ms 124.0±1.19ms -0.81%
vm/transaction_execution/20 114.1±0.38ms 114.7±0.72ms -0.52%
vm/transaction_execution/5 149.3±0.63ms 149.3±0.46ms 0.00%
vm/transaction_execution/50 130.5±0.38ms 131.5±1.30ms -0.76%

@jolestar jolestar merged commit 48d3173 into master Mar 23, 2021
@jolestar jolestar deleted the rpc/script-function branch March 23, 2021 01:57
naughtyvenom pushed a commit to naughtyvenom/starcoin that referenced this pull request Jul 19, 2021
* rpc: remove dev api

* rpc: support script function

* cli: update impl to support script function
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