Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trending active_transactions difficulty for an average #1858

Merged
merged 12 commits into from Mar 30, 2019

Conversation

@argakiig
Copy link
Collaborator

commented Mar 25, 2019

Provide active_transactions.active_difficulty for 5 min trended avg of adjusted_difficulty in active_transactions
alternative to #1725

argakiig added some commits Mar 25, 2019

difficulty polled into a circular buffer
active_difficulty stored as atomic instead of function call
@argakiig

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 25, 2019

This is part of #1336

argakiig added a commit to argakiig/raiblocks that referenced this pull request Mar 25, 2019

recalculate work for long unconfirmed local blocks
using a difficulty threshold of the long unconfirmed block
nanocurrency#1858 allows for recalculating with a threshold of active_difficulty instead
Show resolved Hide resolved nano/core_test/node.cpp Outdated
Show resolved Hide resolved nano/node/node.cpp Outdated
Show resolved Hide resolved nano/node/node.cpp Outdated
Show resolved Hide resolved nano/node/node.cpp Outdated
Show resolved Hide resolved nano/node/node.cpp Outdated
Show resolved Hide resolved nano/node/node.cpp Outdated
use qualified root
simplify roots avg calculation
initialize circular buffer with threshold
@clemahieu
Copy link
Collaborator

left a comment

Looks good after these changes.

Show resolved Hide resolved nano/node/node.cpp
Show resolved Hide resolved nano/node/node.cpp Outdated
Show resolved Hide resolved nano/core_test/node.cpp Outdated
Show resolved Hide resolved nano/core_test/node.cpp Outdated

@zhyatt zhyatt added this to CP2 (2019-03-27) in V19 Mar 25, 2019

Show resolved Hide resolved nano/node/node.hpp Outdated
Show resolved Hide resolved nano/node/node.cpp Outdated
Show resolved Hide resolved nano/node/node.hpp
Show resolved Hide resolved nano/core_test/node.cpp Outdated

argakiig added some commits Mar 26, 2019

remove deadline and system poll
init active_difficulty and difficulty_cb
use std::accumulate
rework test for active_difficulty polling
cleanup and assert if not threshold

@argakiig argakiig requested review from cryptocode, wezrule and clemahieu and removed request for wezrule Mar 26, 2019

@cryptocode
Copy link
Collaborator

left a comment

LGTM

@zhyatt zhyatt moved this from CP2 (2019-03-27) to CP3 (2019-04-10) in V19 Mar 28, 2019

@argakiig argakiig merged commit dd46609 into nanocurrency:master Mar 30, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

guilhermelawless added a commit to guilhermelawless/nano-node that referenced this pull request Apr 15, 2019

Trending active_transactions difficulty for an average (nanocurrency#…
…1858)

* difficulty polled into a circular buffer
active_difficulty stored as atomic instead of function call

* Adjust for 5 min trend

* rpc to expose active_difficulty

* use qualified root
simplify roots avg calculation
initialize circular buffer with threshold

* remove deadline and system poll
init active_difficulty and difficulty_cb
use std::accumulate
rework test for active_difficulty polling
cleanup and assert if not threshold

* missed usage of accumulate

* use nano::uint128_t when applicable

* merge cleanup

* correct initialization order.

@zhyatt zhyatt added the major label Apr 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.