-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Accept old trade statistic object #3933
Accept old trade statistic object #3933
Conversation
The code didn't handle before the use case of new trade statistic objects created by two old clients. This change make it independent of the cut off date and allows us at a later point to update all trade statistics objects with depositTxId value of null.
4992762
to
2ad279f
Compare
Just to make the different use cases more clear:
Seednodes: |
This prevents unnecessary load on the seednodes from old clients loading all trade statistic objects on startup as they interpret the null value as empty string
As it doesn't give more privacy to set deposit transaction ids of old trade statistics to null (can be retrieved by data stores of old client binaries) and only would cause additional load for our seednodes I've reverted this change. Still as old clients will parse null to an empty string causes them to load trades by new clients (v1.2.6) to reload on restart as empty string != null. |
@@ -217,7 +218,7 @@ public static TradeStatistics2 fromProto(protobuf.TradeStatistics2 proto) { | |||
proto.getTradePrice(), | |||
proto.getTradeAmount(), | |||
proto.getTradeDate(), | |||
null, // We don't want to expose this anymore | |||
ProtoUtil.stringOrNullFromProto(proto.getDepositTxId()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would leave all new trades from older clients still exposed. That's perhaps the safest way to do it. Was hoping it would be possible to keep setting it to null for new version and just not serve the old version anything. Not sure if that would break things though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you only get the additionally privacy if you update or if you trade with a peer that has already updated. I had to do it like that to prevent the unnecessary load from old clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Works as planned and the deposittx is of course exposed as long as users don't upgrade. Nothing can be done about that.
I verified that the old version did cause delivery of a lot of tradestats objects and this version doesn't. |
The code didn't handle before the use case of new trade statistic objects
created by two old clients. This change make it independent of the cut off date
and allows us at a later point to update all trade statistics objects with
depositTxId value of null.