From 4f844740bced43b5653d3152717f8b1e10b13293 Mon Sep 17 00:00:00 2001 From: cyan Date: Sun, 8 Sep 2024 17:52:09 +0200 Subject: [PATCH 1/5] use less memory for debugCallLength Map (#48) * use less memory for debugCallLength Map * ignore errors in default debug functions --- impls/monero.dart/lib/monero.dart | 34 ++++++++++++++++++++++++------ impls/monero.dart/lib/wownero.dart | 34 ++++++++++++++++++++++++------ 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/impls/monero.dart/lib/monero.dart b/impls/monero.dart/lib/monero.dart index 997f1b61..4fcc9709 100644 --- a/impls/monero.dart/lib/monero.dart +++ b/impls/monero.dart/lib/monero.dart @@ -101,14 +101,36 @@ final Stopwatch sw = Stopwatch()..start(); bool printStarts = false; void Function(String call)? debugStart = (call) { - if (printStarts) print("MONERO: $call"); - debugCallLength[call] ??= []; - debugCallLength[call]!.add(sw.elapsedMicroseconds); + try { + if (printStarts) print("MONERO: $call"); + debugCallLength[call] ??= []; + debugCallLength[call]!.add(sw.elapsedMicroseconds); + } catch (e) {} }; +void debugChores() { + for (var key in debugCallLength.keys) { + if (debugCallLength[key]!.length > 1000000) { + final elm = + debugCallLength[key]!.reduce((value, element) => value + element); + debugCallLength[key]!.clear(); + debugCallLength["${key}_1M"] ??= []; + debugCallLength["${key}_1M"]!.add(elm); + } + } +} + +int debugCount = 0; + void Function(String call)? debugEnd = (call) { - final id = debugCallLength[call]!.length - 1; - debugCallLength[call]![id] = - sw.elapsedMicroseconds - debugCallLength[call]![id]; + try { + final id = debugCallLength[call]!.length - 1; + if (++debugCount > 1000000) { + debugCount = 0; + debugChores(); + } + debugCallLength[call]![id] = + sw.elapsedMicroseconds - debugCallLength[call]![id]; + } catch (e) {} }; void Function(String call, dynamic error)? errorHandler = (call, error) { print("$call: $error"); diff --git a/impls/monero.dart/lib/wownero.dart b/impls/monero.dart/lib/wownero.dart index e87488cc..d355005b 100644 --- a/impls/monero.dart/lib/wownero.dart +++ b/impls/monero.dart/lib/wownero.dart @@ -101,14 +101,36 @@ final Stopwatch sw = Stopwatch()..start(); bool printStarts = false; void Function(String call)? debugStart = (call) { - if (printStarts) print("MONERO: $call"); - debugCallLength[call] ??= []; - debugCallLength[call]!.add(sw.elapsedMicroseconds); + try { + if (printStarts) print("MONERO: $call"); + debugCallLength[call] ??= []; + debugCallLength[call]!.add(sw.elapsedMicroseconds); + } catch (e) {} }; +void debugChores() { + for (var key in debugCallLength.keys) { + if (debugCallLength[key]!.length > 1000000) { + final elm = + debugCallLength[key]!.reduce((value, element) => value + element); + debugCallLength[key]!.clear(); + debugCallLength["${key}_1M"] ??= []; + debugCallLength["${key}_1M"]!.add(elm); + } + } +} + +int debugCount = 0; + void Function(String call)? debugEnd = (call) { - final id = debugCallLength[call]!.length - 1; - debugCallLength[call]![id] = - sw.elapsedMicroseconds - debugCallLength[call]![id]; + try { + final id = debugCallLength[call]!.length - 1; + if (++debugCount > 1000000) { + debugCount = 0; + debugChores(); + } + debugCallLength[call]![id] = + sw.elapsedMicroseconds - debugCallLength[call]![id]; + } catch (e) {} }; void Function(String call, dynamic error)? errorHandler = (call, error) { print("$call: $error"); From 0868b9bc3c4a59ddc5bfff13462e8840cffb7084 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:57:39 +0000 Subject: [PATCH 2/5] chore(deps): update dependency ffigen to v14 --- impls/monero.dart/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impls/monero.dart/pubspec.yaml b/impls/monero.dart/pubspec.yaml index 4f48698c..d85d6009 100644 --- a/impls/monero.dart/pubspec.yaml +++ b/impls/monero.dart/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dev_dependencies: lints: ^4.0.0 test: ^1.24.0 - ffigen: ^13.0.0 \ No newline at end of file + ffigen: ^14.0.0 \ No newline at end of file From 9d9a83a735633f9c45d428137c8d7fc7bf6cf5f5 Mon Sep 17 00:00:00 2001 From: cyan Date: Mon, 9 Sep 2024 09:04:47 +0000 Subject: [PATCH 3/5] add missing secrets --- .github/workflows/full_check.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/full_check.yaml b/.github/workflows/full_check.yaml index 3c8dd88a..c2c460f2 100644 --- a/.github/workflows/full_check.yaml +++ b/.github/workflows/full_check.yaml @@ -621,6 +621,8 @@ jobs: echo "const nanoNowNodesApiKey = '';" >> cw_nano/lib/.secrets.g.dart echo "const tronGridApiKey = '';" >> cw_tron/lib/.secrets.g.dart echo "const tronNowNodesApiKey = '';" >> cw_tron/lib/.secrets.g.dart + echo "const stealthExBearerToken = '';" >> lib/.secrets.g.dart + echo "const stealthExAdditionalFeePercent = '';" >> lib/.secrets.g.dart - name: Rename app run: | From 51e4a30a34f74eb0ecc4dd167cddec4f60dcfe0f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:57:19 +0000 Subject: [PATCH 4/5] chore(deps): update external/libzmq digest to 64db7d2 --- external/libzmq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/libzmq b/external/libzmq index 0ed7a08c..64db7d28 160000 --- a/external/libzmq +++ b/external/libzmq @@ -1 +1 @@ -Subproject commit 0ed7a08cd946e0832ac4655b7a76c09ac221f63b +Subproject commit 64db7d28fea695132834f6d2c5949cfea2f22d01 From f90b1f57b1337671b145e53e95ff5c2ecf67224d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:55:11 +0000 Subject: [PATCH 5/5] chore(deps): update external/libexpat digest to 624da0f --- external/libexpat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/libexpat b/external/libexpat index ed4090af..624da0f5 160000 --- a/external/libexpat +++ b/external/libexpat @@ -1 +1 @@ -Subproject commit ed4090af841ebd8a7b2e367280407d74e748a7dd +Subproject commit 624da0f593bb8d7e146b9f42b06d8e6c80d032a3