From b3b888e37d3cfd3a3670251c340dfbb76b322b94 Mon Sep 17 00:00:00 2001 From: Paladz Date: Tue, 20 Jul 2021 10:10:44 +0800 Subject: [PATCH] edit the gas rate (#2045) * edit the gas rate * fix ci * edit the config Co-authored-by: paladz --- consensus/general.go | 13 ++++++------- protocol/validation/tx_test.go | 8 ++++---- wallet/utxo_test.go | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/consensus/general.go b/consensus/general.go index a22a7b48..eb25bc4a 100644 --- a/consensus/general.go +++ b/consensus/general.go @@ -10,11 +10,10 @@ import ( // consensus variables const ( // Max gas that one block contains - MaxBlockGas = uint64(10000000) - VMGasRate = int64(200) - StorageGasRate = int64(1) - MaxGasAmount = int64(200000) - DefaultGasCredit = int64(30000) + MaxBlockGas = uint64(10000000) + VMGasRate = int64(200) + StorageGasRate = int64(1) + MaxGasAmount = int64(300000) // These configs need add to casper config in elegant way MaxNumOfValidators = int(10) @@ -23,7 +22,7 @@ const ( BlockReward = uint64(570776255) // config parameter for coinbase reward - CoinbasePendingBlockNumber = uint64(100) + CoinbasePendingBlockNumber = uint64(10) MinVoteOutputAmount = uint64(100000000) PayToWitnessPubKeyHashDataSize = 20 @@ -111,7 +110,7 @@ var MainNetParams = Params{ DNSSeeds: []string{"www.mainnetseed.bytom.io"}, CasperConfig: CasperConfig{ BlockTimeInterval: 6000, - MaxTimeOffsetMs: 24000, + MaxTimeOffsetMs: 2400, BlocksOfEpoch: 100, MinValidatorVoteNum: 1e14, VotePendingBlockNumber: 181440, diff --git a/protocol/validation/tx_test.go b/protocol/validation/tx_test.go index 1468418b..b560e6b8 100644 --- a/protocol/validation/tx_test.go +++ b/protocol/validation/tx_test.go @@ -61,12 +61,12 @@ func TestGasStatus(t *testing.T) { }, { input: &GasState{ - GasLeft: consensus.DefaultGasCredit, + GasLeft: 30000, GasUsed: 0, BTMValue: 0, }, output: &GasState{ - GasLeft: 200000, + GasLeft: 300000, GasUsed: 0, BTMValue: 80000000000, }, @@ -77,12 +77,12 @@ func TestGasStatus(t *testing.T) { }, { input: &GasState{ - GasLeft: consensus.DefaultGasCredit, + GasLeft: 30000, GasUsed: 0, BTMValue: 0, }, output: &GasState{ - GasLeft: 200000, + GasLeft: 300000, GasUsed: 0, BTMValue: math.MaxInt64, }, diff --git a/wallet/utxo_test.go b/wallet/utxo_test.go index d6abdc20..cef230f4 100644 --- a/wallet/utxo_test.go +++ b/wallet/utxo_test.go @@ -518,7 +518,7 @@ func TestTxOutToUtxos(t *testing.T) { ControlProgram: []byte{0x51}, SourceID: bc.NewHash([32]byte{0xb4, 0x7e, 0x94, 0x31, 0x88, 0xfe, 0xd3, 0xe9, 0xac, 0x99, 0x7c, 0xfc, 0x99, 0x6d, 0xd7, 0x4d, 0x04, 0x10, 0x77, 0xcb, 0x1c, 0xf8, 0x95, 0x14, 0x00, 0xe3, 0x42, 0x00, 0x8d, 0x05, 0xec, 0xdc}), SourcePos: 0, - ValidHeight: 100, + ValidHeight: 10, }, }, }, -- 2.11.0