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

Panic issue when the options related with light node are on. (panic: runtime error: index out of range) #18385

Closed
KadenKim opened this issue Jan 3, 2019 · 5 comments
Assignees

Comments

@KadenKim
Copy link

KadenKim commented Jan 3, 2019

Geth version: v1.8.20
OS & Version: Linux - CentOS 7

Expected behaviour

Geth daemon should be operated stably with peer related options.

Actual behaviour

While the geth daemon is syncing as full node, suddenly it is shut down with below error messages.

panic: runtime error: index out of range

goroutine 7381 [running]:
github.com/ethereum/go-ethereum/common/prque.(*sstack).Swap(0xc00e340280, 0x0, 0xffffffffffffffff)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/common/prque/sstack.go:95 +0x1ef
container/heap.Pop(0x11f1340, 0xc00e340280, 0x6e9801, 0xc02365f930)
/home/travis/.gimme/versions/go1.11.2.linux.amd64/src/container/heap/heap.go:64 +0x64
github.com/ethereum/go-ethereum/common/prque.(*Prque).PopItem(0xc00e2f4040, 0xc00e2ec420, 0xc053872cb0)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/common/prque/prque.go:33 +0x3a
github.com/ethereum/go-ethereum/les.(*freeClientPool).connect(0xc00e2fe310, 0xc053872cb0, 0xd, 0xc033088120, 0x0)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/les/freeclient.go:115 +0x32f
github.com/ethereum/go-ethereum/les.(*ProtocolManager).handle(0xc00b72e620, 0xc06a5e6210, 0x0, 0x0)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/les/handler.go:269 +0xa3b
github.com/ethereum/go-ethereum/les.(*ProtocolManager).runPeer(0xc00b72e620, 0x2, 0xc06a14e8a0, 0x11e7f80, 0xc056bc0a20, 0x0, 0x0)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/les/handler.go:223 +0x223
github.com/ethereum/go-ethereum/les.(*lesCommons).makeProtocols.func1(0xc06a14e8a0, 0x11e7f80, 0xc056bc0a20, 0x0, 0x0)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/les/commons.go:64 +0x55
github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols.func1(0xc056bc0a20, 0xc06a14e8a0, 0x11e7f80, 0xc056bc0a20)
/home/travis/gopath/src/github.com/ethereum/go-ethereum/p2p/peer.go:361 +0x66
created by github.com/ethereum/go-ethereum/p2p.(*Peer).startProtocols
/home/travis/gopath/src/github.com/ethereum/go-ethereum/p2p/peer.go:360 +0x1fb

Steps to reproduce the behaviour

Start geth with below options.
/home/eth/geth-v1.8.20/geth --maxpeers 110 --lightserv 70 --lightpeers 0

After then, with in a day, (sometimes with in 5 minutes) the geth daemon is shut down.
The propose of '--lightpeers 0' is that I don't want to attach unknown light node to my full node.
So, I set --lightpeers as 0, and I added my light node information at ~/.ethereum/geth/trusted-nodes.json.
This issue was generated regardless of the existence of 'trusted-nodes.json' file.
The geth daemon was operated well with those options using geth-v1.8.11.
However, this issue was came up on both of v1.8.19 and v1.8.20.
I didn't check at the versions from v1.8.12 to v1.8.18.

If I add '--nodiscover' option and add peers using 'admin.addPeer', then the geth daemon is not dead.

Please check this issue as soon as possible.
I should apply v1.8.20 before Constantinople hard fork.

@zsfelfoldi
Copy link
Contributor

This is caused by a setting which I did not think about because it makes no sense (enabling light service but allowing zero peers). Still, I will add a check of course.

@KadenKim
Copy link
Author

KadenKim commented Jan 7, 2019

Thanks. I set '--lightpeers' value as '1' 3 days ago, and the Geth daemon has not shut down yet.
In my conception, the peers, listed on 'trusted-nodes.json' file, are not counted on at 'lightpeers', but those are counted on at 'maxpeers'. Is it right?
So, if I want to make my full node connect with 100 light nodes, all nodes are operated on my control, then I must set the value of 'maxpeers' more than 101, and lightpeers as 1.
For example, --maxpeers 130( 100 is for my light nodes which are listed on 'trusted-nodes.json' file, 1 is for other light nodes, and 29 is for p2p operation full nodes), --lightpeers 1.
Please check my conception is right or not.
I'm grateful for your help.

@holiman
Copy link
Contributor

holiman commented Feb 7, 2019

@zsfelfoldi any progress on this?

@holiman
Copy link
Contributor

holiman commented Jun 19, 2019

@zsfelfoldi please close if fixed

@zsfelfoldi
Copy link
Contributor

Fixed

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

No branches or pull requests

4 participants