New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delegate monitor : optimize getting delegates last block #214

merged 1 commit into from May 29, 2018


None yet
2 participants
Copy link

air1one commented May 29, 2018

In the algorithm to get the delegates last block (in activeDelegates function), we check first in the 100 latest blocks if we find it, if not we make a server request (so for each delegate who hasn't forged in the last 100 blocks) to get it.
And this, every time the timer refreshes.

In order to limit the amount of requests, we are here caching locally (sessionStorage) the delegates last blocks. So that when the timer refreshes, we are not requesting again a delegate's last block if we have it cached and if it is not necessary to refresh it.
Very useful right now in devnet 馃槈

Related to #195

@faustbrian faustbrian merged commit 026886a into ArkEcosystem:master May 29, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment