bnb-chain / bsc

A BNB Smart Chain client based on the go-ethereum fork
GNU Lesser General Public License v3.0
2.69k stars 1.55k forks source link

light node - no suitable peers available #702

Closed clsdubai closed 1 year ago

clsdubai commented 2 years ago

I am using a light node v1.1.7, when sending requests to GetBalance, the following error occurs: WARN [01-06|17:29:47.817] Served eth_getBalance reqid=1 t=3.0091902s err="getDeleteStateObject (295e26495cef6f69dfa69911d9d8e4f3bbadb89a) error: no suitable peers available"

before that there were such errors: WARN [01-06|14:33:28.035] Served eth_call reqid=1 t=21.046081163s err="execution aborted (timeout = 5s)" X-Forwarded-For=nil

net.peerCount returns 16. firewall is inactive.

started geth with arguments: --config=D:\config.toml --metrics --metrics.addr 0.0.0.0 --cache 8192 --syncmode light --diffsync

config.toml:

[Eth]
NetworkId = 56
NoPruning = false
NoPrefetch = false
LightPeers = 100
UltraLightFraction = 75
TrieTimeout = 100000000000
EnablePreimageRecording = false
EWASMInterpreter = ""
EVMInterpreter = ""

[Eth.Miner]
GasFloor = 30000000
GasCeil = 40000000
GasPrice = 1000000000
Recommit = 10000000000
Noverify = false

[Eth.TxPool]
Locals = []
NoLocals = true
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1000000000
PriceBump = 10
AccountSlots = 512
GlobalSlots = 10000
AccountQueue = 256
GlobalQueue = 5000
Lifetime = 10800000000000

[Eth.GPO]
Blocks = 20
Percentile = 60
OracleThreshold = 20

[Node]
DataDir = "D:\blockchain"
IPCPath = "geth.ipc"

[Node.P2P]
MaxPeers = 50
NoDiscovery = false
BootstrapNodes = ["enode://1cc4534b14cfe351ab740a1418ab944a234ca2f702915eadb7e558a02010cb7c5a8c295a3b56bcefa7701c07752acd5539cb13df2aab8ae2d98934d712611443@52.71.43.172:30311","enode://28b1d16562dac280dacaaf45d54516b85bc6c994252a9825c5cc4e080d3e53446d05f63ba495ea7d44d6c316b54cd92b245c5c328c37da24605c4a93a0d099c4@34.246.65.14:30311","enode://5a7b996048d1b0a07683a949662c87c09b55247ce774aeee10bb886892e586e3c604564393292e38ef43c023ee9981e1f8b335766ec4f0f256e57f8640b079d5@35.73.137.11:30311"]
StaticNodes = ["enode://f3cfd69f2808ef64838abd8786342c0b22fdd28268703c8d6812e26e109f9a7cb2b37bd49724ebb46c233289f22da82991c87345eb9a2dadeddb8f37eeb259ac@18.180.28.21:30311","enode://ae74385270d4afeb953561603fcedc4a0e755a241ffdea31c3f751dc8be5bf29c03bf46e3051d1c8d997c45479a92632020c9a84b96dcb63b2259ec09b4fde38@54.178.30.104:30311","enode://d1cabe083d5fc1da9b510889188f06dab891935294e4569df759fc2c4d684b3b4982051b84a9a078512202ad947f9240adc5b6abea5320fb9a736d2f6751c52e@54.238.28.14:30311","enode://f420209bac5324326c116d38d83edfa2256c4101a27cd3e7f9b8287dc8526900f4137e915df6806986b28bc79b1e66679b544a1c515a95ede86f4d809bd65dab@54.178.62.117:30311","enode://c0e8d1abd27c3c13ca879e16f34c12ffee936a7e5d7b7fb6f1af5cc75c6fad704e5667c7bbf7826fcb200d22b9bf86395271b0f76c21e63ad9a388ed548d4c90@54.65.247.12:30311","enode://f1b49b1cf536e36f9a56730f7a0ece899e5efb344eec2fdca3a335465bc4f619b98121f4a5032a1218fa8b69a5488d1ec48afe2abda073280beec296b104db31@13.114.199.41:30311","enode://4924583cfb262b6e333969c86eab8da009b3f7d165cc9ad326914f576c575741e71dc6e64a830e833c25e8c45b906364e58e70cdf043651fd583082ea7db5e3b@18.180.17.171:30311","enode://4d041250eb4f05ab55af184a01aed1a71d241a94a03a5b86f4e32659e1ab1e144be919890682d4afb5e7afd837146ce584d61a38837553d95a7de1f28ea4513a@54.178.99.222:30311","enode://b5772a14fdaeebf4c1924e73c923bdf11c35240a6da7b9e5ec0e6cbb95e78327690b90e8ab0ea5270debc8834454b98eca34cc2a19817f5972498648a6959a3a@54.170.158.102:30311","enode://f329176b187cec87b327f82e78b6ece3102a0f7c89b92a5312e1674062c6e89f785f55fb1b167e369d71c66b0548994c6035c6d85849eccb434d4d9e0c489cdd@34.253.94.130:30311","enode://cbfd1219940d4e312ad94108e7fa3bc34c4c22081d6f334a2e7b36bb28928b56879924cf0353ad85fa5b2f3d5033bbe8ad5371feae9c2088214184be301ed658@54.75.11.3:30311","enode://c64b0a0c619c03c220ea0d7cac754931f967665f9e148b92d2e46761ad9180f5eb5aaef48dfc230d8db8f8c16d2265a3d5407b06bedcd5f0f5a22c2f51c2e69f@54.216.208.163:30311","enode://352a361a9240d4d23bb6fab19cc6dc5a5fc6921abf19de65afe13f1802780aecd67c8c09d8c89043ff86947f171d98ab06906ef616d58e718067e02abea0dda9@79.125.105.65:30311","enode://bb683ef5d03db7d945d6f84b88e5b98920b70aecc22abed8c00d6db621f784e4280e5813d12694c7a091543064456ad9789980766f3f1feb38906cf7255c33d6@54.195.127.237:30311","enode://11dc6fea50630b68a9289055d6b0fb0e22fb5048a3f4e4efd741a7ab09dd79e78d383efc052089e516f0a0f3eacdd5d3ffbe5279b36ecc42ad7cd1f2767fdbdb@46.137.182.25:30311","enode://21530e423b42aed17d7eef67882ebb23357db4f8b10c94d4c71191f52955d97dc13eec03cfeff0fe3a1c89c955e81a6970c09689d21ecbec2142b26b7e759c45@54.216.119.18:30311","enode://d61a31410c365e7fcd50e24d56a77d2d9741d4a57b295cc5070189ad90d0ec749d113b4b0432c6d795eb36597efce88d12ca45e645ec51b3a2144e1c1c41b66a@34.204.129.242:30311","enode://bb91215b1d77c892897048dd58f709f02aacb5355aa8f50f00b67c879c3dffd7eef5b5a152ac46cdfb255295bec4d06701a8032456703c6b604a4686d388ea8f@75.101.197.198:30311","enode://786acbdf5a3cf91b99047a0fd8305e11e54d96ea3a72b1527050d3d6f8c9fc0278ff9ef56f3e56b3b70a283d97c309065506ea2fc3eb9b62477fd014a3ec1a96@107.23.90.162:30311","enode://4653bc7c235c3480968e5e81d91123bc67626f35c207ae4acab89347db675a627784c5982431300c02f547a7d33558718f7795e848d547a327abb111eac73636@54.144.170.236:30311","enode://c6ffd994c4ef130f90f8ee2fc08c1b0f02a6e9b12152092bf5a03dd7af9fd33597d4b2e2000a271cc0648d5e55242aeadd6d5061bb2e596372655ba0722cc704@54.147.151.108:30311","enode://99b07e9dc5f204263b87243146743399b2bd60c98f68d1239a3461d09087e6c417e40f1106fa606ccf54159feabdddb4e7f367559b349a6511e66e525de4906e@54.81.225.170:30311","enode://1479af5ea7bda822e8747d0b967309bced22cad5083b93bc6f4e1d7da7be067cd8495dc4c5a71579f2da8d9068f0c43ad6933d2b335a545b4ae49a846122b261@52.7.247.132:30311","enode://43562d35f274d9e93f5ccac484c7cb185eabc746dbc9f3a56c36dc5a9ef05a3282695de7694a71c0bf4600651f49395b2ee7a6aaef857db2ac896e0fcbe6b518@35.73.15.198:30311","enode://08867e57849456fc9b0b00771f53e87ca6f2dd618c23b34a35d0c851cd484a4b7137905c5b357795025b368e4f8fe4c841b752b0c28cc2dbbf41a03d048e0e24@35.74.39.234:30311"]
ListenAddr = ":30311"
EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000
seaify commented 2 years ago

same problem....

CaiJiJi commented 2 years ago

same problem :(

NaliFinance commented 2 years ago

What to do now? We tried to upgrade the node, restarting multiple times, same error

DreamLxq commented 2 years ago

你的对等节点不一定是全节点. 比如我在我的full node执行了如下代码 setInterval(function () { var OldHigh = new Array(); var p = admin.peers; for (var n = 0; n < p.length; n++) { OldHigh.push(p[n].network.remoteAddress+p[n].protocols.eth.difficulty); } setTimeout(function(){ var p = admin.peers; for (var n = 0; n < p.length; n++) { if(OldHigh.indexOf(p[n].network.remoteAddress+p[n].protocols.eth.difficulty) == -1 && p[n].protocols.eth.difficulty > admin.nodeInfo.protocols.eth.difficulty-100 ) continue;

        console.log("移除节点:",p[n].network.remoteAddress);
        admin.removePeer(p[n].enode);
    }
},60*1000);

},120*1000); 并且...设置了不服务轻节点.. -_,

machavez2086 commented 2 years ago

The same mistake over here. I think the nodes updated the geth with the version v1.1.7-99cb655f which is a build of the Develop branch of github bsc, since all the peers give name Geth / v1.1.7-99cb655f / linux-amd64 / go1.17.2 I did the build from scratch of the geth of the develop branch and mount a Light node from scratch, but it gives the same error. I think that's the cause, I don't know what the solution would be.

NaliFinance commented 2 years ago

@machavez2086 i confirm that the issue was present also in 1.1.6. We switched to Moralis

RumeelHussainbnb commented 2 years ago

If you're not connected to a light server, data retrievals won't work. The only solution is to wait until a server serves you. Although light sometimes worked without opening the ports to the public, I did eventually get this error. When I opened the ports, and restarted geth, the error went away

machavez2086 commented 2 years ago

Sometimes it works, but only when within the list of peers there is one other than Geth / v1.1.7-99cb655f. If you could put some rule so that it only accepts versions of peers smaller than v1.1.7-99 it would work, but I think that most of the peer servers have that compilation. The Developer branch has already changed to a compilation that should work, but until the full nodes do not update with that compilation I do not see a possible solution, except for some configuration that can select peers with compilation less than v1.1.7-99 ..

unclezoro commented 2 years ago

I think it may caused by https://github.com/binance-chain/bsc/pull/640. The fullnode that the light client connected with has switch fullnode who do not have MPT, so can not service eth_getBalance, and light client disconnected them.

DryDragon10 commented 2 years ago

你的对等节点不一定是全节点. 比如我在我的full node执行了如下代码 setInterval(function () { var OldHigh = new Array(); var p = admin.peers; for (var n = 0; n < p.length; n++) { OldHigh.push(p[n].network.remoteAddress+p[n].protocols.eth.difficulty); } setTimeout(function(){ var p = admin.peers; for (var n = 0; n < p.length; n++) { if(OldHigh.indexOf(p[n].network.remoteAddress+p[n].protocols.eth.difficulty) == -1 && p[n].protocols.eth.difficulty > admin.nodeInfo.protocols.eth.difficulty-100 ) continue;

      console.log("移除节点:",p[n].network.remoteAddress);
      admin.removePeer(p[n].enode);
  }
},60*1000);

},120*1000); 并且...设置了不服务轻节点.. -_,

how do you run this ? bash?

luyuanshangao commented 2 years ago

Geth/v1.1.7-74f6b613/linux-amd64/go1.16.10

same issue

light node

It was still available yesterday

0xrin1 commented 2 years ago

works for me

i wiped my data directory, ran the genesis command again, opened the peer port

iptables -I INPUT -p tcp --dport 30311 -j ACCEPT iptables -I INPUT -p udp --dport 30311 -j ACCEPT

not sure what exactly made it work for me because I changed all of those things at once (whoops), but oughta help if any of you are stuck on this

0xrin1 commented 2 years ago

:point_up: nevermind, this helped but I'm still getting 5s execution timeouts and:

err="getDeleteStateObject (0000000000000000000000000000000000000000) error: no suitable peers available" X-Forwarded-For=nil

golunikita commented 2 years ago

UP Function eth.GetBalance("any_address") return getDeleteStateObject error: no suitable peers available. Everything else works as it should. UPDATE: Only the block receiving function works. Everything else no longer works in Light mode

KyloYang888 commented 2 years ago

I think I ran into the same problem. Can anyone help me? Thanks.

https://github.com/bnb-chain/bsc/issues/770

yarsawyer commented 2 years ago

So, is noone serving lightnodes anymore or what is going on?

0xWhale commented 2 years ago

Do you know what the problem is? Can you count on a fix? When will version 1.1.9 be released? Peers - 1 or not at all.

osizadmin commented 2 years ago

same problem while using version 1.1.9

ofarukcaki commented 2 years ago

I also have the same problem 🤦‍♂️

DylanVerstraete commented 2 years ago

Same issue here!

INFO [05-13|08:38:35.422] Imported new block headers               count=1   elapsed="258.737µs" number=17,762,231 hash=7b4938..179586
INFO [05-13|08:38:38.451] Imported new block headers               count=1   elapsed="389.851µs" number=17,762,232 hash=c959e0..4af702
WARN [05-13|08:38:39.432] Served eth_call                          reqid=1053 t=18.007552483s err="getDeleteStateObject (0000000000000000000000000000000000000000) error: no suitable peers available" X-Forwarded-For=nil
WARN [05-13|08:38:39.432] Served eth_call                          reqid=1053 t=18.007549386s err="getDeleteStateObject (0000000000000000000000000000000000000000) error: no suitable peers available"
INFO [05-13|08:38:41.245] Imported new block headers               count=1   elapsed="369.497µs" number=17,762,233 hash=4ea6b2..b6a0dc
INFO [05-13|08:38:44.206] Imported new block headers               count=1   elapsed="331.534µs" number=17,762,234 hash=bdf708..a04b76
INFO [05-13|08:38:47.298] Imported new block headers               count=1   elapsed="380.17µs"  number=17,762,235 hash=afd6ff..a4280f
INFO [05-13|08:38:50.359] Imported new block headers               count=1   elapsed="417.712µs" number=17,762,236 hash=8ed68c..101748
INFO [05-13|08:38:53.434] Imported new block headers               count=1   elapsed="555.957µs" number=17,762,237 hash=683c81..1281bd
INFO [05-13|08:38:56.570] Imported new block headers               count=1   elapsed="375.626µs" number=17,762,238 hash=335492..c994a5
INFO [05-13|08:38:59.337] Imported new block headers               count=1   elapsed=1.325ms     number=17,762,239 hash=eeee1d..6329a5
INFO [05-13|08:39:02.416] Imported new block headers               count=1   elapsed="410.709µs" number=17,762,240 hash=810d5f..2fe2eb
INFO [05-13|08:39:05.359] Imported new block headers               count=1   elapsed="382.134µs" number=17,762,241 hash=91e3e1..8506fa
WARN [05-13|08:39:07.438] Served eth_call                          reqid=1063 t=18.004659844s err="getDeleteStateObject (0000000000000000000000000000000000000000) error: no suitable peers available" X-Forwarded-For=nil
WARN [05-13|08:39:07.438] Served eth_call                          reqid=1063 t=18.00465677s  err="getDeleteStateObject (0000000000000000000000000000000000000000) error: no suitable peers available"
INFO [05-13|08:39:08.782] Imported new block headers               count=1   elapsed="253.203µs" number=17,762,242 hash=90e046..de6d06
INFO [05-13|08:39:11.366] Imported new block headers               count=1   elapsed="306.499µs" number=17,762,243 hash=6b12c2..c50bf8
osizadmin commented 1 year ago

same problem while using version 1.1.15

wafcio commented 1 year ago

This https://gist.github.com/rfikki/e2a8c47f4460668557b1e3ec8bae9c11 works in my case

bnb-tw commented 1 year ago

@MatusKysel can you track this issue as well with your peer filtering work.

MatusKysel commented 1 year ago

I think there is no enough light nodes on the network, if you need to have access to state, I guess you need to run "normal" node or subscribe to some API service