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

Finish up difficulty/multiplier semantics in RPC work_generate and work_validate #1981

Merged

Conversation

4 participants
@guilhermelawless
Copy link
Contributor

commented May 13, 2019

  • Adds value + multiplier to work_generate
  • Changes all "value" semantics to "difficulty", per suggestion. This affects work_generate and work_validate documentations.
  • Makes sure to have high precision (double) in all cases, which includes active_difficulty

@zhyatt zhyatt requested review from wezrule and argakiig May 13, 2019

@zhyatt zhyatt added this to the V19.0 milestone May 13, 2019

@zhyatt

This comment has been minimized.

Copy link
Collaborator

commented May 13, 2019

@guilhermelawless Is the use case for this item to allow systems doing pre-caching to be able to track generated work levels for better pro-active rework when network load is heavy?

@guilhermelawless

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2019

@zhyatt not only for precaching (an excellent use case I hadn't thought of yet), but also for services deciding to implement their own re-work will need to know the value of the work generated and compare against current active_difficulty or other measures.

This change avoids having to use RPC work_validate.

@zhyatt zhyatt added this to During RC in V19 May 13, 2019

@SergiySW

This comment has been minimized.

Copy link
Collaborator

commented May 13, 2019

"value" doesn't sound like clear name for difficulty

@guilhermelawless

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

Agreed, but "difficulty" would clash against the request field "difficulty", while "value" maintains coherence with other RPCs.

Maybe the request field should change to threshold so that the reply fields can change to difficulty.

@clemahieu

This comment has been minimized.

Copy link
Collaborator

commented May 14, 2019

I think it's fine just being included every time, it doesn't need to be requested/optional.
Is it an issue if the names clash? The request says "give me something over this difficulty" and the response says "this is the actual difficulty".

Change semantics in RPC responses from value to difficulty.
- Changes for RPC work_generate and work_validate
- Fixes getting lower precision in the multiplier of work_validate due
to converting with std::string
- Re-organize tests

@guilhermelawless guilhermelawless changed the title Value and multiplier in RPC work_generate response Finish up difficulty/multiplier semantics in RPC work_generate and work_validate May 14, 2019

@guilhermelawless

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

@clemahieu that makes sense! Made changes to reflect this, all changes documented in the first comment. Breaks RPC but only for v19 beta testers.

@clemahieu clemahieu merged commit 78c4e1c into nanocurrency:master May 14, 2019

1 of 2 checks passed

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

@zhyatt zhyatt moved this from During RC to RC 3 (TBD) in V19 May 20, 2019

argakiig added a commit to argakiig/raiblocks that referenced this pull request May 22, 2019

Finish up difficulty/multiplier semantics in RPC work_generate and wo…
…rk_validate (nanocurrency#1981)

* Add value and multiplier to RPC work_generate response

* Use double for multiplier everywhere, no reason to lose precision

* Change semantics in RPC responses from value to difficulty.

- Changes for RPC work_generate and work_validate
- Fixes getting lower precision in the multiplier of work_validate due
to converting with std::string
- Re-organize tests

@guilhermelawless guilhermelawless deleted the guilhermelawless:rpc/work-generate-value branch May 22, 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.