이메일 #076 - #080
원본 출처: Satoshi - Sirius emails 2009-2011
이메일 #076
Date: Thu, 12 Nov 2009 05:36:06 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Linux - linux-0.1.6-test3
To: Liberty Standard <[email protected]>
Cc: Martti Malmi <[email protected]>
한글 번역
지금(그리니치 표준시 04시 50분) 제 노드가 당신의 노드에 연결을 시도하는데 매번 좀비 연결이 생깁니다. 소켓이 오류를 돌려주지도 않고, 그냥 아무런 알림 없이 좀비 상태가 됩니다. 지금 리눅스 빌드를 실행 중이라면, 당신 쪽 로그에 뭐라고 나오는지 보면 흥미로울 것 같습니다.
test3:
좀비 소켓을 감지하는 전용 코드를 넣었습니다. 연결된 지 60초 안에 데이터를 한 번도 주고받지 않은 소켓이 있는지 감지하고, 보낼 데이터가 쌓여 있는데 3분 동안 전송되지 않은 경우도 감지합니다.
test2에서는 다시 연결하는 속도를 아마 약하게 만든 것 같습니다. test3에서는 빨리 다시 연결하도록 더 적극적으로 만들었습니다.
당신이 생성한 블록을 다른 노드들이 받았는지 추적하는 확인 기능을 넣었습니다. 아무도 받지 못했다면 설명란에 이렇게 경고가 뜹니다: "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
당신이 만든 블록이나 트랜잭션이 다른 노드들에 전혀 전파되지 않으면, 상태가 "#/offline?"로 바뀔 수 있습니다.
이렇게 해 두면, 문제가 생기자마자 알아채지 못할 수가 없을 겁니다. 좀비 소켓도 모두 끊어 주길 바랍니다. 그 뒤에 제대로 된 연결을 몇 개 만들 수 있을지, 아니면 소켓이 완전히 망가져서 연결 수가 0에 머물지는 모르겠습니다.
이래도 안 되면, BitTorrent 같은 다른 P2P 앱의 소스 코드를 보고 그쪽에서 이런 문제를 어떻게 처리하는지 살펴보려고 합니다. 소켓 시스템을 다시 살려내는 무슨 마법 같은 플래그나 절차가 있을지도 모르겠습니다.
파일 linux-0.1.6-test3.tar.bz2는 다음 메시지에 첨부합니다.
Liberty Standard 작성:
2009년 11월 11일 수요일 오전 8시 8분, Liberty Standard <[email protected] <mailto:newlibertystandard@gmail.com>> 작성:
네트워크 연결은 제 컴퓨터에 직접 연결되어 있습니다. 제 인터넷 서비스 업체에서는 인터넷에 연결하려면 VPN을 실행해야 합니다. 그리고 두 번째 NIC로 다른 기기들과 인터넷을 공유합니다. 제 컴퓨터를 쓸 때의 IP 주소는 실제 IP 주소 그대로이지만, 두 번째 NIC를 통해 연결된 기기들은 NAT를 씁니다. 가상 머신을 통해 연결할 때도 NAT를 씁니다. 이 모든 설정에는 거의 손댈 게 없습니다. 우분투의 NetworkManager에는 두 번째 NIC를 통해 인터넷 연결을 공유하는 옵션이 있고, VirtualBox에도 NAT를 쓰는 옵션이 있습니다.
비트코인을 두 묶음 또 잃어버렸으니, 그 문제는 아직 고쳐지지 않았습니다. 무슨 일인지 감이 잡히니 조금 견딜 만합니다. 지금으로서는 비트코인 묶음이 성숙해지기 시작하는 게 보이면 일단 비트코인을 다시 시작하려고 합니다. 리눅스와 Wine을 오가며 쓸 수도 있겠지만, 새 버전이 나오면 반드시 매번 테스트하겠습니다. 지금은 아직 리눅스 빌드를 실행 중입니다.
2009년 11월 11일 수요일 오전 7시 49분, Satoshi Nakamoto <[email protected] <mailto:satoshin@gmx.com>> 작성:
고맙습니다. 로그는 특별한 데서 멈춘 게 아니라 그냥 단순한 메시지 전달 중이었습니다. UI와 관련되었을 가능성이 큽니다. 초기의 버그는 대부분 UI였습니다.
방화벽 브랜드와 모델이 무엇입니까? BitTorrent가 일부 모델이 감당할 수 있는 연결 수를 넘어서 과부하를 일으킬 수 있습니다. 대부분은 성능이 부족하고 부하가 걸리면 불안정합니다.
NewLibertyStandard 작성:
첨부 파일은 잘 받고 있습니다. 그냥 마르티에게 큰 첨부 파일을 보내지 않으려던 것뿐입니다.
그 버그를 재현하지 못했습니다. 붙여넣기 때문인지, 블록 마무리 때문인지, 둘이 겹쳐서인지, 아니면 전혀 다른 뭔가 때문인지 모르겠습니다.
...
그런데 다운로드가 시작되고 나서 제 BitTorrent 클라이언트를 보니, 아니나 다를까, 토렌트 하나를 잊고 있었고 제 업로드는 제가 정해 둔 한도까지 꽤 높게 올라 있었습니다.
영어 원문
Right now (04:50 GMT) my node is connecting to yours and getting zombie
connections each time. The socket isn't returning an error, just zombie
without notice. If you're running the linux build right now, it would
be interesting to see what the log says on your side.
test3:
I've added specific code to detect zombie sockets. It'll detect if the
socket hasn't sent or received any data within 60 seconds of connecting,
and detect if data is queued to send and hasn't sent for 3 minutes.
I think I may have weakened the reconnect speed in test2. In test3 I'm
making it more determined to reconnect quickly.
I added checking to track whether other nodes received your generated
blocks. If none did, it'll warn you in the description:
"Generated - Warning: This block was not received by any other nodes and
will probably not be accepted!"
The status can go to "#/offline?" for blocks or transactions you create
if they don't get out to any other nodes.
With all this, it should be impossible not to notice as soon as it
screws up. It should hopefully disconnect all the zombie sockets.
After that, whether it's able to make some good connections, or sockets
is completely hosed and it stays at 0 connections, I don't know.
If this doesn't work, I guess I'll look at the sourcecode of some other
P2P apps like BitTorrent and see how they deal with this stuff. Maybe
there's some magic flag or procedure to bash the sockets system back to
life.
File linux-0.1.6-test3.tar.bz2 attached in the next message.
Liberty Standard wrote:
> On Wed, Nov 11, 2009 at 8:08 AM, Liberty Standard
> <[email protected] <mailto:[email protected]>> wrote:
>
> My network connection is direct to my computer. My ISP requires that
> I run VPN to connect to the Internet. I then have a second NIC that
> shares my Internet with other devices. My IP address while using my
> computer is my actual IP address, but the devices connected through
> my second NIC use NAT. When I connect through a virtual machine,
> that also uses NAT. All this requires very little configuration.
> NetworkManager in Ubuntu has an option to share my Internet
> connection through the second NIC and VirtualBox has the option to
> use NAT.
>
> I lost a couple packs of bitcoins again, so that problem is not yet
> fixed. It's a bit more bearable now that I have an idea of what is
> going on. I figure for now I'll just restart bitcoin whenever I see
> a pack of bitcoins starting to mature. I may go back and forth a bit
> between Linux and Wine, but I'll definitely test every new version
> that comes out. At the moment I'm still running the Linux build.
>
>
>
> On Wed, Nov 11, 2009 at 7:49 AM, Satoshi Nakamoto <[email protected]
> <mailto:[email protected]>> wrote:
>
> Thanks. The log didn't stop on anything special, just simple
> message passing. Chances are it's UI related. Most of the
> initial bugs were all UI.
>
> What brand/model of firewall do you have? It's possible for
> BitTorrent to overwhelm the number of connections some models
> can handle. Most are underpowered and flaky under load.
>
> NewLibertyStandard wrote:
>
> I have been getting your attachments just fine. I just
> thought I'd spare Martti the large attachment.
>
> I am not able to reproduce the bug. I don't know whether the
> paste, the blocks finishing, a combination of the two or
> something else entirely caused the fault.
>
> ...
>
> But after they started
> downloading, I took a look a look at my BitTorrent
> client, and
> sure enough, I had forgotten about a torrent and my
> upload was
> quite high, at the limit I had set for it.
>
>
>
>
>
이메일 #077
Date: Thu, 12 Nov 2009 05:37:58 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: linux-0.1.6-test3.tar.bz2 attached
To: Liberty Standard <[email protected]>
Cc: Martti Malmi <[email protected]>
한글 번역
파일 linux-0.1.6-test3.tar.bz2를 첨부합니다.
linux-0.1.6-test3.tar.bz2 12,143,473 바이트
영어 원문
File linux-0.1.6-test3.tar.bz2 attached
linux-0.1.6-test3.tar.bz2 12,143,473 bytes
이메일 #078
Date: Thu, 12 Nov 2009 23:39:44 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: linux-0.1.6-test5 fix for zombie sockets
To: Liberty Standard <[email protected]>
Cc: Martti Malmi <[email protected]>
한글 번역
test 5:
소켓이 논블로킹이라는 걸 잊은 경우에 대비해 send와 recv 호출에 MSG_DONTWAIT를 넣었습니다. 그래도 안 되면, 이제 만능 해결책이 있습니다. 다른 스레드가 send/recv 스레드를 감시하다가 멈추면 종료하고 다시 시작합니다. debug.log에는 "*** Restarting ThreadSocketHandler ***"라고 찍히고, 상태 표시줄에도 한동안 오류 메시지가 표시됩니다.
종료하기 전에 먼저 멈춘 소켓을 닫아 봅니다. 그게 통하면 굳이 종료까지 갈 필요가 없습니다.
스레드를 1000번 정도 종료하는 테스트를 문제없이 돌려 봤으니 안전할 겁니다. 리눅스에서의 종료는 pthread_cancel인데, 이게 C++의 예외 처리기로 던져 줍니다.
우리가 쓰던 스레드 호출에는 종료 기능이 없어서, util.h에 우리 전용 래퍼를 만들어 윈도우에서는 CreateThread를, 리눅스에서는 pthread_create를 쓰도록 했습니다. 대신 이렇게 하지 않았습니다: _beginthread는 윈도우 전용이고 종료 기능이 없습니다 boost::thread는 정말 매력적이지만 종료 기능이 없습니다 wxThread는 호출할 만한 함수마다 클래스를 만들어야 합니다 (별로입니다)
파일은 다음 이메일 메시지에 첨부합니다.
영어 원문
test 5:
I added MSG_DONTWAIT to the send and recv calls in case they forgot the
socket is non-blocking. If that doesn't work, there's now the catch-all
solution: another thread monitors the send/recv thread and terminates
and restarts it if it stops. It prints "*** Restarting
ThreadSocketHandler ***" in debug.log, and an error message displays on
the status bar for a while.
Before terminating, it tries closing the socket that's hung. If that
works, it doesn't have to resort to terminating.
I ran a test where it terminated the thread about 1000 times without
trouble, so it should be safe. The terminate on linux is
pthread_cancel, which throws it into C++'s exception handler.
The thread calls we were using didn't have terminate, so I created our
own wrappers in util.h to use CreateThread on windows and pthread_create
on linux, instead of:
_beginthread is windows only and lacks terminate
boost::thread is really attractive, but lacks terminate
wxThread requires you to create a class for every function you might
call (yuck)
File attached in the next e-mail
이메일 #079
Date: Thu, 12 Nov 2009 23:42:29 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: linux-0.1.6-test5.tar.bz2 attached
To: Liberty Standard <[email protected]>
Cc: Martti Malmi <[email protected]>
한글 번역
12,033,918 linux-0.1.6-test5.tar.bz2
영어 원문
12,033,918 linux-0.1.6-test5.tar.bz2
이메일 #080
Date: Sat, 14 Nov 2009 05:46:22 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Zetaboards forum
To: Martti Malmi <[email protected]>
한글 번역
Zetaboards에 포럼을 만들었습니다. InvisionFree가 이전 중인 새 사이트입니다.
http://s1.zetaboards.com/Bitcoin/index/
당신의 계정을 관리자로 올리는 데 쓸 수 있는 관리자 계정을 만들었습니다: u: admin pw: B98VzUUA
참고로, 관리자 페이지는 위에 빈 공간이 크게 있으니 아래로 스크롤해야 합니다.
SSL은 지원하지 않는데, 그런 곳들은 다 그렇습니다. 못생긴 기본 주황색과 파란색 테마를 Frostee 테마로 바꿨습니다. 샅샅이 찾아보고 그나마 봐줄 만했던 유일한 테마였습니다. 테마를 찾는 건 헛수고입니다. 쓰레기 같은 테마가 수천 개 있습니다. 알고 보니 해법은 버튼 세트를 보는 것이더군요 (http://resources.zetaboards.com/forum/1000328/)
처음에는 하위 포럼을 두 개만 만들었습니다. 필요해지면 새로 만들겠습니다. 하위 항목을 정당화할 만큼 내용이 쌓이기 전까지는 평평한 이름 공간으로 시작하는 걸 좋아합니다. Technical Support는 별도 섹션으로 두는 게 맞습니다. 그런 내용을 주요 무대에서 치워서 우리의 궂은일이 모두의 눈에 띄지 않게 하고, 사람들이 거기서는 버그를 더 편하게 보고하도록 하려는 것입니다. Technical Support 섹션은 대부분 개발자와 버그를 확인하는 사람만 보면 됩니다.
영어 원문
I created a forum on Zetaboards, InvisionFree's new site that they're
migrating to.
http://s1.zetaboards.com/Bitcoin/index/
I made an admin account you can use to upgrade your own account to admin:
u: admin
pw: B98VzUUA
BTW, the admin pages have a huge blank space at the top, you have to
scroll down.
It doesn't support SSL, but none of them do. I replaced the ugly
default orange and blue theme with the Frostee theme, which was the only
decent looking theme I could find after extensive searching. Searching
for themes is futile, there are thousands of rubbish themes. It turns
out the solution is to look at button sets instead
(http://resources.zetaboards.com/forum/1000328/)
I only created two subforums to begin with. I'll create new ones as the
need arises. I like to start with a flat namespace until there's enough
items to justify subsections. Technical Support makes sense as a
separate section to get that stuff out of the main spotlight so our
dirty laundry isn't in everyone's face, and to make people feel more
free to report bugs there. Mostly only devs and people checking on a
bug need read the Technical Support section.