## PR 16704 Caqti lib upgrade Upgrading Caqti library from 1.5.0 to 2.1.0. Version 2.X.X contains session management optimization which is fixing memory leak in caqti lib. Mentioned leak manifest itself in sudden and quite big memory increase for postgres database. After implementing the change we noticed 50% drop in memory consumption. Another observation is that memory increase is not so steep. ### How it is tested: Currently All known rosetta tests are automated in CI: - unit tests: buildkite/scripts/unit-test.sh dev src/app/rosetta - indexer unit tests: https://github.com/MinaProtocol/mina/blob/compatible/buildkite/scripts/rosetta-indexer-test.sh - api tests: https://github.com/MinaProtocol/mina/tree/compatible/src/app/rosetta/test-curl - integration tests (using rosetta-cli): https://github.com/MinaProtocol/mina/blob/compatible/buildkite/scripts/tests/rosetta-integration-tests.sh - connectivity tests (devnet,mainnet): https://github.com/MinaProtocol/mina/blob/compatible/scripts/tests/rosetta-connectivity.sh - e2e command sanity tests: https://github.com/MinaProtocol/mina/blob/compatible/scripts/tests/rosetta-sanity.sh We added load test to measure memory gain: - load test: https://github.com/MinaProtocol/mina/blob/compatible/scripts/tests/rosetta-load.sh We added new test coverage as well for archive node: - bootstrap test: https://github.com/MinaProtocol/mina/blob/compatible/src/test/archive/archive_node_tests/load_genesis_ledger.ml - precomputed send tests: https://github.com/MinaProtocol/mina/blob/compatible/src/test/archive/archive_node_tests/archive_precomputed_blocks_test.ml ### Performance improvements metrics Archive bootstrap test is used as a load test since it try to insert mainnet ledger to archive db in one go. Rosetta load test fires steady load and measure postgres memory Running load tests on orchestrator env using rosetta & archive is now possible, thanks to caqti upgrade. Before archive couldn't bootstrap with such big genesis ledger
| Test | Before fix | After fix | Comment |
| Rosetta Load test | PostgreSQL Usage : 3323.45 MiB | PostgreSQL Usage: 2074.36 MiB | Single node tests (rosetta, daemon, archive ) Average TPS: 3.08, 📊 Total Requests: 1850 |
| Bootstrap test | PostgreSQL Usage: above 4GiB (assertion failed) | PostgreSQL Usage: 2062 MiB | Single archive node test with bootstrapping from mainnet genesis ledger |