From 0f49adc33e5fb55c46c57de0c88e6fd1cacfab39 Mon Sep 17 00:00:00 2001 From: "larry.lx" Date: Fri, 18 Aug 2023 22:40:14 +0800 Subject: [PATCH] fix: lagging nodes failed to sync FastFinality puts more infor into the header.extra field to keep vote information. For mainnet, on epoch height, it could be 1526 bytes, which was 517 bytes before. So the hardcoded 700 bytes for header could be no longer enough, increase it by 2 times would be enough. this bug could cause P2P sync failure for nodes that are lagging behind, since they would request access of ancient db, and GetBlockHeaders could be failed. --- core/rawdb/accessors_chain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 690536cd5d..6b6af68bb7 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -318,7 +318,7 @@ func ReadHeaderRange(db ethdb.Reader, number uint64, count uint64) []rlp.RawValu return rlpHeaders } // read remaining from ancients - max := count * 700 + max := count * 700 * 3 data, err := db.AncientRange(freezerHeaderTable, i+1-count, count, max) if err == nil && uint64(len(data)) == count { // the data is on the order [h, h+1, .., n] -- reordering needed