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

fix: stop exposing wipe() and unload() since they are broken in Kotlin [WPB-14514] #786

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

typfel
Copy link
Member

@typfel typfel commented Nov 28, 2024

What's new in this PR

Stop exposing wipe() and unload()

Clients should instead call close() which will close the database connection, it's then safe to delete the core crypto database.


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@typfel typfel requested a review from a team as a code owner November 28, 2024 14:01
@echoes-hq echoes-hq bot added the echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. label Nov 28, 2024
@istankovic
Copy link
Member

Should we also remove related functions from the crypto crate?

Copy link

github-actions bot commented Nov 28, 2024

🐰 Bencher Report

Branchfix/wipe-method-WPB-14514
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
Commit add f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
18,503,000.00
Commit add f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,694,900.00
Commit add f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
9,131,700.00
Commit add f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
11,507,000.00
Commit add f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
14,616,000.00
Commit add f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
16,581,000.00
Commit add f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
983,380,000.00
Commit add f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
6,687,300.00
Commit add f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
84,069,000.00
Commit add f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
219,100,000.00
Commit add f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
425,650,000.00
Commit add f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
673,260,000.00
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
115,460,000.00
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
28,106,000.00
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
45,524,000.00
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
60,213,000.00
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
78,630,000.00
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
93,575,000.00
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
🚷 view threshold
18,344,000.00
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
🚷 view threshold
114,140,000.00
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
🚷 view threshold
35,189,000.00
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
🚷 view threshold
56,087,000.00
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
🚷 view threshold
75,053,000.00
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
🚷 view threshold
94,434,000.00
Commit remove f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
27,257,000.00
Commit remove f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,515,500.00
Commit remove f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
8,613,200.00
Commit remove f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
11,861,000.00
Commit remove f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
17,337,000.00
Commit remove f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
21,913,000.00
Commit remove f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
30,150,000.00
Commit remove f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
136,050,000.00
Commit remove f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
114,240,000.00
Commit remove f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
92,653,000.00
Commit remove f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
71,320,000.00
Commit remove f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
50,579,000.00
Commit update f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
135,670,000.00
Commit update f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,678,400.00
Commit update f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
32,914,000.00
Commit update f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
58,791,000.00
Commit update f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
85,482,000.00
Commit update f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
111,070,000.00
Count KeyPackage/cs1/mem/1002📈 view plot
🚷 view threshold
10,333,000.00
Count KeyPackage/cs1/mem/2📈 view plot
🚷 view threshold
6,345,900.00
Count KeyPackage/cs1/mem/202📈 view plot
🚷 view threshold
6,822,100.00
Count KeyPackage/cs1/mem/402📈 view plot
🚷 view threshold
7,544,400.00
Count KeyPackage/cs1/mem/602📈 view plot
🚷 view threshold
8,336,000.00
Count KeyPackage/cs1/mem/802📈 view plot
🚷 view threshold
9,042,700.00
Create group/cs1/mem📈 view plot
🚷 view threshold
6,527,800.00
Decrypt f(msg size)/cs1/mem/10📈 view plot
🚷 view threshold
6,160,700.00
Decrypt f(msg size)/cs1/mem/10010📈 view plot
🚷 view threshold
6,158,300.00
Decrypt f(msg size)/cs1/mem/2010📈 view plot
🚷 view threshold
6,082,700.00
Decrypt f(msg size)/cs1/mem/4010📈 view plot
🚷 view threshold
6,174,100.00
Decrypt f(msg size)/cs1/mem/6010📈 view plot
🚷 view threshold
6,120,600.00
Decrypt f(msg size)/cs1/mem/8010📈 view plot
🚷 view threshold
6,153,900.00
Encrypt f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
8,750,100.00
Encrypt f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,156,300.00
Encrypt f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
6,848,700.00
Encrypt f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
7,289,000.00
Encrypt f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
7,908,700.00
Encrypt f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
8,475,600.00
Encrypt f(msg size)/cs1/mem/10📈 view plot
🚷 view threshold
8,554,600.00
Encrypt f(msg size)/cs1/mem/10010📈 view plot
🚷 view threshold
8,455,000.00
Encrypt f(msg size)/cs1/mem/2010📈 view plot
🚷 view threshold
8,504,200.00
Encrypt f(msg size)/cs1/mem/4010📈 view plot
🚷 view threshold
8,792,100.00
Encrypt f(msg size)/cs1/mem/6010📈 view plot
🚷 view threshold
8,818,300.00
Encrypt f(msg size)/cs1/mem/8010📈 view plot
🚷 view threshold
8,547,200.00
Generate KeyPackage f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
245,320,000.00
Generate KeyPackage f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,467,500.00
Generate KeyPackage f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
33,219,000.00
Generate KeyPackage f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
86,007,000.00
Generate KeyPackage f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
139,030,000.00
Generate KeyPackage f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
191,740,000.00
Join from external commit f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
244,710,000.00
Join from external commit f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
7,550,200.00
Join from external commit f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
55,026,000.00
Join from external commit f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
102,640,000.00
Join from external commit f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
150,850,000.00
Join from external commit f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
197,910,000.00
Join from welcome f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
112,110,000.00
Join from welcome f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,936,000.00
Join from welcome f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
27,978,000.00
Join from welcome f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
48,844,000.00
Join from welcome f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
70,341,000.00
Join from welcome f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
91,053,000.00
Mls vs Proteus: add/MLS/mem/1📈 view plot
🚷 view threshold
6,746,100.00
Mls vs Proteus: add/MLS/mem/101📈 view plot
🚷 view threshold
8,043,500.00
Mls vs Proteus: add/MLS/mem/21📈 view plot
🚷 view threshold
7,013,300.00
Mls vs Proteus: add/MLS/mem/41📈 view plot
🚷 view threshold
7,268,300.00
Mls vs Proteus: add/MLS/mem/61📈 view plot
🚷 view threshold
7,434,700.00
Mls vs Proteus: add/MLS/mem/81📈 view plot
🚷 view threshold
7,765,300.00
Mls vs Proteus: add/Proteus/mem/1📈 view plot
🚷 view threshold
6,366,600.00
Mls vs Proteus: add/Proteus/mem/101📈 view plot
🚷 view threshold
44,687,000.00
Mls vs Proteus: add/Proteus/mem/21📈 view plot
🚷 view threshold
14,225,000.00
Mls vs Proteus: add/Proteus/mem/41📈 view plot
🚷 view threshold
21,637,000.00
Mls vs Proteus: add/Proteus/mem/61📈 view plot
🚷 view threshold
29,734,000.00
Mls vs Proteus: add/Proteus/mem/81📈 view plot
🚷 view threshold
36,785,000.00
Mls vs Proteus: encrypt/MLS/mem/1📈 view plot
🚷 view threshold
6,291,300.00
Mls vs Proteus: encrypt/MLS/mem/101📈 view plot
🚷 view threshold
6,677,600.00
Mls vs Proteus: encrypt/MLS/mem/21📈 view plot
🚷 view threshold
6,564,700.00
Mls vs Proteus: encrypt/MLS/mem/41📈 view plot
🚷 view threshold
6,438,400.00
Mls vs Proteus: encrypt/MLS/mem/61📈 view plot
🚷 view threshold
6,564,200.00
Mls vs Proteus: encrypt/MLS/mem/81📈 view plot
🚷 view threshold
6,502,200.00
Mls vs Proteus: encrypt/Proteus/mem/1📈 view plot
🚷 view threshold
6,143,600.00
Mls vs Proteus: encrypt/Proteus/mem/101📈 view plot
🚷 view threshold
15,777,000.00
Mls vs Proteus: encrypt/Proteus/mem/21📈 view plot
🚷 view threshold
8,296,100.00
Mls vs Proteus: encrypt/Proteus/mem/41📈 view plot
🚷 view threshold
10,226,000.00
Mls vs Proteus: encrypt/Proteus/mem/61📈 view plot
🚷 view threshold
12,094,000.00
Mls vs Proteus: encrypt/Proteus/mem/81📈 view plot
🚷 view threshold
14,179,000.00
Mls vs Proteus: remove/MLS/mem/1📈 view plot
🚷 view threshold
20,151,000.00
Mls vs Proteus: remove/MLS/mem/101📈 view plot
🚷 view threshold
7,995,400.00
Mls vs Proteus: remove/MLS/mem/21📈 view plot
🚷 view threshold
17,693,000.00
Mls vs Proteus: remove/MLS/mem/41📈 view plot
🚷 view threshold
15,290,000.00
Mls vs Proteus: remove/MLS/mem/61📈 view plot
🚷 view threshold
12,885,000.00
Mls vs Proteus: remove/MLS/mem/81📈 view plot
🚷 view threshold
10,462,000.00
Mls vs Proteus: remove/Proteus/mem/1📈 view plot
🚷 view threshold
6,193,200.00
Mls vs Proteus: remove/Proteus/mem/101📈 view plot
🚷 view threshold
7,054,200.00
Mls vs Proteus: remove/Proteus/mem/21📈 view plot
🚷 view threshold
6,344,200.00
Mls vs Proteus: remove/Proteus/mem/41📈 view plot
🚷 view threshold
6,563,200.00
Mls vs Proteus: remove/Proteus/mem/61📈 view plot
🚷 view threshold
6,848,200.00
Mls vs Proteus: remove/Proteus/mem/81📈 view plot
🚷 view threshold
6,790,100.00
Mls vs Proteus: update/MLS/mem/1📈 view plot
🚷 view threshold
6,808,600.00
Mls vs Proteus: update/MLS/mem/101📈 view plot
🚷 view threshold
20,089,000.00
Mls vs Proteus: update/MLS/mem/21📈 view plot
🚷 view threshold
9,717,200.00
Mls vs Proteus: update/MLS/mem/41📈 view plot
🚷 view threshold
12,267,000.00
Mls vs Proteus: update/MLS/mem/61📈 view plot
🚷 view threshold
14,900,000.00
Mls vs Proteus: update/MLS/mem/81📈 view plot
🚷 view threshold
17,514,000.00
Mls vs Proteus: update/Proteus/mem/1📈 view plot
🚷 view threshold
6,723,100.00
Mls vs Proteus: update/Proteus/mem/101📈 view plot
🚷 view threshold
45,985,000.00
Mls vs Proteus: update/Proteus/mem/21📈 view plot
🚷 view threshold
14,624,000.00
Mls vs Proteus: update/Proteus/mem/41📈 view plot
🚷 view threshold
22,620,000.00
Mls vs Proteus: update/Proteus/mem/61📈 view plot
🚷 view threshold
30,484,000.00
Mls vs Proteus: update/Proteus/mem/81📈 view plot
🚷 view threshold
37,957,000.00
🐰 View full continuous benchmarking report in Bencher

Copy link

github-actions bot commented Nov 29, 2024

🐰 Bencher Report

Branchfix/wipe-method-WPB-14514
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
Commit add f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
18,168,000.00
Commit add f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,698,700.00
Commit add f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
9,143,100.00
Commit add f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
11,731,000.00
Commit add f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
14,561,000.00
Commit add f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
16,454,000.00
Commit add f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
973,170,000.00
Commit add f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
6,714,700.00
Commit add f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
83,500,000.00
Commit add f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
217,370,000.00
Commit add f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
420,600,000.00
Commit add f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
667,450,000.00
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
115,390,000.00
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
28,091,000.00
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
45,568,000.00
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
61,771,000.00
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
78,440,000.00
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
93,508,000.00
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
🚷 view threshold
17,980,000.00
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
🚷 view threshold
114,230,000.00
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
🚷 view threshold
35,069,000.00
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
🚷 view threshold
58,786,000.00
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
🚷 view threshold
74,722,000.00
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
🚷 view threshold
94,000,000.00
Commit remove f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
26,281,000.00
Commit remove f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,551,700.00
Commit remove f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
8,714,600.00
Commit remove f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
11,402,000.00
Commit remove f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
16,811,000.00
Commit remove f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
21,239,000.00
Commit remove f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
29,262,000.00
Commit remove f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
135,980,000.00
Commit remove f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
114,420,000.00
Commit remove f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
92,741,000.00
Commit remove f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
73,268,000.00
Commit remove f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
49,854,000.00
Commit update f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
136,220,000.00
Commit update f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,739,100.00
Commit update f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
32,941,000.00
Commit update f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
59,166,000.00
Commit update f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
85,372,000.00
Commit update f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
110,720,000.00
🐰 View full continuous benchmarking report in Bencher

@typfel
Copy link
Member Author

typfel commented Nov 29, 2024

Should we also remove related functions from the crypto crate?

It's still used by the wasm implementation

@@ -33,15 +32,18 @@ pub(crate) struct CoreCryptoFfiClient {
prekey_last_id: u16,
}

const KEY_STORE_PATH: &str = "path";
const KEY_STORE_KEY: &str = "path";
Copy link
Contributor

Choose a reason for hiding this comment

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

This used to be "key" when it was in the CoreCrypto::new invocation as a literal.

@typfel typfel force-pushed the fix/wipe-method-WPB-14514 branch 2 times, most recently from 89da5a8 to ae872ca Compare December 3, 2024 16:00
@typfel typfel force-pushed the fix/wipe-method-WPB-14514 branch 3 times, most recently from fdcee17 to f672301 Compare December 3, 2024 16:27
…in [WPB-14514]

Clients should instead call close() which will close the  database connection,
it's then safe to delete the core crypto database.
Previously the interop tests never attempted to call the wipe() function which existed
for all interop clients, which means you could only run them once without manually
cleaning up the key stores.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants