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

Set initial value for bsqAverageTrimThreshold at update to 5% #4747

Merged

Conversation

chimp1984
Copy link
Contributor

@chimp1984 chimp1984 commented Nov 4, 2020

Set initial value for bsqAverageTrimThreshold to 5% in case of an update (using persisted preferences which would
have value set to 0 as it was not existing in old version)

Fixes #4706 (comment)

update (using persisted preferences which would
have value set to 0 as it was not existing in old version)
@chimp1984 chimp1984 changed the title Set initial value for bsqAverageTrimThreshold to 5% in case of an Set initial value for bsqAverageTrimThreshold at update to 5% Nov 4, 2020
Copy link
Member

@cbeams cbeams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK. This change blindly sets the threshold value to 5% regardless of its previous value. I tested this by bringing up my client, setting the value to 1%, shutting it down and restarting it and noticing that the value reverted to 5%. I tried it again, thinking that perhaps my value didn't persist. I set it to 2%, clicked around to different screens in the UI, came back to settings, confirmed that 2% was still set, shut the client down and restarted, and once again the value was set to 5%. When fixing this, it should also be considered that 0% is a valid value, i.e. if someone sets that value, it should persist and not be reset to 5%. The implementation should check that the preference value is null/absent in order to force it to 5%, not just equivalent to 0.

@chimp1984
Copy link
Contributor Author

Ah damn... was too much rushed...

@chimp1984
Copy link
Contributor Author

Hm... not that easy to fix as default is 0 if protobug field was not set, but we allow 0 as value, so if we just check for 0 it would overwrite it when you set 0. I need to check if the protobuf reveals some more info it the field was undefined so we can set it to -1 and check for that... But busy atm with some issues with seed nodes...

@chimp1984
Copy link
Contributor Author

Seems for primitive types there is no way to check if field was set and it delivers 0 if not set. @cbeams Do you know any way to deal with that? Wrapping the double in a protoDouble would work but thats ugly... Or we accept that when setting to 0 it will not persist your custom setting. Not that important feature anyway...

See comment at change for more background.
@ripcurlx ripcurlx merged commit 20aac2e into bisq-network:master Nov 5, 2020
@cbeams
Copy link
Member

cbeams commented Nov 5, 2020

ACK. I've tested the latest change and can confirm all works as expected. It is indeed unfortunate to not allow 0% as a legitimate value, but I agree that further work on this very minor feature is probably not worth it. The comment in the code is enough for now. Perhaps if someone complains about it, more work would be merited.

@chimp1984 chimp1984 deleted the fix-initial-outlier-value-at-update branch November 9, 2020 18:19
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

3 participants