bsc icon indicating copy to clipboard operation
bsc copied to clipboard

Fast sync not being able to catch up to current header. Lagging in the last ~100 blocks

Open chiragpandya7 opened this issue 5 years ago • 6 comments

Issue I am trying to get a fast sync since last two days and the initial stage was competed in a few hours, but when it comes to last few blocks (say like 100). It keeps on lagging continuously with the current header. Am I doing anything wrong or something I can tweak in the configurations?

Here's an example of what it looks like since past two days: image

I am using an AWS instance, with Amazon Linux. These are the hardware configurations. RAM - 15.2 GB Cores - 4 512 GB Nvme SSD

I am running a Geth node with these configurations geth --config ./config.toml --datadir ./node --cache=4096

These are my configurations: (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

[Node] IPCPath = "geth.ipc" HTTPHost = "localhost" NoUSB = true InsecureUnlockAllowed = false HTTPPort = 8545 HTTPVirtualHosts = ["localhost"] HTTPModules = ["eth", "net", "web3", "txpool", "parlia"] WSPort = 8546 WSModules = ["net", "web3", "eth"] GraphQLPort = 8557 GraphQLVirtualHosts = ["*"]

[Node.P2P] MaxPeers = 25 NoDiscovery = false StaticNodes = ["enode://f3cfd69f2808ef64838abd8786342c0b22fdd28268703c8d6812e26e109f9a7cb2b37bd49724ebb46c233289f22da82991c87345eb9a2dadeddb8f37eeb259ac@18.180.28.21:30311","enode://f420209bac5324326c116d38d83edfa2256c4101a27cd3e7f9b8287dc8526900f4137e915df6806986b28bc79b1e66679b544a1c515a95ede86f4d809bd65dab@54.178.62.117:30311","enode://4924583cfb262b6e333969c86eab8da009b3f7d165cc9ad326914f576c575741e71dc6e64a830e833c25e8c45b906364e58e70cdf043651fd583082ea7db5e3b@18.180.17.171:30311","enode://f329176b187cec87b327f82e78b6ece3102a0f7c89b92a5312e1674062c6e89f785f55fb1b167e369d71c66b0548994c6035c6d85849eccb434d4d9e0c489cdd@34.253.94.130:30311","enode://cbfd1219940d4e312ad94108e7fa3bc34c4c22081d6f334a2e7b36bb28928b56879924cf0353ad85fa5b2f3d5033bbe8ad5371feae9c2088214184be301ed658@54.75.11.3:30311","enode://352a361a9240d4d23bb6fab19cc6dc5a5fc6921abf19de65afe13f1802780aecd67c8c09d8c89043ff86947f171d98ab06906ef616d58e718067e02abea0dda9@79.125.105.65:30311","enode://21530e423b42aed17d7eef67882ebb23357db4f8b10c94d4c71191f52955d97dc13eec03cfeff0fe3a1c89c955e81a6970c09689d21ecbec2142b26b7e759c45@54.216.119.18:30311","enode://786acbdf5a3cf91b99047a0fd8305e11e54d96ea3a72b1527050d3d6f8c9fc0278ff9ef56f3e56b3b70a283d97c309065506ea2fc3eb9b62477fd014a3ec1a96@107.23.90.162:30311","enode://99b07e9dc5f204263b87243146743399b2bd60c98f68d1239a3461d09087e6c417e40f1106fa606ccf54159feabdddb4e7f367559b349a6511e66e525de4906e@54.81.225.170:30311","enode://1479af5ea7bda822e8747d0b967309bced22cad5083b93bc6f4e1d7da7be067cd8495dc4c5a71579f2da8d9068f0c43ad6933d2b335a545b4ae49a846122b261@52.7.247.132:30311"] ListenAddr = ":30311" EnableMsgEvents = false

[Node.HTTPTimeouts] ReadTimeout = 30000000000 WriteTimeout = 30000000000 IdleTimeout = 120000000000


Here's a screenshot of what output I am seeing in the verbose. It seems to be fetching state entries. It seems to have pulled about 140137321 states. So when it fetches some state entries, there are a lot more added to it. Is there any way to get past this?

image

Any help is much appreciated. Many Thanks.

chiragpandya7 avatar Mar 18 '21 08:03 chiragpandya7

wait till state sync complete.

ljm625 avatar Mar 19 '21 09:03 ljm625

Its weird, I didn't have this issue on the first node I started. I have a beefier VPS than you and I'm running the exact same issue.

iam4x avatar Mar 19 '21 09:03 iam4x

Update.

The node got synced up eventually. But it took around two days to get to the header. Thanks all

chiragpandya7 avatar Mar 19 '21 11:03 chiragpandya7

@chiragpandya7 how many states are they in total ?

sai-voiddev avatar Mar 22 '21 17:03 sai-voiddev

So finally got in sync but did some changes:

  • update MaxPeers in config.toml to 200 (then I reduced to 20 after complete sync)
  • set --cache=4096 starting the node
  • switched from a network ssd (scaleway.com blockstorage, even if they say 5kIOPS) to a local ssd

And it finally synced in a few hours.

iam4x avatar Mar 23 '21 08:03 iam4x

Can someone tell how many states we currently have? Mine is on 310474586

erickcrus avatar Apr 08 '21 17:04 erickcrus