keep-network / keep-core

The smart contracts and reference client behind the Keep network
https://keep.network
MIT License
113 stars 72 forks source link

Cache swept deposits #3811

Closed lukasz-zimnoch closed 2 months ago

lukasz-zimnoch commented 2 months ago

The current logic always fetches swept deposits from the chain using Ethereum RPC server. This can be optimized. Swept deposits are final and no further changes occur regarding their state. That means swept deposits can be cached. This allows reducing network load and speeding up processed that needs to check a large number of deposits (e.g. deposit sweep and moving funds proposal generators). We use a time cache to evict unused keys over time and optimize memory consumption.