status-go/signal
Alex Jbanca 43b2c3b7ce
perf(sqlCipher): Increase cipher page size to 8192 (#3591)
* perf(sqlCipher): Increase cipher page size to 8192

Increasing the cipher page size to 8192 requires DB re-encryption. The process is as follows:
//Login to v3 DB
PRAGMA key = 'key';
PRAGMA cipher_page_size = 1024"; // old Page size
PRAGMA cipher_hmac_algorithm = HMAC_SHA1";
PRAGMA cipher_kdf_algorithm = PBKDF2_HMAC_SHA1";
PRAGMA kdf_iter = kdfIterationsNumber";

//Create V4 DB with increased page size
ATTACH DATABASE 'newdb.db' AS newdb KEY 'key';
PRAGMA newdb.cipher_page_size = 8192; // new Page size
PRAGMA newdb.cipher_hmac_algorithm = HMAC_SHA1"; // same as in v3
PRAGMA newdb.cipher_kdf_algorithm = PBKDF2_HMAC_SHA1"; // same as in v3
PRAGMA newdb.kdf_iter = kdfIterationsNumber"; // same as in v3
SELECT sqlcipher_export('newdb');
DETACH DATABASE newdb;

//Login to V4 DB
...

Worth noting:
The DB migration will happen on the first successful login.
The new DB version will have a different name to be able to distinguish between different DB versions.Versions naming mirrors sqlcipher major version (naming conventions used by sqlcipher), meaning that we're migrating from V3 to V4 DB (even if we're not fully aligned with V4 standards). The DB is not migrated to the v4 standard `SHA512` due to performance reasons. Our custom `SHA1` implementation is fully optimised for perfomance.

* perf(sqlCipher): Fixing failing tests

Update the new DB file format in Delete account, Change password and Decrypt database flows

* perf(SQLCipher): Increase page size - send events to notify when the DB re-encryption starts/ends
2023-06-13 18:20:21 +03:00
..
doc.go rename status-react to status-mobile 2022-07-17 15:37:14 +02:00
events_community_archives.go feat: add signal indicating that history messages are being imported 2022-12-05 10:51:53 +01:00
events_db.go perf(sqlCipher): Increase cipher page size to 8192 (#3591) 2023-06-13 18:20:21 +03:00
events_discord_import.go feat: introduce discord import tool 2022-10-28 09:52:26 +02:00
events_discovery.go
events_messenger.go Added portManager debug logging 2022-10-26 10:26:59 +01:00
events_node.go
events_pairing.go Smoke test on API and signals 2022-09-09 13:24:56 +01:00
events_pn.go
events_shhext.go chore: remove unneeded success signal 2022-12-07 12:15:23 -04:00
events_sign.go
events_stats.go
events_subs.go
events_sync_from_waku.go feat: accounts improvements applied 2023-05-25 19:46:47 +02:00
events_wakuv2.go
events_wallet.go
ios.go Intrododuce `NodeConfig.TorrentConfig` and CLI flags 2022-03-21 12:59:09 +01:00
signals.c
signals.go synchronize display name (#2989) 2022-12-29 14:16:19 +08:00
signals_test.go