nicatronTg

Untitled

Apr 13th, 2015
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.62 KB | None | 0 0
  1. nicatrontg [3:34 PM]
  2. yeah
  3.  
  4. nicatrontg [3:34 PM]
  5. I noticed the work factor of 10 was a wee bit much
  6.  
  7. nicatrontg [3:34 PM]
  8. 12 was definitely 1-2 seconds
  9.  
  10. nicatrontg [3:35 PM]
  11. @enerdy: you could experiment with higher work factors
  12.  
  13. enerdy [3:35 PM]
  14. I could
  15.  
  16. olink [3:41 PM]
  17. locking main thread for 2 seconds, sounds like a bad idea
  18.  
  19. nicatrontg [3:42 PM]
  20. yeah
  21.  
  22. nicatrontg [3:42 PM]
  23. not sure why you would set a work factor high enough that your server would lock for 1-2 seconds calculating it
  24.  
  25. enerdy [3:43 PM]
  26. inb4 async
  27.  
  28. enerdy [3:43 PM]
  29. And ruin the whole purpose of it at the same time
  30.  
  31. enerdy [3:43 PM]
  32. :kappa:
  33.  
  34. nicatrontg [3:44 PM]
  35. even if you async it, you’d still delay login
  36.  
  37. enerdy [3:44 PM]
  38. yeah but you won't stop the main thread
  39.  
  40. olink [3:44 PM]
  41. login and register both have no immediate feedback requirements
  42.  
  43. enerdy [3:44 PM]
  44. ^
  45.  
  46. olink [3:44 PM]
  47. theres no reason not to dump it to another thread
  48.  
  49. nicatrontg [3:44 PM]
  50. sighs
  51.  
  52. enerdy [3:44 PM]
  53. You could even add a "Logging in..." message if the work factor was higher than x
  54.  
  55. olink [3:45 PM]
  56. esp if its that easy to lock the server for seconds
  57.  
  58. enerdy [3:45 PM]
  59. Or send a status packet with that lol
  60.  
  61. olink [3:45 PM]
  62. good use of bad terraria Kappa
  63.  
  64. olink [3:45 PM]
  65. hmmm should make a status api
  66.  
  67. enerdy [3:45 PM]
  68. Totally
  69.  
  70. olink [3:45 PM]
  71. so multiple plugins can use it safely
  72.  
  73. enerdy [3:45 PM]
  74. Status is one of those things that has potential
  75.  
  76. nicatrontg [3:45 PM]
  77. http://wildlyinaccurate.com/bcrypt-choosing-a-work-factor/
  78. Bcrypt is a Blowfish-based hashing algorithm which is commonly used for password hashing because of its potentially expensive key setup phase. A Bcrypt hash has the following structure:$2a$(2 chars work)$(22 chars salt)(31 chars hash)The reason th...
  79.  
  80. enerdy [3:45 PM]
  81. But can totally mess up if everybody starts using it atm
  82.  
  83. nicatrontg [3:46 PM]
  84. work factor is 2^n
  85.  
  86. enerdy [3:46 PM]
  87. mhm
  88.  
  89. enerdy [3:46 PM]
  90. So it increases exponentially
  91.  
  92. nicatrontg [3:47 PM]
  93. which is why it’s silly to set it to like 12
  94.  
  95. nicatrontg [3:48 PM]
  96. I mean you could make the argument that you could async every db operation
  97.  
  98. nicatrontg [3:48 PM]
  99. because non-important
  100.  
  101. nicatrontg [3:48 PM]
  102. or that servers with mysql already risk lockups because of one reason or another
  103.  
  104. enerdy [3:50 PM]
  105. Yeah but we said tshock would never be async in its core, so I can use that argument when considering db queries to be part of tshock's core
  106.  
  107. enerdy [3:50 PM]
  108. :kappa:
  109.  
  110. nicatrontg [3:51 PM]
  111. if anything, it’s outside the scope of this particular PR
  112.  
  113. nicatrontg [3:52 PM]
  114. if you set the work factor abnormally high, you’ll screw up your server and make it unusable
  115.  
  116. off [3:52 PM]
  117. That language
  118.  
  119. off [3:52 PM]
  120. O
  121.  
  122. off [3:52 PM]
  123. Chat didnt refresh
  124.  
  125. off [3:52 PM]
  126. :rip:
  127.  
  128. nicatrontg [3:52 PM]
  129. also, if you host your mysql server on a hot air balloon with satellite internet, your sha512 password comparisons will suck
  130.  
  131. nicatrontg [3:52 PM]
  132. waiting for db operations that take minutes to complete
  133.  
  134. enerdy [3:53 PM]
  135. >if you host your mysql server on a hot air balloon with satellite internet
  136.  
  137. enerdy [3:53 PM]
  138. :kappa:
  139.  
  140. enerdy [3:54 PM]
  141. ^Because I read that literally
  142.  
  143. nicatrontg [3:54 PM]
  144. oops
  145.  
  146. nicatrontg [3:54 PM]
  147. I forgot
  148.  
  149. nicatrontg [3:54 PM]
  150. raspberry pi* on a hot air balloon
  151.  
  152. nicatrontg [3:54 PM]
  153. with a potato battery to usb converter
  154.  
  155. enerdy [3:54 PM]
  156. :ok_hand:
  157.  
  158. enerdy [3:54 PM]
  159. And a generator?
  160.  
  161. olink [3:55 PM]
  162. shank you seem offended when people, specifically me, offer legit concerns over your code
  163.  
  164. olink [3:55 PM]
  165. stop taking it personally
  166.  
  167. olink [3:55 PM]
  168. im not attacking you or your code
  169.  
  170. olink [3:55 PM]
  171. i voiced a concern about locking up the main thread
  172.  
  173. nicatrontg [3:55 PM]
  174. I’m not offended, really
  175.  
  176. olink [3:56 PM]
  177. and your argument has a flaw, 1)the db code is there and should be async at its core, but unfortunately its there to stay. 2)all your code is brand new and isnt subject to being poorly developed
  178.  
  179. olink [3:56 PM]
  180. its the same argument i made about patrikks potential pr, just because it works doesnt make it ideal
  181.  
  182. olink [3:57 PM]
  183. if we have the option of making it better now then there is no reason to commit as is and go fix!later
  184.  
  185. olink [3:57 PM]
  186. im sorry if you think im just trying to shoot down your pr, im not
  187.  
  188. olink [3:58 PM]
  189. im trying to make our project look less hacky and less prone to issues, the api runs poorly as is, no reason to make it potentially worse everytime someone logs in
  190.  
  191. nicatrontg [4:10 PM]
  192. I’m not going to continue this tangent, because again, by default, its as performant as sha512
  193.  
  194. nicatrontg [4:11 PM]
  195. like I said, you could host your mysql server on google’s balloon based internet and it would slow it down, just like raising the BCryptWorkFactor would
  196.  
  197. olink [4:13 PM]
  198. Yes, and you ignore everything someone says if you dont want to face facts, its ok
  199.  
  200. olink [4:14 PM]
  201. You cant use the existing db code as an argument to not do something NEW
  202.  
  203. nicatrontg [4:14 PM]
  204. Let’s face the facts here: you’re inhibiting an objectively good change because of a variety of misplaced paranoid antics
  205.  
  206. olink [4:14 PM]
  207. Paranoid? no, again.
  208.  
  209. nicatrontg [4:14 PM]
  210. you called our current solution “not insecure" (edited)
  211.  
  212. olink [4:14 PM]
  213. If you want to be a trash tier developer
  214.  
  215. olink [4:14 PM]
  216. Then be a trash tier developer
  217.  
  218. nicatrontg [4:14 PM]
  219. you’re now saying it’s not performant
  220.  
  221. olink [4:14 PM]
  222. I'm saying and I quote , >locking main thread for 2 seconds, sounds like a bad idea
  223.  
  224. nicatrontg [4:15 PM]
  225. it really does
  226.  
  227. olink [4:15 PM]
  228. Even 500 ms is bad.
  229.  
  230. nicatrontg [4:15 PM]
  231. but again, it can only do that if you raise the work factor
  232.  
  233. olink [4:15 PM]
  234. whats the timing on 7?
  235.  
  236. olink [4:15 PM]
  237. did you time it?
  238.  
  239. nicatrontg [4:15 PM]
  240. at a work factor of 7 on an i3, it takes 1/100th of a second
  241.  
  242. nicatrontg [4:15 PM]
  243. I believe I linked benchmarks earlier
  244.  
  245. olink [4:16 PM]
  246. Then use that as your argument
  247.  
  248. nicatrontg [4:16 PM]
  249. I did.
  250.  
  251. olink [4:16 PM]
  252. Not that shitty code some shitty developer wrote
  253.  
  254. olink [4:16 PM]
  255. >like I said, you could host your mysql server on google’s balloon based internet and it would slow it down, just like raising the BCryptWorkFactor would
  256.  
  257. olink [4:16 PM]
  258. You have a funny way of spelling benchmarks
  259.  
  260. nicatrontg [4:16 PM]
  261. Please, go do something productive instead of yell at me
  262.  
  263. olink [4:16 PM]
  264. Dude if you have a problem with someone raising any issues with your code just remove me from the projct
  265.  
  266. olink [4:16 PM]
  267. Because thats why I'm here
  268.  
  269. olink [4:16 PM]
  270. To make sure the code is as good as possible.
  271.  
  272. olink [4:17 PM]
  273. If you dont want to deal with someone giving feedback
  274.  
  275. olink [4:17 PM]
  276. just fucking get it over with
  277.  
  278. olink [4:17 PM]
  279. Every
  280.  
  281. olink [4:17 PM]
  282. Single
  283.  
  284. olink [4:17 PM]
  285. Criticism
  286.  
  287. olink [4:17 PM]
  288. I
  289.  
  290. olink [4:17 PM]
  291. Make
  292.  
  293. olink [4:17 PM]
  294. You
  295.  
  296. olink [4:17 PM]
  297. Take
  298.  
  299. olink [4:17 PM]
  300. Personally
  301.  
  302. olink [4:17 PM]
  303. Hell, im not the only person who expressed concerns with locking the main thread
  304.  
  305. olink [4:17 PM]
  306. But apparently because I raised the issue, its not something you care about.
  307.  
  308. olink [4:17 PM]
  309. I get it
  310.  
  311. olink [4:17 PM]
  312. Just
  313.  
  314. olink [4:17 PM]
  315. remove me
  316.  
  317. olink [4:18 PM]
  318. Otherwise I will continue to complain about bad code
  319.  
  320. nicatrontg [4:23 PM]
  321. Let me put it like this: in calculus, we apply limits to things so that the results make sense. Sure, given an infinite amount of “what-if” possibilities, this code can be used to slow down the server. This, however, can happen the same way in a multitude of different ways.
  322.  
  323. You can comment on my code, but please, do so in a way that reflects that you understand what you’re talking about, rather than jumping in head first and saying that “1-2 seconds on the main thread is bad => this code is bad.” Understanding the BCrypt work factor is a critical component to being able to review this code, because without that understanding, it may appear that it abnormally raises the time required to do something. This, however, is not the case, and in fact, is quite contrary to the default I set it to. I’ve been trying to make this point several times, using statistics (linking benchmarks), pointing out the growth rate, the default, and saying several times that it already computes to something equivalent in hash speed for SHA512. When that didn’t work, I used a common literature method called hyperbole to dramatize the fact that increasing the work factor could, just as hosting a remote MySQL server, cause performance issues, but that these were all up to the server owner to configure and decide for themselves. Don’t make me repeat myself several times to try to emphasize the same point.
  324.  
  325. olink [4:24 PM]
  326. Point me to the benchmarks
  327.  
  328. olink [4:25 PM]
  329. Plesae
  330.  
  331. olink [4:25 PM]
  332. because finding anything in slack is useless
  333.  
  334. olink [4:25 PM]
  335. especially considering not everyone is on a pc and use the mobile device
  336.  
  337. like2omg [4:25 PM]
  338. @nicatrontg: @olink is right. I experience that exact problem as well
  339.  
  340. nicatrontg [4:26 PM]
  341. http://wildlyinaccurate.com/bcrypt-choosing-a-work-factor/
  342.  
  343. olink [4:26 PM]
  344. I hadnt seen any timings from a server so I assumed there were none, but if I missed them in teh see of spam
  345.  
  346. olink [4:26 PM]
  347. I appologize/
  348.  
  349. olink [4:26 PM]
  350. Ok, so let me take a stab before I click this link
  351.  
  352. olink [4:26 PM]
  353. That you actually never timed your implementation on a terraria server?
  354.  
  355. olink [4:26 PM]
  356. Which is what i am asking for
  357.  
  358. olink [4:27 PM]
  359. Not what some guy tested in his specific use case.
  360.  
  361. nicatrontg [4:27 PM]
  362. Okay, then I haven’t built fucking timing tests on the Terraria server
  363.  
  364. nicatrontg [4:27 PM]
  365. because you know, I have a life
  366.  
  367. olink [4:27 PM]
  368. Ok, so my concern of it potentially being a problem given the increased effort of encryption
  369.  
  370. nicatrontg [4:27 PM]
  371. I thought “this is an easy way to future proof the terraria server, and it won’t take long, I’ll just go do it"
  372.  
  373. olink [4:27 PM]
  374. Was valid
  375.  
  376. olink [4:27 PM]
  377. And you thought being an asshole about a valid concern was mature.
  378.  
  379. olink [4:27 PM]
  380. I get it.
  381.  
  382. nicatrontg [4:28 PM]
  383. No, you’re being an asshole
  384.  
  385. olink [4:28 PM]
  386. Your life is greater than my concern of making shitty software shittier.
  387.  
  388. olink [4:28 PM]
  389. I get it.
  390.  
  391. nicatrontg [4:28 PM]
  392. you’re an asshole
  393.  
  394. olink [4:28 PM]
  395. Sure, after some douch threw mud at me for expressing concern over code being implemented, which is kind of my fucking job here.
  396.  
  397. nicatrontg [4:29 PM]
  398. Nobody appointed you Dr. Criticism
  399.  
  400. simon311 [4:29 PM]
  401. I don't think the work factor is so much of a problem when people can set it to 1 :kappa:
  402.  
  403. nicatrontg [4:29 PM]
  404. your job is not to make TShock Capital P Professional quality software
  405.  
  406. olink [4:29 PM]
  407. Its not critism when its a fucking valid point
  408.  
  409. nicatrontg [4:29 PM]
  410. your job is to help improve it for the user and plugin groups
  411.  
  412. nicatrontg [4:29 PM]
  413. that’s all
  414.  
  415. olink [4:29 PM]
  416. "Oh, effort? Fuck that id rather sit here and argue with you and ignore your concerns because I dont give a fuck about how well our software runs"
  417.  
  418. olink [4:29 PM]
  419. I think youve made your point clear as day
  420.  
  421. olink [4:30 PM]
  422. If i wanted professional quality, id have asked you to remove yourself from the coding team.
  423.  
  424. olink [4:30 PM]
  425. But that isn't what I want.
  426.  
  427. nicatrontg [4:30 PM]
  428. Really?
  429.  
  430. nicatrontg [4:30 PM]
  431. Because it sure feels fucking like it
  432.  
  433. olink [4:30 PM]
  434. You wrote questionable code, and get upset someone critiques it, gg.
  435.  
  436. nicatrontg [4:30 PM]
  437. Fucking really?
  438.  
  439. olink [4:31 PM]
  440. Its questionable until someone times it.
  441.  
  442. nicatrontg [4:31 PM]
  443. MarioE sent me criticism
  444.  
  445. nicatrontg [4:31 PM]
  446. so I fixed it
  447.  
  448. nicatrontg [4:31 PM]
  449. it looks good to him
  450.  
  451. nicatrontg [4:31 PM]
  452. in fact, nothing was *wrong* with the initial implementation; it worked *fine*
  453.  
  454. olink [4:31 PM]
  455. It can look as good as Brad Pitt, doesnt mean hes a good actor.
  456.  
  457. nicatrontg [4:31 PM]
  458. the only thing that was wrong was minor style changes in brackets and some other bugs that I didn’t know about and fixed because they’re present in the current version
  459.  
  460. olink [4:32 PM]
  461. Yes, sure, so one developer decided not to ask you how fast it was.
  462.  
  463. olink [4:32 PM]
  464. Guess what?
  465.  
  466. olink [4:32 PM]
  467. I did.
  468.  
  469. nicatrontg [4:32 PM]
  470. I’m not being paid to develop this software
  471.  
  472. nicatrontg [4:32 PM]
  473. I’m not going to go write a giant test suite in Terraria of all things, to test one crypto library
  474.  
  475. olink [4:33 PM]
  476. A test suite? Must suck being such a bad developer to not be able to implement a simple timer.
  477.  
  478. nicatrontg [4:33 PM]
  479. when the work factor is quite obviously 2^work factor calculations
  480.  
  481. olink [4:33 PM]
  482. Can I direct you to google?
  483.  
  484. nicatrontg [4:33 PM]
  485. Get out.
  486.  
  487. olink [4:33 PM]
  488. Naw, I think we can both say whatever we want.
  489.  
  490. nicatrontg [4:33 PM]
  491. Leave, bye, adios
  492.  
  493. olink [4:33 PM]
  494. You dont want to listen to me.
  495.  
  496. olink [4:33 PM]
  497. I dont want to listen to you, its mutal.
  498.  
  499. nicatrontg [4:33 PM]
  500. Your business is appreciated, thanks.
  501.  
  502. olink [4:33 PM]
  503. mutual*
  504.  
  505. olink [4:36 PM]
  506. slackbot [6:35 PM]
  507. You have been removed from the group admins by @nicatrontg
  508.  
  509. alerek [4:40 PM]
  510. improving on code is not cause for butthurt, just saying
  511.  
  512. alerek [4:41 PM]
  513. pls dont act demickey and get along
  514.  
  515. simon311 [4:41 PM]
  516. >improving the code
  517.  
  518. simon311 [4:42 PM]
  519. I thought they were arguing about whetever it is improving or not
  520.  
  521. simon311 [4:42 PM]
  522. But yeah, still no reason for that big of a fight
  523.  
  524. alerek [4:42 PM]
  525. i dont know and i dont care, all that matters is a suggestion was mmade, should be considered just like anything else and etc etc
Advertisement
Add Comment
Please, Sign In to add comment