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

Update the crypto doc #1548

Merged
merged 10 commits into from
Apr 13, 2022
Merged

Update the crypto doc #1548

merged 10 commits into from
Apr 13, 2022

Conversation

tarakby
Copy link
Contributor

@tarakby tarakby commented Apr 1, 2022

Closes #1021

Description

April mainnet spork updates the Flow Virtual Machine (FVM) implementation and some cryptography features in it.
This PR updates the doc to match the new functionalities provided by Cadence and the FVM after the upcoming spork.
It also provides more details on how to generate signatures that Cadence/FVM consider valid.

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2022

Codecov Report

Merging #1548 (70a0314) into master (c63336c) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1548      +/-   ##
==========================================
- Coverage   74.69%   74.69%   -0.01%     
==========================================
  Files         289      289              
  Lines       55625    55625              
==========================================
- Hits        41549    41547       -2     
- Misses      12581    12583       +2     
  Partials     1495     1495              
Flag Coverage Δ
unittests 74.69% <ø> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
runtime/sema/crypto_algorithm_types.go 87.05% <ø> (ø)
runtime/interpreter/storage.go 71.42% <0.00%> (-1.37%) ⬇️

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 c63336c...70a0314. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Apr 1, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit c63336c
The command for i in {1..N}; do go test ./... -run=XXX -bench=. -shuffle=on; done was used.
Bench tests were run a total of 7 times on each branch.

Results

old.txtnew.txt
time/opdelta
RuntimeResourceDictionaryValues-213.4ms ± 6%13.1ms ± 3%~(p=0.128 n=7+7)
RuntimeFungibleTokenTransfer-21.12ms ±36%1.25ms ±29%~(p=0.318 n=7+7)
ParseDeploy/byte_array-220.3ms ± 9%19.9ms ± 7%~(p=0.259 n=7+7)
ParseDeploy/decode_hex-21.10ms ± 4%1.10ms ± 4%~(p=0.805 n=7+7)
ParseArray-212.0ms ± 2%12.2ms ± 8%~(p=0.731 n=6+7)
ParseFungibleToken-2173µs ± 7%177µs ±15%~(p=1.000 n=7+7)
ParseInfix-27.92µs ± 2%7.91µs ± 1%~(p=0.937 n=6+6)
QualifiedIdentifierCreation/One_level-22.19ns ± 7%2.23ns ± 7%~(p=0.517 n=7+7)
QualifiedIdentifierCreation/Three_levels-2131ns ± 5%129ns ± 1%~(p=0.778 n=7+7)
ContractInterfaceFungibleToken-237.8µs ± 6%38.8µs ± 8%~(p=0.274 n=7+7)
CheckContractInterfaceFungibleTokenConformance-2123µs ± 1%124µs ± 2%~(p=0.366 n=6+7)
NewInterpreter/new_interpreter-21.03µs ± 1%1.03µs ± 1%~(p=0.731 n=6+7)
NewInterpreter/new_sub-interpreter-22.15µs ± 8%2.11µs ± 7%~(p=0.535 n=7+7)
InterpretRecursionFib-22.68ms ± 4%2.65ms ± 4%~(p=0.456 n=7+7)
 
alloc/opdelta
RuntimeFungibleTokenTransfer-2273kB ± 0%273kB ± 0%+0.01%(p=0.004 n=5+6)
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=0.383 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
ContractInterfaceFungibleToken-226.6kB ± 0%26.6kB ± 0%~(p=0.070 n=7+7)
CheckContractInterfaceFungibleTokenConformance-266.2kB ± 0%66.2kB ± 0%~(all equal)
NewInterpreter/new_interpreter-2848B ± 0%848B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.34kB ± 0%1.34kB ± 0%~(all equal)
InterpretRecursionFib-21.26MB ± 0%1.26MB ± 0%~(p=0.319 n=7+7)
 
allocs/opdelta
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=0.301 n=7+7)
RuntimeFungibleTokenTransfer-24.54k ± 0%4.54k ± 0%~(p=0.767 n=7+7)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
ContractInterfaceFungibleToken-2458 ± 0%458 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
NewInterpreter/new_interpreter-213.0 ± 0%13.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-240.0 ± 0%40.0 ± 0%~(all equal)
InterpretRecursionFib-226.2k ± 0%26.2k ± 0%~(all equal)
 

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Looks good, just some small suggestions to keep wording consistent across the API

@tarakby tarakby requested a review from turbolent April 8, 2022 21:02
@tarakby
Copy link
Contributor Author

tarakby commented Apr 13, 2022

@turbolent I think I've addressed your comments, but please let me know if more changes are needed.

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Looks good, thank you for improving this! 👍

@turbolent turbolent added the Documentation Improvements or additions to documentation label Apr 13, 2022
@tarakby tarakby merged commit ff17650 into master Apr 13, 2022
@turbolent turbolent deleted the tarak/1021-crypto-doc branch April 13, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve cryptographic signatures doc
3 participants