Skip to content

Commit

Permalink
Merge pull request ethereum#138 from ngtuna/chuck-size-importing
Browse files Browse the repository at this point in the history
Chuck size importing
  • Loading branch information
ngtuna authored Aug 16, 2018
2 parents c5bcaf4 + c3f49b7 commit 70aaf44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
16 changes: 0 additions & 16 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,6 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainReader, header *type
if parent.Time.Uint64()+c.config.Period > header.Time.Uint64() {
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
return c.verifySeal(chain, header, parents)
}
Expand Down
10 changes: 5 additions & 5 deletions eth/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (

var (
MaxHashFetch = 512 // Amount of hashes to be fetched per retrieval request
MaxBlockFetch = 128 // Amount of blocks to be fetched per retrieval request
MaxHeaderFetch = 192 // Amount of block headers to be fetched per retrieval request
MaxBlockFetch = 900 // Amount of blocks 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
MaxBodyFetch = 128 // Amount of block bodies to be fetched per retrieval request
MaxReceiptFetch = 256 // Amount of transaction receipts to allow fetching per request
Expand All @@ -56,9 +56,9 @@ var (
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

maxQueuedHeaders = 32 * 1024 // [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
maxResultsProcess = 2048 // Number of content download results to import at once into the chain
maxQueuedHeaders = 900 // [eth/62] Maximum number of headers to queue for import (DOS protection)
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

fsHeaderCheckFrequency = 100 // Verification frequency of the downloaded headers during fast sync
fsHeaderSafetyNet = 2048 // Number of headers to discard in case a chain violation is detected
Expand Down

0 comments on commit 70aaf44

Please sign in to comment.