lower min recommit interval to enable faster blocktime (#9)

This commit is contained in:
Moon Shiesty 2023-10-20 14:47:39 -05:00 committed by GitHub
parent 7285ddd28b
commit 0f5fc961ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -57,7 +57,9 @@ const (
// minRecommitInterval is the minimal time interval to recreate the sealing block with // minRecommitInterval is the minimal time interval to recreate the sealing block with
// any newly arrived transactions. // any newly arrived transactions.
minRecommitInterval = 1 * time.Second // <specular modification>
minRecommitInterval = 100 * time.Millisecond
// <specular modification/>
// maxRecommitInterval is the maximum time interval to recreate the sealing block with // maxRecommitInterval is the maximum time interval to recreate the sealing block with
// any newly arrived transactions. // any newly arrived transactions.

View file

@ -297,7 +297,11 @@ func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine co
estimate = estimate*(1-intervalAdjustRatio) + intervalAdjustRatio*(min-intervalAdjustBias) estimate = estimate*(1-intervalAdjustRatio) + intervalAdjustRatio*(min-intervalAdjustBias)
wantMinInterval, wantRecommitInterval = 3*time.Second, time.Duration(estimate)*time.Nanosecond wantMinInterval, wantRecommitInterval = 3*time.Second, time.Duration(estimate)*time.Nanosecond
case 3: case 3:
wantMinInterval, wantRecommitInterval = time.Second, time.Second // <specular modification>
// lower than upstream test, since enforced min recommit interval is lower
wantMinInterval, wantRecommitInterval = 500*time.Millisecond, 500*time.Millisecond
// <specular modification/>
} }
// Check interval // Check interval