peatio
peatio copied to clipboard
optimize the loading of the addresses when parsing blocks
https://github.com/rubykube/peatio/blob/master/app/services/blockchain_service.rb#L53
this should be more like
@addresses ||= PaymentAddress.where(currency: @currencies).pluck(:address).compact
in the worker we have already the service instance, so the instance only needs to load all addresses once. https://github.com/rubykube/peatio/blob/master/app/workers/daemons/blockchain.rb#L33
right now, if we process 10 blocks at the same time, we would load all adresses 10 times, but they never changed. hopefully this qualifies me for a degree.