Open dpc opened 1 month ago
Can't look into it RN, might be immediately obvious to @douglaz .
Something very weird is happening here. Created https://github.com/fedimint/fedimint/pull/4925 to help.
Looks like more a bug somewhere than a flaky test.
Even better - a test catching a bug. :rocket: :)
Test: load_test_tool_test FM: current CLI: current GW: v0.2.1 CI failures: https://github.com/fedimint/fedimint/actions/runs/8727469044/job/23945038328
00:00:38 Error: Insufficient balance: requested 1024 msat but only 512 msat available
Copied from https://github.com/fedimint/fedimint/issues/5000
It seems that a transaction/reissue using 1024 msats became 512 msats. So we lost half of our sats. This really looks like a bug:
00:00:38 2024-04-17T19:25:15.352525Z INFO fedimint_load_test_tool: Got 1024 msat more notes, reissuing them
00:00:38 2024-04-17T19:25:16.117666Z INFO fedimint_load_test_tool: Note summary:
00:00:38 2024-04-17T19:25:16.120373Z INFO fedimint_load_test_tool: 1 msat: 2
00:00:38 2024-04-17T19:25:16.120382Z INFO fedimint_load_test_tool: 2 msat: 3
00:00:38 2024-04-17T19:25:16.120384Z INFO fedimint_load_test_tool: 4 msat: 2
00:00:38 2024-04-17T19:25:16.120386Z INFO fedimint_load_test_tool: 8 msat: 2
00:00:38 2024-04-17T19:25:16.120387Z INFO fedimint_load_test_tool: 16 msat: 2
00:00:38 2024-04-17T19:25:16.120389Z INFO fedimint_load_test_tool: 32 msat: 2
00:00:38 2024-04-17T19:25:16.120390Z INFO fedimint_load_test_tool: 64 msat: 2
00:00:38 2024-04-17T19:25:16.120392Z INFO fedimint_load_test_tool: 128 msat: 2
00:00:38 2024-04-17T19:25:16.120393Z INFO fedimint_load_test_tool: 256 msat: 2
00:00:38 2024-04-17T19:25:16.120403Z INFO fedimint_load_test_tool: Reminting 1 notes of denomination 1024 msat for 1 users, 1 notes per user (this may take a while if the number of users/notes is high)
00:00:38 2024-04-17T19:25:16.660180Z INFO fedimint_load_test_tool: Note summary:
00:00:38 2024-04-17T19:25:16.660558Z INFO fedimint_load_test_tool: 512 msat: 1
@elsirion any ideas here?
I added an assert in #5080 and I'm trying to repro in devimint-env
with:
retry-success.sh ./target-nix/debug/fedimint-load-test-tool load-test --generate-invoice-with ln-cli --invoices-per-user=1 --notes-per-user=1 --note-denomination=1
024
I hope I'm not completely confused.
Oh. I think this is in internal reminting of per-user internal client. Let's check it ...
Theory. There's a race and when:
mint_client
.await_output_finalized(operation_id, out_point)
.await?;
it doesn't mean that the notes are available in the database yet.
Edit: In the code it looks like notification is clearly sent after the state transition committed. Well, next thing to check is if something in parallel could be using the same internal client...
I also altered the command to:
retry-success.sh ./target-nix/debug/fedimint-load-test-tool --users 1 load-test --generate-invoice-with ln-cli --invoices-per-user=1 --notes-per-user=1 --note-deno
mination=1024
which seems to match what was happening in the failing case, but so far I was not able to trigger the issue, despite having an assertion there.
I'm quite sure this is the exact same underlying issue as in #5195 , which seems to be easier to repro.
https://github.com/fedimint/fedimint/actions/runs/8636342617/job/23676033584?pr=4916