Run ./scripts/run-standalone.sh after compiling the node.
Wait for a few sessions (the more you wait the more garbage we create):
Shutdown all nodes (ctrl+c)
You will notice a lot of dkg_gadget::async_protocols: AsyncProtocolParameters(N)'s handler is going to be dropped where N is the number of sessions.
Log output
Log Output
```Paste log output here
2022-11-11 09:36:48.986 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.986 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 INFO tokio-runtime-worker dkg_gadget::async_protocols::remote: Shutting down meta handler: drop code
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped
```
Expected behaviour
No memory leak happens and we clean up unused resources as soon as we do not need them anymore.
Screenshots
Environment (please complete the following information):
Describe the bug Looks like we do forget to clean up the already completed/stalled/terminated signing rounds inside the
signing_rounds
list, which result in that these references are held for the duration of the runtime, or until we override them. https://github.com/webb-tools/dkg-substrate/blob/0d86b54f57a38881ef0e555ec757b5324e5c8ca7/dkg-gadget/src/worker.rs#L137-L138 For a background about that bug, currently thesigning_rounds
list is capped at https://github.com/webb-tools/dkg-substrate/blob/0d86b54f57a38881ef0e555ec757b5324e5c8ca7/dkg-gadget/src/worker.rs#L94And as per the recent changes we did, we do not allowing overwriting exciting rounds if it is still active: https://github.com/webb-tools/dkg-substrate/blob/0d86b54f57a38881ef0e555ec757b5324e5c8ca7/dkg-gadget/src/worker.rs#L368-L386
To Reproduce Steps to reproduce the behavior:
./scripts/run-standalone.sh
after compiling the node.dkg_gadget::async_protocols: AsyncProtocolParameters(N)'s handler is going to be dropped
whereN
is the number of sessions.Log output
Log Output
```Paste log output here 2022-11-11 09:36:48.986 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.986 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 INFO tokio-runtime-worker dkg_gadget::async_protocols::remote: Shutting down meta handler: drop code 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped 2022-11-11 09:36:48.987 DEBUG tokio-runtime-worker dkg_gadget::async_protocols: AsyncProtocolParameters(13)'s handler is going to be dropped ```Expected behaviour
No memory leak happens and we clean up unused resources as soon as we do not need them anymore.
Screenshots
Environment (please complete the following information):
rustc --version
)Other information and links