OSDN Git Service

edit the gas rate (#2045)
authorPaladz <yzhu101@uottawa.ca>
Tue, 20 Jul 2021 02:10:44 +0000 (10:10 +0800)
committerGitHub <noreply@github.com>
Tue, 20 Jul 2021 02:10:44 +0000 (10:10 +0800)
* edit the gas rate

* fix ci

* edit the config

Co-authored-by: paladz <colt@ColtdeMacBook-Pro.local>
consensus/general.go
protocol/validation/tx_test.go
wallet/utxo_test.go

index a22a7b4..eb25bc4 100644 (file)
@@ -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,
index 1468418..b560e6b 100644 (file)
@@ -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,
                        },
index d6abdc2..cef230f 100644 (file)
@@ -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,
                                },
                        },
                },