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

[stdlib] Try implement stackable nft #2825

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

jolestar
Copy link
Member

@jolestar jolestar commented Aug 25, 2021

尝试实现了一个可堆叠的 NFT,但遇到几个问题:

  1. split 实际上是讲原来的 NFT 中的 quantity 减少,新铸造一个 NFT,会生成新的 id。可堆叠场景下,NFT 的 id 是否应该因为堆叠或者拆分而变化?
  2. split 的时候需要 UpdateCapability,和 MintCapability,merge 的时候需要 BurnCapability, UpdateCapability。这样无法实现自动堆叠。

@jolestar jolestar marked this pull request as draft August 25, 2021 11:31
@github-actions
Copy link

Benchmark for 589751e

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 2.1±0.11ms 2.1±0.07ms 0.00%
block_apply/block_apply_10 411.3±3.76ms 408.7±3.78ms +0.64%
block_apply/block_apply_1000 42.0±0.41s 41.9±0.10s +0.24%
get_with_proof/db_store 38.5±0.27µs 38.7±0.43µs -0.52%
get_with_proof/mem_store 31.7±0.30µs 31.7±0.19µs 0.00%
put_and_commit/db_store/1 1169.5±45.41µs 1201.2±60.69µs -2.64%
put_and_commit/db_store/10 2.2±0.33ms 2.3±0.35ms -4.35%
put_and_commit/db_store/100 9.6±0.88ms 9.7±0.88ms -1.03%
put_and_commit/db_store/5 1704.0±225.23µs 1900.8±165.30µs -10.35%
put_and_commit/db_store/50 5.7±0.68ms 5.7±0.71ms 0.00%
put_and_commit/mem_store/1 63.5±5.57µs 63.3±5.60µs +0.32%
put_and_commit/mem_store/10 586.2±46.95µs 588.7±45.49µs -0.42%
put_and_commit/mem_store/100 5.7±0.81ms 5.8±0.84ms -1.72%
put_and_commit/mem_store/5 297.0±23.99µs 299.3±23.87µs -0.77%
put_and_commit/mem_store/50 2.9±0.18ms 2.9±0.19ms 0.00%
query_block/query_block_in(10)_times(100) 3.5±0.09ms 3.5±0.17ms 0.00%
query_block/query_block_in(10)_times(1000) 34.9±1.08ms 35.7±0.94ms -2.24%
query_block/query_block_in(10)_times(10000) 354.8±4.29ms 350.8±3.95ms +1.14%
query_block/query_block_in(1000)_times(100) 928.1±7.15µs 918.8±6.27µs +1.01%
query_block/query_block_in(1000)_times(1000) 9.3±0.04ms 9.1±0.07ms +2.20%
query_block/query_block_in(1000)_times(10000) 92.9±0.50ms 92.3±0.62ms +0.65%
storage_transaction 43.3±3.20ms 41.5±2.48ms +4.34%
vm/transaction_execution/1 349.9±0.57ms 350.2±1.04ms -0.09%
vm/transaction_execution/10 124.3±1.76ms 124.3±2.23ms 0.00%
vm/transaction_execution/20 116.9±1.26ms 119.4±7.39ms -2.09%
vm/transaction_execution/5 146.6±0.57ms 147.5±3.09ms -0.61%
vm/transaction_execution/50 131.2±1.09ms 131.3±0.94ms -0.08%

@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #2825 (429957f) into master (bca1183) will increase coverage by 0.18%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2825      +/-   ##
==========================================
+ Coverage   31.44%   31.62%   +0.18%     
==========================================
  Files         510      510              
  Lines       44980    44980              
  Branches    20038    20038              
==========================================
+ Hits        14141    14221      +80     
+ Misses      17146    16958     -188     
- Partials    13693    13801     +108     
Flag Coverage Δ
unittests 31.62% <ø> (+0.18%) ⬆️

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

Impacted Files Coverage Δ
commons/timeout-join-handler/src/lib.rs 40.43% <0.00%> (-2.12%) ⬇️
...ync/src/block_connector/block_connector_service.rs 31.12% <0.00%> (-1.11%) ⬇️
block-relayer/src/block_relayer.rs 25.61% <0.00%> (-0.60%) ⬇️
commons/service-registry/src/service_registry.rs 42.06% <0.00%> (-0.58%) ⬇️
executor/src/script_function_test.rs 8.14% <0.00%> (ø)
miner/src/create_block_template/mod.rs 42.39% <0.00%> (ø)
commons/service-registry/src/service_actor.rs 38.71% <0.00%> (ø)
vm/vm-runtime/src/starcoin_vm.rs 29.29% <0.00%> (+0.14%) ⬆️
...etwork-p2p/src/protocol/generic_proto/behaviour.rs 20.74% <0.00%> (+0.27%) ⬆️
rpc/client/src/lib.rs 12.60% <0.00%> (+0.41%) ⬆️
... and 13 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 bca1183...429957f. Read the comment docs.

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.

1 participant