diff --git a/CHANGELOG.md b/CHANGELOG.md index f882c56959..29d753a6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.22.0 + +*July 16th, 2018* + +BREAKING CHANGES +* [x/gov] Increase VotingPeriod, DepositPeriod, and MinDeposit + +IMPROVEMENTS +* [gaiad] Default config updates: + - `timeout_commit=5000` so blocks only made every 5s + - `prof_listen_addr=localhost:6060` so profile server is on by default + - `p2p.send_rate` and `p2p.recv_rate` increases 10x (~5MB/s) + +BUG FIXES +* [server] Fix to actually overwrite default tendermint config + ## 0.21.1 *July 14th, 2018* diff --git a/server/util.go b/server/util.go index 1e6ed06c98..51547d116b 100644 --- a/server/util.go +++ b/server/util.go @@ -77,16 +77,21 @@ func interceptLoadConfig() (conf *cfg.Config, err error) { rootDir := tmpConf.RootDir configFilePath := filepath.Join(rootDir, "config/config.toml") // Intercept only if the file doesn't already exist + if _, err := os.Stat(configFilePath); os.IsNotExist(err) { // the following parse config is needed to create directories - sdkDefaultConfig, _ := tcmd.ParseConfig() - sdkDefaultConfig.ProfListenAddress = "prof_laddr=localhost:6060" - sdkDefaultConfig.P2P.RecvRate = 5120000 - sdkDefaultConfig.P2P.SendRate = 5120000 - cfg.WriteConfigFile(configFilePath, sdkDefaultConfig) + conf, _ = tcmd.ParseConfig() + conf.ProfListenAddress = "localhost:6060" + conf.P2P.RecvRate = 5120000 + conf.P2P.SendRate = 5120000 + conf.Consensus.TimeoutCommit = 5000 + cfg.WriteConfigFile(configFilePath, conf) // Fall through, just so that its parsed into memory. } - conf, err = tcmd.ParseConfig() + + if conf == nil { + conf, err = tcmd.ParseConfig() + } return } diff --git a/x/gov/keeper.go b/x/gov/keeper.go index b60404b8ce..572c5388eb 100644 --- a/x/gov/keeper.go +++ b/x/gov/keeper.go @@ -128,18 +128,24 @@ func (keeper Keeper) activateVotingPeriod(ctx sdk.Context, proposal Proposal) { // ===================================================== // Procedures +var ( + defaultMinDeposit int64 = 10 + defaultMaxDepositPeriod int64 = 10000 + defaultVotingPeriod int64 = 10000 +) + // Gets procedure from store. TODO: move to global param store and allow for updating of this func (keeper Keeper) GetDepositProcedure() DepositProcedure { return DepositProcedure{ - MinDeposit: sdk.Coins{sdk.NewCoin("steak", 10)}, - MaxDepositPeriod: 200, + MinDeposit: sdk.Coins{sdk.NewCoin("steak", defaultMinDeposit)}, + MaxDepositPeriod: defaultMaxDepositPeriod, } } // Gets procedure from store. TODO: move to global param store and allow for updating of this func (keeper Keeper) GetVotingProcedure() VotingProcedure { return VotingProcedure{ - VotingPeriod: 200, + VotingPeriod: defaultVotingPeriod, } } diff --git a/x/gov/keeper_test.go b/x/gov/keeper_test.go index 786953fd3a..988a8a6a7e 100644 --- a/x/gov/keeper_test.go +++ b/x/gov/keeper_test.go @@ -10,6 +10,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +// overwrite defaults for testing +func init() { + defaultMinDeposit = 10 + defaultMaxDepositPeriod = 200 + defaultVotingPeriod = 200 +} + func TestGetSetProposal(t *testing.T) { mapp, keeper, _, _, _, _ := getMockApp(t, 0) mapp.BeginBlock(abci.RequestBeginBlock{}) diff --git a/x/gov/proposals.go b/x/gov/proposals.go index 64ffe6bfa2..bb6b0aed4c 100644 --- a/x/gov/proposals.go +++ b/x/gov/proposals.go @@ -60,7 +60,7 @@ type TextProposal struct { Description string `json:"description"` // Description of the proposal ProposalType ProposalKind `json:"proposal_type"` // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal} - Status ProposalStatus `json:"string"` // Status of the Proposal {Pending, Active, Passed, Rejected} + Status ProposalStatus `json:"proposal_status"` // Status of the Proposal {Pending, Active, Passed, Rejected} SubmitBlock int64 `json:"submit_block"` // Height of the block where TxGovSubmitProposal was included TotalDeposit sdk.Coins `json:"total_deposit"` // Current deposit on this proposal. Initial value is set at InitialDeposit @@ -184,7 +184,7 @@ func (pt ProposalKind) Format(s fmt.State, verb rune) { case 's': s.Write([]byte(fmt.Sprintf("%s", pt.String()))) default: - s.Write([]byte(fmt.Sprintf("%v", pt))) + s.Write([]byte(fmt.Sprintf("%v", byte(pt)))) } } @@ -283,6 +283,6 @@ func (status ProposalStatus) Format(s fmt.State, verb rune) { case 's': s.Write([]byte(fmt.Sprintf("%s", status.String()))) default: - s.Write([]byte(fmt.Sprintf("%v", status))) + s.Write([]byte(fmt.Sprintf("%v", byte(status)))) } }