Bitcoin Forum
April 27, 2024, 02:37:17 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 »  All
  Print  
Author Topic: MtGox source code leaked ...  (Read 18974 times)
Bit_Happy
Legendary
*
Offline Offline

Activity: 2100
Merit: 1040


A Great Time to Start Something!


View Profile
March 03, 2014, 09:51:47 PM
 #41

This does look ugly:

 Some random red flags:

- There's a class with the name of the application. (Issues: Scope, SRP)

- There's a class with 1708 lines of code. (Scope)

- There's a switch-case statement that runs over 150 LOC (readability, maintainability)

- There's a string parsing function in the same class as transaction processing (Separation of concerns)

- There are segments of code commented out (are they not using source control?)

- There's inlined SQL (maintainability, security)

- There's JSON being generated manually & inline (SoC, DRY)
- There's XML being generated manually & inline (SoC, DRY)
- To sum up function _Route_getStats($path): XML production, JSON production, file writing, business logic, SQL commands, HTTP header fiddling, hard coded paging limits, multiple exit points...
The amount of refactoring needed here to bring this code up to acceptable quality is simply staggering.

1714185437
Hero Member
*
Offline Offline

Posts: 1714185437

View Profile Personal Message (Offline)

Ignore
1714185437
Reply with quote  #2

1714185437
Report to moderator
The Bitcoin software, network, and concept is called "Bitcoin" with a capitalized "B". Bitcoin currency units are called "bitcoins" with a lowercase "b" -- this is often abbreviated BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714185437
Hero Member
*
Offline Offline

Posts: 1714185437

View Profile Personal Message (Offline)

Ignore
1714185437
Reply with quote  #2

1714185437
Report to moderator
1714185437
Hero Member
*
Offline Offline

Posts: 1714185437

View Profile Personal Message (Offline)

Ignore
1714185437
Reply with quote  #2

1714185437
Report to moderator
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
March 03, 2014, 09:59:30 PM
 #42

Umm, Facebook was built on PHP

Yeah, maybe once upon a time back then. But much less so today. And nobody in their right mind would trust friggin nsabook with their wealth...
user311
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
March 03, 2014, 10:02:36 PM
 #43

i wouldn't be surprised if the alleged 20GB of data comes up for sale
I guarantee you it is. There is no doubt the encrypted passwords (if gox even encrypted the database) are being sent through the grinder as we speak. Everyone should change their passwords if they used the same one on Gox!

Glad I didn't complet my registration ont heir website, I was about to sent them my passport, and what's not info, and when I saw how complex the process compared back I back peddaled and didn't confirm the uploaded documents I uploaded at the time
haha. SO... you uploaded your personal information to their servers (Now take time to think about that) but didnt click accept to complete the process. My advice: Get lifelock.
crazy_rabbit
Legendary
*
Offline Offline

Activity: 1204
Merit: 1001


RUM AND CARROTS: A PIRATE LIFE FOR ME


View Profile
March 03, 2014, 10:17:20 PM
 #44

oh man, please don't let this be legit.....

more or less retired.
meanig
Hero Member
*****
Offline Offline

Activity: 531
Merit: 501


View Profile
March 03, 2014, 10:25:49 PM
 #45

Is there anything in the code to suggest that the cold wallet was actually online?
CompNsci
Sr. Member
****
Offline Offline

Activity: 332
Merit: 253


View Profile
March 03, 2014, 10:36:47 PM
 #46

My impression was that supposedly they implemented a new trading engine to speed up transactions after the meltdown.

Does the PHP code look like a new sped up trading engine? Or is it more likely the code used prior to that time?

crazy_rabbit
Legendary
*
Offline Offline

Activity: 1204
Merit: 1001


RUM AND CARROTS: A PIRATE LIFE FOR ME


View Profile
March 03, 2014, 10:37:36 PM
 #47

My impression was that supposedly they implemented a new trading engine to speed up transactions after the meltdown.

Does the PHP code look like a new sped up trading engine? Or is it more likely the code used prior to that time?



I think the trading engine was in the backend. Correct me if I'm wrong, but this looks like the front end to me?

more or less retired.
bananas
Sr. Member
****
Offline Offline

Activity: 364
Merit: 257


View Profile
March 03, 2014, 10:41:29 PM
Last edit: March 03, 2014, 10:59:16 PM by bananas
 #48

My impression was that supposedly they implemented a new trading engine to speed up transactions after the meltdown.

Does the PHP code look like a new sped up trading engine? Or is it more likely the code used prior to that time?



I think the trading engine was in the backend. Correct me if I'm wrong, but this looks like the front end to me?

it is the more like the  "back" but not exaclty it, that's a class with their full colection of functions...there is no code with the front(or back) end logic using those functions. But everything is there to do so.
cAPSLOCK
Legendary
*
Offline Offline

Activity: 3738
Merit: 5127


Whimsical Pants


View Profile
March 03, 2014, 10:45:56 PM
 #49

Um this goes far beyond "not perfect".  It essentially breaks every rule in software design, resulting in a fragile, unmaintainable mess.

Projects written by a single person don't need to be developed as academics say. If u were an owner of an exchange and didn't trust to any other coder u would go the same way.


YipYip
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500



View Profile
March 03, 2014, 11:26:04 PM
 #50

I prefer one monster super class...

Well I think we are done. 

Php ....lolz

MySQL...lolz

SpagettiCode...lolz

What does this all of the above bullshit add upto ....loss of 450million ++

All code should be loosely coupled & highly cohesive ... i.e dependency injection, discreete components that have no depenceys on each other.... break down of the layers UI,Business logic, middleware ...repos...etc etc etc

Gox was a darwin experiment that shows a decrepid , disabled piece of shit is destined to die

GOX IS DEAD.... LONG LIVE THE DEATH OF GOX Tongue


OBJECT NOT FOUND
vit1988
Sr. Member
****
Offline Offline

Activity: 313
Merit: 250


i ♥ coinichiwa


View Profile WWW
March 04, 2014, 12:00:55 AM
 #51

I've seen so much bad code in my life... even in enterprise systems... this one looks quite average  Grin

But not using curly brackets alone is something a developer should goto hell for.

elebit
Sr. Member
****
Offline Offline

Activity: 441
Merit: 250


View Profile
March 04, 2014, 12:04:25 AM
 #52

Does Deutsche Bank use php? Does HSBC use fucking MYSQL???

I can assure you that there are many MySQL instances inside any bank you could point your finger at. Several of them business critical for their respective environments.

It is guaranteed to be a lot of PHP too, just not customer facing. Banks are big things with lots of IT.
Cluster2k
Legendary
*
Offline Offline

Activity: 1692
Merit: 1018



View Profile
March 04, 2014, 12:24:41 AM
 #53

If people are shocked by the quality of code seen from MtGox, you should stop using your bank, abandon your car and ditch your mobile phone.  There are mountains of legacy spaghetti code out there that are completely written against proper academic rules.  You use the code every day for critical applications.
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 04, 2014, 01:05:46 AM
Last edit: March 04, 2014, 01:22:12 AM by DeathAndTaxes
 #54

If people are shocked by the quality of code seen from MtGox, you should stop using your bank, abandon your car and ditch your mobile phone.  There are mountains of legacy spaghetti code out there that are completely written against proper academic rules.  You use the code every day for critical applications.

MtGox was created in 2010, it was a greenfield project.  Most developers relish the idea of working on a greenfield projects because it doesn't require them to drag forward decades of legacy cludge and instead allows them to do it right (at least initially).  Kinda hard to compare that to a banking system which may have its roots going back forty years and be the net results of multiple acquired and merged systems.  For long runnning enterprise applications, developers are rarely given the option to make a clean break.  MtGox didn't have that problem.  It started with an empty text file and ended up resembling systems which get that way after decades of hacks, workarounds, and patches. 

Sometimes a spade is a spade and you can just call it that.  MtGox's transaction engine was so bad it would choke at 5 tps despite running on server hardware capable of 1000x that (two very high end dedicated servers).  Yes facebook's early roots were in php (it has long since been converted to C++) but facebook would never have scaled to even a million users if its codebase was this bad.  Today we would be saying "facebook who?" instead of it being a household name if the code wasn't scalable.   

There is no excuse or justification for code this bad.  None.  Period.  Anyone offering it just looks silly.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
March 04, 2014, 01:15:51 AM
 #55

Does Deutsche Bank use php? Does HSBC use fucking MYSQL???

I can assure you that there are many MySQL instances inside any bank you could point your finger at. Several of them business critical for their respective environments.

It is guaranteed to be a lot of PHP too, just not customer facing. Banks are big things with lots of IT.
No wonder they are all collapsing, needing a bail out every 5 minutes...

Let me tell u that I have worked with ING code and they use GOTO !!!
*closes account*
YipYip
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500



View Profile
March 04, 2014, 01:54:00 AM
 #56

Does Deutsche Bank use php? Does HSBC use fucking MYSQL???

I can assure you that there are many MySQL instances inside any bank you could point your finger at. Several of them business critical for their respective environments.

It is guaranteed to be a lot of PHP too, just not customer facing. Banks are big things with lots of IT.

Hmmmm.... not really ...not in the golden circle of large blue chip banks

A bank will have a core apps platform maybe 30-100 apps and I gurantee there wont be mysql & php kicking around

OBJECT NOT FOUND
YipYip
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500



View Profile
March 04, 2014, 01:56:52 AM
 #57

If people are shocked by the quality of code seen from MtGox, you should stop using your bank, abandon your car and ditch your mobile phone.  There are mountains of legacy spaghetti code out there that are completely written against proper academic rules.  You use the code every day for critical applications.

MtGox was created in 2010, it was a greenfield project.  Most developers relish the idea of working on a greenfield projects because it doesn't require them to drag forward decades of legacy cludge and instead allows them to do it right (at least initially).  Kinda hard to compare that to a banking system which may have its roots going back forty years and be the net results of multiple acquired and merged systems.  For long runnning enterprise applications, developers are rarely given the option to make a clean break.  MtGox didn't have that problem.  It started with an empty text file and ended up resembling systems which get that way after decades of hacks, workarounds, and patches. 

Sometimes a spade is a spade and you can just call it that.  MtGox's transaction engine was so bad it would choke at 5 tps despite running on server hardware capable of 1000x that (two very high end dedicated servers).  Yes facebook's early roots were in php (it has long since been converted to C++) but facebook would never have scaled to even a million users if its codebase was this bad.  Today we would be saying "facebook who?" instead of it being a household name if the code wasn't scalable.   

There is no excuse or justification for code this bad.  None.  Period.  Anyone offering it just looks silly.

+ Agreed

OBJECT NOT FOUND
itsunderstood
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250


American1973


View Profile
March 04, 2014, 02:08:13 AM
 #58

Hmmmm.... not really ...not in the golden circle of large blue chip banks

A bank will have a core apps platform maybe 30-100 apps and I gurantee there wont be mysql & php kicking around

And assloads more capital due to fractionalized fiat debtmonies, yes.

No way can an average human compete with the corporate model, especially in finance.

Check out my prescient ATS thread from 2008: "Windows XP: End the Cyberwar, Open the Code Now!" http://www.abovetopsecret.com/forum/thread411978/pg1
thelema93
Sr. Member
****
Offline Offline

Activity: 339
Merit: 250


View Profile
March 04, 2014, 02:49:31 AM
 #59

http://www.techworm.net/2014/03/mtgox-source-code-leaked-by-hacker-on.html

As a developer all I can say is ...
I have nothing to say just stunned silence that this was the codebase used to process millions of dollars and BTC everyday.

I have one word to say:

French

bananas
Sr. Member
****
Offline Offline

Activity: 364
Merit: 257


View Profile
March 04, 2014, 02:51:03 AM
 #60

There is nothing wrong with PHP or any other language, they all do absolutely the same thing. Banking systems are mostly ancient writen in obsolete languages, and they do work fine. It is up to the programmer, not the language.
Pages: « 1 2 [3] 4 5 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!