Skip to content

Commit 1ee728d

Browse files
authored
params: rename elastic multiplier to gastarget percentage(#1143)
1 parent 974f2c5 commit 1ee728d

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

consensus/upgrade/galactica/galactica.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func CalcBaseFee(parent *block.Header, forkConfig *thor.ForkConfig) *big.Int {
2424
}
2525

2626
var (
27-
parentGasTarget = parent.GasLimit() * thor.ElasticityMultiplierNum / thor.ElasticityMultiplierDen
27+
parentGasTarget = parent.GasLimit() * thor.GasTargetPercentage / 100
2828
parentGasTargetBig = new(big.Int).SetUint64(parentGasTarget)
2929
baseFeeChangeDenominator = new(big.Int).SetUint64(thor.BaseFeeChangeDenominator)
3030
)

consensus/upgrade/galactica/galactica_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func TestBaseFeeLimits(t *testing.T) {
205205
var parentID thor.Bytes32
206206
binary.BigEndian.PutUint32(parentID[:], 5)
207207
parentGasLimit := uint64(20000000)
208-
parentGasUsed := parentGasLimit * thor.ElasticityMultiplierNum / thor.ElasticityMultiplierDen
208+
parentGasUsed := parentGasLimit * thor.GasTargetPercentage / 100
209209

210210
parentBaseFee := big.NewInt(thor.InitialBaseFee * 10)
211211
for range 100 {

thor/params.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ const (
4444
SeederInterval = 8640 // blocks between two seeder epochs.
4545
CheckpointInterval = 180 // blocks between two bft checkpoints.
4646

47-
ElasticityMultiplierNum = 3 // numerator value to determines the target gas limit as a fraction of the maximum block gas limit
48-
ElasticityMultiplierDen = 4 // denominator value to determines the target gas limit as a fraction of the maximum block gas limit
47+
GasTargetPercentage = 75 // percentage of the block gas limit to determine the gas target
4948
InitialBaseFee = 10_000_000_000_000 // 10^13 wei, 0.00001 VTHO
5049
BaseFeeChangeDenominator = 8 // determines the percentage change in the base fee per block based on network utilization
5150
)

0 commit comments

Comments
 (0)