mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
Merge pull request #138 from ngtuna/chuck-size-importing
Chuck size importing
This commit is contained in:
commit
70aaf44aa9
2 changed files with 5 additions and 21 deletions
|
|
@ -350,22 +350,6 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainReader, header *type
|
||||||
if parent.Time.Uint64()+c.config.Period > header.Time.Uint64() {
|
if parent.Time.Uint64()+c.config.Period > header.Time.Uint64() {
|
||||||
return ErrInvalidTimestamp
|
return ErrInvalidTimestamp
|
||||||
}
|
}
|
||||||
// Retrieve the snapshot needed to verify this header and cache it
|
|
||||||
snap, err := c.snapshot(chain, number-1, header.ParentHash, parents)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// If the block is a checkpoint block, verify the signer list
|
|
||||||
if number%c.config.Epoch == 0 {
|
|
||||||
signers := make([]byte, len(snap.Signers)*common.AddressLength)
|
|
||||||
for i, signer := range snap.signers() {
|
|
||||||
copy(signers[i*common.AddressLength:], signer[:])
|
|
||||||
}
|
|
||||||
extraSuffix := len(header.Extra) - extraSeal
|
|
||||||
if !bytes.Equal(header.Extra[extraVanity:extraSuffix], signers) {
|
|
||||||
return errInvalidCheckpointSigners
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// All basic checks passed, verify the seal and return
|
// All basic checks passed, verify the seal and return
|
||||||
return c.verifySeal(chain, header, parents)
|
return c.verifySeal(chain, header, parents)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
MaxHashFetch = 512 // Amount of hashes to be fetched per retrieval request
|
MaxHashFetch = 512 // Amount of hashes to be fetched per retrieval request
|
||||||
MaxBlockFetch = 128 // Amount of blocks to be fetched per retrieval request
|
MaxBlockFetch = 900 // Amount of blocks to be fetched per retrieval request
|
||||||
MaxHeaderFetch = 192 // Amount of block headers to be fetched per retrieval request
|
MaxHeaderFetch = 900 // Amount of block headers to be fetched per retrieval request
|
||||||
MaxSkeletonSize = 128 // Number of header fetches to need for a skeleton assembly
|
MaxSkeletonSize = 128 // Number of header fetches to need for a skeleton assembly
|
||||||
MaxBodyFetch = 128 // Amount of block bodies to be fetched per retrieval request
|
MaxBodyFetch = 128 // Amount of block bodies to be fetched per retrieval request
|
||||||
MaxReceiptFetch = 256 // Amount of transaction receipts to allow fetching per request
|
MaxReceiptFetch = 256 // Amount of transaction receipts to allow fetching per request
|
||||||
|
|
@ -56,8 +56,8 @@ var (
|
||||||
qosConfidenceCap = 10 // Number of peers above which not to modify RTT confidence
|
qosConfidenceCap = 10 // Number of peers above which not to modify RTT confidence
|
||||||
qosTuningImpact = 0.25 // Impact that a new tuning target has on the previous value
|
qosTuningImpact = 0.25 // Impact that a new tuning target has on the previous value
|
||||||
|
|
||||||
maxQueuedHeaders = 32 * 1024 // [eth/62] Maximum number of headers to queue for import (DOS protection)
|
maxQueuedHeaders = 900 // [eth/62] Maximum number of headers to queue for import (DOS protection)
|
||||||
maxHeadersProcess = 2048 // Number of header download results to import at once into the chain
|
maxHeadersProcess = 900 // Number of header download results to import at once into the chain
|
||||||
maxResultsProcess = 2048 // Number of content download results to import at once into the chain
|
maxResultsProcess = 2048 // Number of content download results to import at once into the chain
|
||||||
|
|
||||||
fsHeaderCheckFrequency = 100 // Verification frequency of the downloaded headers during fast sync
|
fsHeaderCheckFrequency = 100 // Verification frequency of the downloaded headers during fast sync
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue