From 0d77c96bda3c24f1dac751cb6d6c95e45be39f9d Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Thu, 30 Jul 2020 17:23:42 -0300 Subject: [PATCH] extend maximum to fork length --- chain/blocksync/protocol.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chain/blocksync/protocol.go b/chain/blocksync/protocol.go index 6d50b822c..b8f19c43b 100644 --- a/chain/blocksync/protocol.go +++ b/chain/blocksync/protocol.go @@ -1,6 +1,7 @@ package blocksync import ( + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/store" "time" @@ -15,7 +16,11 @@ var log = logging.Logger("blocksync") const BlockSyncProtocolID = "/fil/sync/blk/0.0.1" -const MaxRequestLength = 800 +// FIXME: Bumped from original 800 to this to accommodate `syncFork()` +// use of `GetBlocks()`. It seems the expectation of that API is to +// fetch any amount of blocks leaving it to the internal logic here +// to partition and reassemble the requests if they go above the maximum. +const MaxRequestLength = uint64(build.ForkLengthThreshold) // Extracted constants from the code. // FIXME: Should be reviewed and confirmed.