jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 21, 2014, 09:52:52 AM |
|
Is double precision floating point really so unreliable?
This is peoples *money* you are dealing with James so I think you should not be so cavalier and actually understand how things work (or pay someone else to do the job *properly*). If you take such shortcuts then your code will just end up as "junk" down the track. I am sure there is some equivalent C code around and the code I wrote there could be reduced (as a lot of functionality it has you wouldn't need). Would you be so kind as to educate me on how using double precision is being cavalier? I have used floating point a lot, even for iterative computations. For a gateway, all user facing operations have a very short length, eg. one maybe two operations. How will errors in the 14th decimal place matter when 1 satoshi is 12 decimal place even for 1000 deposit. I am all for super precision, so once I understand the actual problem I will do what it takes to make it precise. Please help me understand the issue. I read https://bitcointalk.org/index.php?topic=13837.0 and nothing in here convinces me that doing a single subtract will change the value of any deposit or withdrawal, down to 1 satoshi. Also, the gateway code will be run in controlled environments and I will specify compiler, options, etc. Again, please provide a specific example of precision problem that a gateway doing deposits and withdrawals will run into. What if I used 128bit floating point? James
|
|
|
|
pinarello
Full Member
Offline
Activity: 266
Merit: 100
NXT is the future
|
|
February 21, 2014, 09:54:04 AM |
|
Ok I understand, but...
what if bter uses info from the "official" blockchain explorer let us say manualy, cant we just fix the issue with that blockchain explorer.
I'm not privy to nexern's code, but I gather that parts of the block explorer database are updated by a cron job that only runs perhaps once per day or so. If that's the case then it will always lag behind real-time unless a different update scheme is devised. thank you for your input!
|
|
|
|
nexern
|
|
February 21, 2014, 09:57:34 AM |
|
Ok I understand, but... what if bter uses info from the "official" blockchain explorer let us say manualy, cant we just fix the issue with that blockchain explorer. exchanges using thier own instance to verify transactions for sure. blockexplorer is currently polling the NRS api and buffers the result into a local database, therefore the very quick query and response times you see when using the explorer. the new NRS supports now direct database access, which means blockexplorer can query all data in realtime soon. since the buffering can be skipped, the confirmations will be always realtime too. atm you see a snapshot from that moment the old api was polled and therefore the confirmation gap but this doesn't mean the data is not acurate. the confirmation gap is currently filled by an additional cron job refreshing the snapshot from time to time. if you check this specific transaction later you will see the confirmation increased. ps: the blockexplorer is special built to run on minimal hardware to handle even millions of records without any greater latency by query. this means even if the nxt blockchain grows extremly the response time will remain the same. compared to other tools (e.g. php/mysql) blockexplorer won't break later due to heavy load or terrabyte dbs.
|
|
|
|
antanst
|
|
February 21, 2014, 09:59:43 AM |
|
Donation Fundraiser for the Guy who proofread the Reddit-Tip-BotThe code is now tested and I will also request the payout for the creator of the bot. Here is a quote of the tester: from pkulak sent 1 hour ago Okay, I'm ready to sign off on this. I got it running in a VM (under my own account to avoid low-karma issues) and everything tests out as working. I didn't do an audit of every line, but I did look at all the lines that were modified/added from the original altcointip project it was forked from: https://dl.dropboxusercontent.com/u/241970/audit/file_changes.txt https://dl.dropboxusercontent.com/u/241970/audit/diffs.diffIt all looks good. It's good code. No security issues or backdoors, from what I can tell (as of 77d830d3ff0e79d73e798360f2594bcc8021ca8c). The database is not encrypted, which maybe you'd want since it includes all the private keys, but that probably doesn't buy you too much over just really locking your server down properly. Bit of a challenging project too, due to NXT's lack of resemblance to the altcoins that altcointip was built to work with. His NXT address is: 13791631395073296157 He only received 500 NXT until now from LiQio. Author of the bot here. Donated 500. Thanks for proofreading the code!
|
|
|
|
xyzzyx
Sr. Member
Offline
Activity: 490
Merit: 250
I don't really come from outer space.
|
|
February 21, 2014, 10:02:14 AM |
|
Speak the Devil's name and he shall appear.
|
"An awful lot of code is being written ... in languages that aren't very good by people who don't know what they're doing." -- Barbara Liskov
|
|
|
|
|
nexern
|
|
February 21, 2014, 10:10:00 AM |
|
struct gateway_info // this struct is very incomplete, still a work in progress { double balance,deposits,withdrawals,tbd __attribute__ ((packed)); ... };
struct gateway_AM { ... double amount __attribute__ ((packed)); double unspent __attribute__ ((packed)); double change __attribute__ ((packed)); ... };
Would it be possible to use int64_t from the stdint.h library to represent amounts instead of floating point? Eventually, but for single deposit and withdrawals, using double wont lose any satoshi or even dogtoshi. I would only be a cumulative drift in gateway balance totals. I just dont want to have to deal with converting everything to int math for now. you are doing very cool things jl777, great! just one remark, iirc i have had some problems using __attribute__ switch in the past, while #pragma pack() was always working well. have to dig in my old sources to find out which compiler refused attribute but there where some issues i can remember. unless you need explicit selective aligment, #pragma could be better and is not so verbose.
|
|
|
|
pinarello
Full Member
Offline
Activity: 266
Merit: 100
NXT is the future
|
|
February 21, 2014, 10:12:43 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
We cannot expect mass adoption if above persist, and nobody steps forward to either make some kind of procedure or help people out.
Another remark is that I have the impression interest in NXT is decreasing in favor of new alt-coins/clones.
How can we reestablish interest in NXT?
|
|
|
|
abuelau
|
|
February 21, 2014, 10:20:21 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
We cannot expect mass adoption if above persist, and nobody steps forward to either make some kind of procedure or help people out.
Another remark is that I have the impression interest in NXT is decreasing in favor of new alt-coins/clones.
How can we reestablish interest in NXT?
When is the AE going to be fully functional?
|
|
|
|
Fatih87SK
|
|
February 21, 2014, 10:21:13 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
We cannot expect mass adoption if above persist, and nobody steps forward to either make some kind of procedure or help people out.
Another remark is that I have the impression interest in NXT is decreasing in favor of new alt-coins/clones.
How can we reestablish interest in NXT?
Announcing a client that almost everyone is going to use. + Public giveaway to promote that client. So people can play with the coins they receive with the new client. But I have a feeling that we have to wait for Nexern.
|
|
|
|
McDoxy
Member
Offline
Activity: 96
Merit: 10
|
|
February 21, 2014, 10:22:38 AM |
|
My NXT is dancing the Limbo again between my account and bter Has anybody had any luck with bter NXT deposits the last 24 hours? Nope my Nxt is trapped in limbo as well... Made a deposit to BTER 24 hours ago and still haven't received anything.
|
|
|
|
nexern
|
|
February 21, 2014, 10:24:11 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
We cannot expect mass adoption if above persist, and nobody steps forward to either make some kind of procedure or help people out.
Another remark is that I have the impression interest in NXT is decreasing in favor of new alt-coins/clones.
How can we reestablish interest in NXT?
Announcing a client that almost everyone is going to use. + Public giveaway to promote that client. But I have a feeling that we have to wait for Nexern. no need to wait, there are many good clients out now, supporting AE too. anyway, of course i am adding additional value to nxt soon.
|
|
|
|
abctc
Legendary
Offline
Activity: 1792
Merit: 1038
|
|
February 21, 2014, 10:27:53 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
How can we reestablish interest in NXT?
- I think our developres are too busy to write a detailed documentation. Those, who want to implementing NXT on their services can study our community's open-source developments, such as: NXT pay-button: http://nxtra.org/pay-button/curl API: https://bitcointalk.org/index.php?topic=345619.msg4551188#msg4551188Nxt_API: http://wiki.nxtcrypto.org/wiki/Nxt_API http://nxt.airdns.org:7875/doc/the ways to handle deposits: https://bitcointalk.org/index.php?topic=345619.msg4385659#msg4385659nxtra.org faucet: http://nxtra.org/faucet/faucet.zipreddit tip-bot: https://github.com/nxtip/nxtipand so on, as well, as all opensource Nxt clients.
|
██████████████████████████████████████████████████ ████████████████████████████████████████████████████ ██████████████████████████████████████████████████████ ████████████████████████████████████████████████████████ ████████████████████████████████████████████████████████ ████████████████████████████████████████████████████████████████████ ████████████████████████████████████████████████████████████ ██████████████████████████████████████████████████████████████ ████████████████████████████████████████████████████████████████ ██████████████████████████████████████████████████████████████████ ████████████████████████████████████████████████████████████████████ | , the Next platform. Magis quam Moneta (More than a Coin) |
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 21, 2014, 10:28:35 AM |
|
A lot of that is talking about 32bit floating point with some references to the '90s. I have extensive experience with 32bit floats and 64bit doubles. I have to check to be sure, but the gateway code is not doing any multiplication, division or anything esoteric. Just adding. With so much headroom, it will be thousands of transactions before the gateways end up with 1 satoshi of cumulative error, but that is only used for keeping them in sync. I do have a few atof() calls that convert bitcoind vouts, but even 100 of them added together will still be precise to the satoshi. I think there is a superstition against floating point because it can cause problems. Anything can cause problems. I like to assess the pros and cons and code complexity is an issue for me. I do not want to complicate the code for no actual reason. The gateway is not keeping balances in the user's accts. It relies on bitcoind and NXT to do that. Please give me a specific reason that in this specific case using double precision is bad. I still cant see a scenario where it will be off by a full satoshi. I can always go to 80bit or 128bit doubles if there are cases of losing a satoshi. James
|
|
|
|
pinarello
Full Member
Offline
Activity: 266
Merit: 100
NXT is the future
|
|
February 21, 2014, 10:28:44 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
We cannot expect mass adoption if above persist, and nobody steps forward to either make some kind of procedure or help people out.
Another remark is that I have the impression interest in NXT is decreasing in favor of new alt-coins/clones.
How can we reestablish interest in NXT?
When is the AE going to be fully functional? Think this goes toghetter with client release, no sence to release AE when avarage Joe cant use it. Community decides when to release AE, when it is tested enough.
|
|
|
|
mikesbmw
|
|
February 21, 2014, 10:29:57 AM |
|
My NXT is dancing the Limbo again between my account and bter Has anybody had any luck with bter NXT deposits the last 24 hours? Nope my Nxt is trapped in limbo as well... Made a deposit to BTER 24 hours ago and still haven't received anything. Few weeks ago they had the same problem. I mailed them, got a nice (non-automated) all be it generic response and a few hours later all was well. Same thing. Lots of people complaining they hadn't received their NXT and then out of nowhere they appeared. EDIT: this doesn't do NXT any good...
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 21, 2014, 10:31:44 AM |
|
Just adding.
James - you do understand that 0.1 and 0.01 *cannot be represented in binary floating point* don't you (no matter how many bits you have)? If you care to *read* what I linked for you the problems can (and will) occur even when you are just doing simple operations. Anyway - you have been warned but clearly are not interested in *learning* anything about serious software engineering so I give up and would recommend *no-one* to consider your software as anything other than a prototype.
|
|
|
|
pinarello
Full Member
Offline
Activity: 266
Merit: 100
NXT is the future
|
|
February 21, 2014, 10:36:18 AM |
|
Do we have an testreport from AE?
Is it ready to implement, what is the status?
Do our clients support the AE to devs satisfaction? wesleyh, marcus03, minusbalancer, etc...)
|
|
|
|
swartzfeger
|
|
February 21, 2014, 10:39:27 AM |
|
There is lack of support for people that want to use and implement NXT, that way we miss opportunities.
Apparently implementing NXT is not that straight forward, look at cryptsy, mintpal, atomic-trader, etc… none of them succeed without any help to implement NXT.
We cannot expect mass adoption if above persist, and nobody steps forward to either make some kind of procedure or help people out.
Another remark is that I have the impression interest in NXT is decreasing in favor of new alt-coins/clones.
How can we reestablish interest in NXT?
People won't know what hit them come April. I'll make a prediction (all in good fun) -- NXT @ $1 USD by 31 May. Just seeing Wesley's new client and the new Nxt wallet have been fantastic additions, we have atomic trade, 0.8.0 is coming... there's been a lot of good news lately. Things are looking up!
|
|
|
|
|