From 3fbe286e5a772eeeb1cfbd3b0630672a5cd58f4d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 22 May 2017 08:16:25 -0400 Subject: [PATCH] small fixes to changelog, config, default logging --- CHANGELOG.md | 6 ++++-- config/toml.go | 17 ++++++++++------- state/execution.go | 3 ++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 724c31201..89e1948dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,10 @@ BREAKING CHANGES: - Remove config/tendermint and config/tendermint_test. Defaults are handled by viper and `DefaultConfig() / `TestConfig()` functions - Tests do not read config from file - New logger (`github.com/tendermint/tmlibs/log`) - - Reduced to three levels: Error, Info, Debug + - Reduced to three levels: `error`, `info`, and `debug` + - NOTE: The default in previous versions was `notice`, which is no longer valid. Please change it in the `config.toml` - Per-module log levels + - The new default is `state:info,*:error`, which means the `state` package logs at `info` level, and everything else logs at `error` level - No global loggers (loggers are passed into constructors, or preferably set with a `SetLogger` method) - RPC serialization cleanup: - Lowercase json names for ValidatorSet fields @@ -46,7 +48,7 @@ IMPROVEMENTS: - `go-data -> go-wire/data` - All other `go-*` libs, except `go-crypto` and `go-wire`, merged under `tmlibs` - Return HTTP status codes with errors for RPC responses -- Use `.Wrap()` and `.Unwarp()` instead of eg. `PubKeyS` for `go-crypto` types +- Use `.Wrap()` and `.Unwrap()` instead of eg. `PubKeyS` for `go-crypto` types - Color code different instances of the consensus for tests - RPC JSON responses use pretty printing (via `json.MarshalIndent`) diff --git a/config/toml.go b/config/toml.go index cf232fbf6..4e2e99aa1 100644 --- a/config/toml.go +++ b/config/toml.go @@ -30,17 +30,18 @@ var defaultConfigTmpl = `# This is a TOML config file. proxy_app = "tcp://127.0.0.1:46658" moniker = "__MONIKER__" -node_laddr = "tcp://0.0.0.0:46656" -seeds = "" fast_sync = true db_backend = "leveldb" log_level = "info" rpc_laddr = "tcp://0.0.0.0:46657" + +[p2p] +laddr = "tcp://0.0.0.0:46656" +seeds = "" ` -func defaultConfig(moniker string) (defaultConfig string) { - defaultConfig = strings.Replace(defaultConfigTmpl, "__MONIKER__", moniker, -1) - return +func defaultConfig(moniker string) string { + return strings.Replace(defaultConfigTmpl, "__MONIKER__", moniker, -1) } /****** these are for test settings ***********/ @@ -90,12 +91,14 @@ var testConfigTmpl = `# This is a TOML config file. proxy_app = "dummy" moniker = "__MONIKER__" -node_laddr = "tcp://0.0.0.0:36656" -seeds = "" fast_sync = false db_backend = "memdb" log_level = "info" rpc_laddr = "tcp://0.0.0.0:36657" + +[p2p] +laddr = "tcp://0.0.0.0:36656" +seeds = "" ` func testConfig(moniker string) (testConfig string) { diff --git a/state/execution.go b/state/execution.go index 2dfdb1526..c8544c3d1 100644 --- a/state/execution.go +++ b/state/execution.go @@ -259,7 +259,8 @@ func (s *State) CommitStateUpdateMempool(proxyAppConn proxy.AppConnConsensus, bl s.logger.Debug("Commit.Log: " + res.Log) } - s.logger.Info("Committed state", "hash", res.Data) + s.logger.Info("Committed state", "height", block.Height, "hash", res.Data) + // Set the state's new AppHash s.AppHash = res.Data