From 3fd8afc8c8f3e63807d525a073f81d061cbade6d Mon Sep 17 00:00:00 2001 From: Paladz Date: Thu, 18 Jul 2019 14:51:22 +0800 Subject: [PATCH 1/1] change the config for prod (#310) --- config/config.go | 4 ++-- consensus/general.go | 6 +++--- p2p/switch.go | 2 +- protocol/tx.go | 1 - protocol/txpool.go | 8 ++++---- protocol/validation/tx_test.go | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/config/config.go b/config/config.go index 8080371d..c3b740e9 100644 --- a/config/config.go +++ b/config/config.go @@ -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: "", diff --git a/consensus/general.go b/consensus/general.go index 0a399c2e..6b5a3173 100644 --- a/consensus/general.go +++ b/consensus/general.go @@ -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}, }, } diff --git a/p2p/switch.go b/p2p/switch.go index 5cd234b0..d3daa7c6 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -27,7 +27,7 @@ import ( const ( logModule = "p2p" - minNumOutboundPeers = 4 + minNumOutboundPeers = 3 maxNumLANPeers = 5 //magicNumber used to generate unique netID magicNumber = uint64(0x054c5638) diff --git a/protocol/tx.go b/protocol/tx.go index 234b0107..35627061 100644 --- a/protocol/tx.go +++ b/protocol/tx.go @@ -28,7 +28,6 @@ func (c *Chain) ValidateTx(tx *types.Tx) (bool, error) { } c.markTransactions(tx) - return c.validateTx(tx) } diff --git a/protocol/txpool.go b/protocol/txpool.go index 5a06c670..bbcee181 100644 --- a/protocol/txpool.go +++ b/protocol/txpool.go @@ -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") diff --git a/protocol/validation/tx_test.go b/protocol/validation/tx_test.go index 60b34abd..484cfa2d 100644 --- a/protocol/validation/tx_test.go +++ b/protocol/validation/tx_test.go @@ -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, }, -- 2.11.0