allora-network / allora-chain

Node software to run the Allora Network
https://www.allora.network/
Apache License 2.0
73 stars 67 forks source link

Collections.go Iterators need to be manually closed #451

Closed relyt29 closed 1 month ago

relyt29 commented 1 month ago

What is the purpose of the change

The collections.go cosmos-sdk library provides a manual iteration function for iterating over all the keys of a collection. However the iterator must be manually closed by the caller.

I suspect this probably would cause memory leaks if we didn't fix this issue, but deferring an iter.Close() call is trivial so we fix it here

Testing and Verifying

In terms of the existing code functionality, this change is covered by our existing unit and integration tests.

Documentation and Release Note

This PR has no implications for our documentation