Jean-Luc
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 06:34:53 PM |
|
fluke.airdns.org ran out of file descriptors again. I bet we have a connection leak somewhere in the code, connections not being closed. There are godzillion of connections in CLOSE_WAIT state. I don't see a way to force those to timeout earlier by tweaking net.ipv4.tcp* settings, all I was able to quickly read on the topic suggests it is our application responsibility to take care of closing those. Anyone with more networking experience please feel free to suggest a fix.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 06:38:33 PM |
|
fluke.airdns.org ran out of file descriptors again. I bet we have a connection leak somewhere in the code, connections not being closed. There are godzillion of connections in CLOSE_WAIT state. I don't see a way to force those to timeout earlier by tweaking net.ipv4.tcp* settings, all I was able to quickly read on the topic suggests it is our application responsibility to take care of closing those. Anyone with more networking experience please feel free to suggest a fix.
Do u have a log of requests? Such a problem will arise if someone emulates web client responses. I see 2 ways to fix the issue - add timeout for pending interface requests & enable allowedUserHosts.
|
|
|
|
ig0tik3d
Legendary
Offline
Activity: 1246
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 06:41:05 PM |
|
![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs020.radikal.ru%2Fi706%2F1312%2F80%2F861a90a74332.jpg&t=665&c=424KOt5FoFsk1Q) exist 0.3.16 version??
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 06:45:17 PM |
|
![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs020.radikal.ru%2Fi706%2F1312%2F80%2F861a90a74332.jpg&t=665&c=424KOt5FoFsk1Q) exist 0.3.16 version?? Yes, I test new versions on my node.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 06:48:36 PM |
|
- What's a safe number of confirmations for a transaction to be trusted. I would assume that there being one block per minute, and keeping with bitcoin's 1 hour rule that would be 60 for fair trust level, but for rapid transaction processing (such as in a gambling site) what would be the minimum number of transactions?
10 Nxt confirmations ~ 1 BTC confirmation. If u send winnings and reference betting transactions (via "referencedTransaction" in "sendMoney" request) then both or none of the transactions will be confirmed (these r so-called chained transactions). chained transactions only prevent part of the problem. The real issue comes from showing bet results too early, allowing the losing bets to be double spent and only the winning ones going through untouched. The effort in BTC terms to orphan an already propagated block are high enough to accept a single confirmation on low value transactions. I'm just trying to get a feel on what would the equivalent be in NXT terms. Look at Instant transactions with guaranteed confirmation- How are fees calculated? There's a 1NXT minimum fee per tx, if I read things correctly, but are there transaction size issues to be worried about? Block size?
Blocks r limited to 32 KiB. Reference soft takes into account size of transactions when sort them, ordinary payments r always 128 B long. So what does that mean for fees? Is the rule atm a flat 1 NXT per tx? 1 NXT is minimum fee. This is transaction sorting algo - https://bitcointalk.org/index.php?topic=352286.msg3776655#msg3776655 (the last piece of code).- I don't see in the API a way to get the equivalent to the memory pool, a list of transactions waiting inclusion. Can I get that somehow?
This is not implemented, post ur request in API thread. - Can I work with raw transactions? I would particularly need to be able to sign transactions "offline".
U can use "sendMoney" to get a transaction id. Then use "getTransactionBytes" to get raw bytes. Then go online and use "broadcastTransaction" (disabled atm). In a pseudo-script language this would look like broadcastTransaction(getTransactionBytes(sendMoney(transactionData))); NB: U can broadcast any transactions making other peers to recall them. What I was aiming for is as much independence from the client as possible, effectively implementing the code elsewhere. Thus creating the transaction using sendMoney would be great *if* I can get an unsigned raw tx, sign it in my code without using the ref client and then ask the client to propagate it. In other words, I need to ask the client for an unsigned transaction and I need to be told how signing is implemented so I can reproduce in my own code. Is any of this already available? No. Post this request in API thread, please.- Can I create accounts offline? I assume that we're talking about a simple double sha256 of the passphrase so what I'd need to do is create random passphrases and derive the account number from those? Will the network accept sending to any account address or is there any kind of "registration" message that needs to be propagated first?
Any 64 bit unsinged number can be used as a valid account id. If u need API for converting a passphrase into the account id then post this in API thread. I really need a description of the process, not an API. This is yet another thing I must have done without depending on the ref client. Is there any explanation of the algorithm used? Look at https://bitcointalk.org/index.php?topic=345619.msg3759147#msg3759147
|
|
|
|
Jean-Luc
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 06:57:57 PM |
|
Do u have a log of requests? Such a problem will arise if someone emulates web client responses. I see 2 ways to fix the issue - add timeout for pending interface requests & enable allowedUserHosts.
I set allowedUserHosts to 127.0.0.1, but I can still access http://fluke.airdns.org:7874/ , and of course I am not connecting from localhost. http://fluke.airdns.org:7874/nxt?requestType=getMyInfo returns my correct IP. Is that how it is supposed to work? [2013-12-07 18:42:42.330] "allowedUserHosts" set to "127.0.0.1" [2013-12-07 18:42:42.330] "allowedBotHosts" set to "*"
After a reboot, netstat doesn't show any CLOSE_WAIT connections, but about 2000 in TIME_WAIT at the moment. I don't have a log of the http requests, are those being logged somewhere? I only have whatever is printed to nohup.out, I run it from nohup. Next time it accumulates CLOSE_WAIT junk, I can capture the list of IPs from netstat.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:02:10 PM |
|
Do u have a log of requests? Such a problem will arise if someone emulates web client responses. I see 2 ways to fix the issue - add timeout for pending interface requests & enable allowedUserHosts.
I set allowedUserHosts to 127.0.0.1, but I can still access http://fluke.airdns.org:7874/ , and of course I am not connecting from localhost. http://fluke.airdns.org:7874/nxt?requestType=getMyInfo returns my correct IP. Is that how it is supposed to work? [2013-12-07 18:42:42.330] "allowedUserHosts" set to "127.0.0.1" [2013-12-07 18:42:42.330] "allowedBotHosts" set to "*"
After a reboot, netstat doesn't show any CLOSE_WAIT connections, but about 2000 in TIME_WAIT at the moment. I don't have a log of the http requests, are those being logged somewhere? I only have whatever is printed to nohup.out, I run it from nohup. Next time it accumulates CLOSE_WAIT junk, I can capture the list of IPs from netstat. allowedUserHosts is not enabled yet. I'll add logging feature in 0.3.16. TIME_WAIT is normal behavior, what is the timeout btw?
|
|
|
|
manrus
Legendary
Offline
Activity: 1334
Merit: 1004
TTM
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:03:20 PM |
|
Have a problem with version 0.3.15 secretPhrase=MY_SECRET In my password uses ":,()*+' ", length 64 ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) Client out that {"errorCode":3,"errorDescription":"\"host\" not specified"}
|
|
|
|
Jean-Luc
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:06:26 PM |
|
allowedUserHosts is not enabled yet. I'll add logging feature in 0.3.16. TIME_WAIT is normal behavior, what is the timeout btw?
$ cat /proc/sys/net/ipv4/tcp_fin_timeout 5
I reduced it to 5, was 60 before the last crash.
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:09:51 PM |
|
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:14:22 PM |
|
U guys continue to confuse ppl using "nextcoin" brand. This is "Nxt", no "e", no "coin".
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:16:36 PM |
|
U guys continue to confuse ppl using "nextcoin" brand. This is "Nxt", no "e", no "coin". Hmmm you are right! I will tell him to correct it! So no 'Next' anywhere? Just 'NXT'?
|
|
|
|
Jls.
Newbie
Offline
Activity: 34
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:17:41 PM |
|
Have a problem with version 0.3.15 secretPhrase=MY_SECRET In my password uses ":,()*+' ", length 64 ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) Client out that {"errorCode":3,"errorDescription":"\"host\" not specified"} +1 !
|
|
|
|
nexern
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:19:30 PM |
|
allowedUserHosts is not enabled yet. I'll add logging feature in 0.3.16. TIME_WAIT is normal behavior, what is the timeout btw?
$ cat /proc/sys/net/ipv4/tcp_fin_timeout 5
I reduced it to 5, was 60 before the last crash. currently running this echo 7 > /proc/sys/net/ipv4/tcp_fin_timeout echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse echo 30 > /proc/sys/net/ipv4/tcp_keepalive_intvl echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes with +400 peers. seems ok.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:21:31 PM |
|
U guys continue to confuse ppl using "nextcoin" brand. This is "Nxt", no "e", no "coin". Hmmm you are right! I will tell him to correct it! So no 'Next' anywhere? Just 'NXT'? I believe the brand is "Nxt" and the currency code is "NXT".
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:22:41 PM |
|
Have a problem with version 0.3.15 secretPhrase=MY_SECRET In my password uses ":,()*+' ", length 64 ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) Client out that {"errorCode":3,"errorDescription":"\"host\" not specified"} +1 ! I'll check it, moment... Looks like "host" is not specified.
|
|
|
|
manrus
Legendary
Offline
Activity: 1334
Merit: 1004
TTM
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:26:00 PM |
|
I'll check it, moment...
Looks like "host" is not specified.
Problem in pass. I'll check it by change my ugly secret to "123" and all works.
|
|
|
|
Come-from-Beyond
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:31:07 PM |
|
I'll check it, moment...
Looks like "host" is not specified.
Problem in pass. I'll check it by change my ugly secret to "123" and all works. Guys, does anyone see what maybe the problem in case "markHost": { String secretPhrase = req.getParameter("secretPhrase"); String host = req.getParameter("host"); String weightValue = req.getParameter("weight"); String dateValue = req.getParameter("date"); if (secretPhrase == null) { response.put("errorCode", 3); response.put("errorDescription", "\"secretPhrase\" not specified"); } else if (host == null) { response.put("errorCode", 3); response.put("errorDescription", "\"host\" not specified"); } else if (weightValue == null) { response.put("errorCode", 3); response.put("errorDescription", "\"weight\" not specified"); } else if (dateValue == null) { response.put("errorCode", 3); response.put("errorDescription", "\"date\" not specified"); } else { if (host.length() > 100) { response.put("errorCode", 4); response.put("errorDescription", "Incorrect \"host\" (the length exceeds 100 chars limit)"); } else { try { int weight = Integer.parseInt(weightValue); if (weight <= 0 || weight > 1000000000) { throw new Exception(); } try { int date = Integer.parseInt(dateValue.substring(0, 4)) * 10000 + Integer.parseInt(dateValue.substring(5, 7)) * 100 + Integer.parseInt(dateValue.substring(8, 10)); byte[] publicKey = Crypto.getPublicKey(secretPhrase); byte[] hostBytes = host.getBytes("UTF-8"); ByteBuffer buffer = ByteBuffer.allocate(32 + 2 + hostBytes.length + 4 + 4 + 1); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.put(publicKey); buffer.putShort((short)hostBytes.length); buffer.put(hostBytes); buffer.putInt(weight); buffer.putInt(date); byte[] data = buffer.array(); byte[] signature; do { data[data.length - 1] = (byte)ThreadLocalRandom.current().nextInt(); signature = Crypto.sign(data, secretPhrase); } while (!Crypto.verify(signature, data, publicKey)); response.put("hallmark", convert(data) + convert(signature)); } catch (Exception e) { response.put("errorCode", 4); response.put("errorDescription", "Incorrect \"date\""); } } catch (Exception e) { response.put("errorCode", 4); response.put("errorDescription", "Incorrect \"weight\""); } } } } break;
|
|
|
|
LightningFury
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:31:55 PM |
|
Have a problem with version 0.3.15 secretPhrase=MY_SECRET In my password uses ":,()*+' ", length 64 ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) Client out that {"errorCode":3,"errorDescription":"\"host\" not specified"} +1 ![Grin](https://bitcointalk.org/Smileys/default/grin.gif)
|
|
|
|
LightningFury
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 07, 2013, 07:34:41 PM |
|
I'll check it, moment...
Looks like "host" is not specified.
Problem in pass. I'll check it by change my ugly secret to "123" and all works. Guys, does anyone see what maybe the problem in case "markHost": { String secretPhrase = req.getParameter("secretPhrase"); String host = req.getParameter("host"); String weightValue = req.getParameter("weight"); String dateValue = req.getParameter("date"); if (secretPhrase == null) { response.put("errorCode", 3); response.put("errorDescription", "\"secretPhrase\" not specified"); } else if (host == null) { response.put("errorCode", 3); response.put("errorDescription", "\"host\" not specified"); } else if (weightValue == null) { response.put("errorCode", 3); response.put("errorDescription", "\"weight\" not specified"); } else if (dateValue == null) { response.put("errorCode", 3); response.put("errorDescription", "\"date\" not specified"); } else { if (host.length() > 100) { response.put("errorCode", 4); response.put("errorDescription", "Incorrect \"host\" (the length exceeds 100 chars limit)"); } else { try { int weight = Integer.parseInt(weightValue); if (weight <= 0 || weight > 1000000000) { throw new Exception(); } try { int date = Integer.parseInt(dateValue.substring(0, 4)) * 10000 + Integer.parseInt(dateValue.substring(5, 7)) * 100 + Integer.parseInt(dateValue.substring(8, 10)); byte[] publicKey = Crypto.getPublicKey(secretPhrase); byte[] hostBytes = host.getBytes("UTF-8"); ByteBuffer buffer = ByteBuffer.allocate(32 + 2 + hostBytes.length + 4 + 4 + 1); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.put(publicKey); buffer.putShort((short)hostBytes.length); buffer.put(hostBytes); buffer.putInt(weight); buffer.putInt(date); byte[] data = buffer.array(); byte[] signature; do { data[data.length - 1] = (byte)ThreadLocalRandom.current().nextInt(); signature = Crypto.sign(data, secretPhrase); } while (!Crypto.verify(signature, data, publicKey)); response.put("hallmark", convert(data) + convert(signature)); } catch (Exception e) { response.put("errorCode", 4); response.put("errorDescription", "Incorrect \"date\""); } } catch (Exception e) { response.put("errorCode", 4); response.put("errorDescription", "Incorrect \"weight\""); } } } } break;
A "#" in the secret in the url before the host?
|
|
|
|
|