Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light client crashes #22259

Closed
rjl493456442 opened this issue Feb 1, 2021 · 3 comments · Fixed by #22377
Closed

Light client crashes #22259

rjl493456442 opened this issue Feb 1, 2021 · 3 comments · Fixed by #22377
Assignees
Labels

Comments

@rjl493456442
Copy link
Member

Light client will crash if the first connection comes too fast

[b607cc39] panic: state machine not started yet
[b607cc39]
[b607cc39] goroutine 232 [running]:
[b607cc39] github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).checkStarted(...)
[f489634f] DEBUG[02-01|05:13:30.443] Adding p2p peer                          peercount=1 id=298480aacb598f29 conn=inbound          addr=172.17.0.4:49732 name=Geth/v1.9.26-unstabl..
.
[f489634f] TRACE[02-01|05:13:30.443] Starting protocol les/3                  id=298480aacb598f29 conn=inbound
[f489634f] DEBUG[02-01|05:13:30.443] Light Ethereum peer connected            id=298480aacb598f29 conn=inbound          name=Geth/v1.9.26-unstabl...
[f489634f] DEBUG[02-01|05:13:30.443] Client connected                         id=298480aacb598f29
[f489634f] DEBUG[02-01|05:13:30.443] Client activated                         id=298480aacb598f29
[f489634f] DEBUG[02-01|05:13:30.447] Light Ethereum message handling failed   id=298480aacb598f29 conn=inbound          err=EOF
[f489634f] DEBUG[02-01|05:13:30.447] Client disconnected                      id=298480aacb598f29
[f489634f] DEBUG[02-01|05:13:30.448] Removing p2p peer                        peercount=0 id=298480aacb598f29 duration=4.600ms req=false err=EOF
[b607cc39]      github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:412
[b607cc39] github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).setState(0xc0006da620, 0xc0001aa1c0, 0x40, 0x1c44220, 0x30, 0x1c44220, 0x0)
[b607cc39]      github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:647 +0x746
[b607cc39] github.com/ethereum/go-ethereum/p2p/nodestate.(*NodeStateMachine).SetState(0xc0006da620, 0xc0001aa1c0, 0x40, 0x1c44220, 0x30, 0x1c44220, 0x0, 0x0, 0x0)
[b607cc39]      github.com/ethereum/go-ethereum/p2p/nodestate/nodestate.go:631 +0xdc
[b607cc39] github.com/ethereum/go-ethereum/les.(*serverPool).registerPeer(0xc00000c3c0, 0xc000bf88c0)
[b607cc39]      github.com/ethereum/go-ethereum/les/serverpool.go:283 +0xe5
[b607cc39] github.com/ethereum/go-ethereum/les.(*serverPeerSet).register(0xc00033f080, 0xc000bf88c0, 0x0, 0x0)
[b607cc39]      github.com/ethereum/go-ethereum/les/peer.go:1133 +0x165
[b607cc39] github.com/ethereum/go-ethereum/les.(*clientHandler).handle(0xc000510ae0, 0xc000bf88c0, 0x0, 0x0)
[b607cc39]      github.com/ethereum/go-ethereum/les/client_handler.go:118 +0x445
[b607cc39] github.com/ethereum/go-ethereum/les.(*clientHandler).runPeer(0xc000510ae0, 0x3, 0xc0006dd080, 0x156f720, 0xc000342640, 0x0, 0x0)
[b607cc39]      github.com/ethereum/go-ethereum/les/client_handler.go:101 +0x158
[b607cc39] github.com/ethereum/go-ethereum/les.(*lesCommons).makeProtocols.func1(0xc0006dd080, 0x156f720, 0xc000342640, 0x0, 0x0)
[b607cc39]      github.com/ethereum/go-ethereum/les/commons.go:85 +0x4c
[b607cc39] github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols.func1(0xc0006dd080, 0xc000342640, 0x156f720, 0xc000342640)
[b607cc39]      github.com/ethereum/go-ethereum/p2p/peer.go:389 +0x98
[b607cc39] created by github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols
[b607cc39]      github.com/ethereum/go-ethereum/p2p/peer.go:387 +0x205
@holiman
Copy link
Contributor

holiman commented Feb 18, 2021

func (ns *NodeStateMachine) checkStarted() {
	if !ns.started {
		panic("state machine not started yet")
	}
}

Seems like this should be pretty trivial to fix, @zsfelfoldi ?

@rjl493456442
Copy link
Member Author

It's detected by hive framework. In order to fix it, an ugly hack is added https://github.com/ethereum/hive/pull/424/files#diff-45f4450112c9a4f924a720ea987fe5f2ec14674f3df283df011547a2eb6dc9a6R138

@zsfelfoldi
Copy link
Contributor

Fixed by #22297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants