OSDN Git Service

change the config for prod (#310)
authorPaladz <yzhu101@uottawa.ca>
Thu, 18 Jul 2019 06:51:22 +0000 (14:51 +0800)
committerGitHub <noreply@github.com>
Thu, 18 Jul 2019 06:51:22 +0000 (14:51 +0800)
config/config.go
consensus/general.go
p2p/switch.go
protocol/tx.go
protocol/txpool.go
protocol/validation/tx_test.go

index 8080371..c3b740e 100644 (file)
@@ -170,10 +170,10 @@ type P2PConfig struct {
 // Default configurable p2p parameters.
 func DefaultP2PConfig() *P2PConfig {
        return &P2PConfig{
-               ListenAddress:    "tcp://0.0.0.0:46656",
+               ListenAddress:    "tcp://0.0.0.0:56656",
                SkipUPNP:         false,
                LANDiscover:      true,
-               MaxNumPeers:      50,
+               MaxNumPeers:      20,
                HandshakeTimeout: 30,
                DialTimeout:      3,
                ProxyAddress:     "",
index 0a399c2..6b5a317 100644 (file)
@@ -105,7 +105,7 @@ func VaporDPOSConfig() DPOSConfig {
                NumOfConsensusNode:      10,
                BlockNumEachNode:        12,
                MinConsensusNodeVoteNum: uint64(100000000000000),
-               MinVoteOutputAmount:     uint64(100000000),
+               MinVoteOutputAmount:     uint64(10000000000),
                BlockTimeInterval:       500,
        }
 
@@ -132,7 +132,7 @@ var MainNetParams = Params{
        DNSSeeds:        []string{"www.mainnetseed.vapor.io"},
        BasicConfig: BasicConfig{
                MaxBlockGas:                uint64(10000000),
-               MaxGasAmount:               int64(200000),
+               MaxGasAmount:               int64(640000),
                DefaultGasCredit:           int64(160000),
                StorageGasRate:             int64(1),
                VMGasRate:                  int64(200),
@@ -143,7 +143,7 @@ var MainNetParams = Params{
        DPOSConfig:  VaporDPOSConfig(),
        Checkpoints: []Checkpoint{},
        ProducerSubsidys: []ProducerSubsidy{
-               {BeginBlock: 1, EndBlock: 63072000, Subsidy: 15000000},
+               {BeginBlock: 1, EndBlock: 63072000, Subsidy: 9512938},
        },
 }
 
index 5cd234b..d3daa7c 100644 (file)
@@ -27,7 +27,7 @@ import (
 const (
        logModule = "p2p"
 
-       minNumOutboundPeers = 4
+       minNumOutboundPeers = 3
        maxNumLANPeers      = 5
        //magicNumber used to generate unique netID
        magicNumber = uint64(0x054c5638)
index 234b010..3562706 100644 (file)
@@ -28,7 +28,6 @@ func (c *Chain) ValidateTx(tx *types.Tx) (bool, error) {
        }
 
        c.markTransactions(tx)
-
        return c.validateTx(tx)
 }
 
index 5a06c67..bbcee18 100644 (file)
@@ -26,11 +26,11 @@ const (
 var (
        maxCachedErrTxs = 1000
        maxMsgChSize    = 1000
-       maxNewTxNum     = 10000
-       maxOrphanNum    = 2000
+       maxNewTxNum     = 65536
+       maxOrphanNum    = 32768
 
-       orphanTTL                = 10 * time.Minute
-       orphanExpireScanInterval = 3 * time.Minute
+       orphanTTL                = 60 * time.Second
+       orphanExpireScanInterval = 30 * time.Second
 
        // ErrTransactionNotExist is the pre-defined error message
        ErrTransactionNotExist = errors.New("transaction are not existed in the mempool")
index 60b34ab..484cfa2 100644 (file)
@@ -66,7 +66,7 @@ func TestGasStatus(t *testing.T) {
                                BTMValue: 0,
                        },
                        output: &GasState{
-                               GasLeft:  200000,
+                               GasLeft:  640000,
                                GasUsed:  0,
                                BTMValue: 80000000000,
                        },
@@ -82,7 +82,7 @@ func TestGasStatus(t *testing.T) {
                                BTMValue: 0,
                        },
                        output: &GasState{
-                               GasLeft:  200000,
+                               GasLeft:  640000,
                                GasUsed:  0,
                                BTMValue: math.MaxInt64,
                        },