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

Difficulty history #155

Merged
merged 5 commits into from Jun 14, 2019
Merged

Difficulty history #155

merged 5 commits into from Jun 14, 2019

Conversation

BeaudanBrown
Copy link
Contributor

Bit of a chaotic PR
PoW difficulty is now loaded from the DNS record in the format {"timestamp":difficulty,"timestamp":difficulty}
This should represent at least the last 4 days of difficulties
When verifying a client message, we always use the most recent difficulty
When verifying messages pushed by other snodes we use the smallest of either: the most recent difficulty in the past OR any difficulty 15 minutes before or after the message timestamp
This is to allow for messages that were accepted by snodes that hadn't updated their difficulty yet
The difficulty timer is handled by the worker thread and then posts the result to the main thread to update the ServiceNode value

Don't know how I feel about passing in length 1 vector for the client verification, just wanted to get it working for now

pow/src/pow.cpp Outdated Show resolved Hide resolved
pow/src/pow.cpp Outdated Show resolved Hide resolved
pow/src/pow.cpp Outdated Show resolved Hide resolved
httpserver/service_node.h Outdated Show resolved Hide resolved
httpserver/service_node.h Show resolved Hide resolved
httpserver/service_node.h Outdated Show resolved Hide resolved
httpserver/service_node.h Outdated Show resolved Hide resolved
@msgmaxim msgmaxim merged commit c3a0ead into oxen-io:dev Jun 14, 2019
@BeaudanBrown BeaudanBrown deleted the difficulty-history branch June 14, 2019 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants