Skip to content

Commit

Permalink
Merge branch 'adrian/consensus_params' (#1399)
Browse files Browse the repository at this point in the history
* adrian/consensus_params:
  changelog: add #1399
  Tendermint consensus params settable in Namada config
  • Loading branch information
tzemanovic committed May 21, 2023
2 parents b7cf771 + 0364dc4 commit 03ea05c
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 84 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/1399-consensus_params.md
@@ -0,0 +1,2 @@
- Make Tendermint consensus paramenters configurable via Namada configuration.
([#1399](https://github.com/anoma/namada/pull/1399))
60 changes: 30 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions Cargo.toml
Expand Up @@ -37,21 +37,21 @@ async-process = {git = "https://github.com/heliaxdev/async-process.git", rev = "
# borsh-schema-derive-internal = {path = "../borsh-rs/borsh-schema-derive-internal"}

# patched to a commit on the `eth-bridge-integration+consensus-timeout` branch of our fork
tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35"}
tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35"}
tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35"}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35"}
tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35"}
tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35"}
tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043"}
tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043"}
tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043"}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043"}
tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043"}
tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043"}

# patched to a commit on the `eth-bridge-integration` branch of our fork
ibc = {git = "https://github.com/heliaxdev/cosmos-ibc-rs.git", rev = "2d7edc16412b60cabf78163fe24a6264e11f77a9"}
ibc-proto = {git = "https://github.com/heliaxdev/ibc-proto-rs.git", rev = "7e527b5b8c95d83351e93ceafc14ac853224283f"}
ibc-relayer = {git = "https://github.com/heliaxdev/hermes.git", rev = "8e2ff3479edc0653f34b22df450d451eedd2c2ab"}
ibc-relayer-types = {git = "https://github.com/heliaxdev/hermes.git", rev = "8e2ff3479edc0653f34b22df450d451eedd2c2ab"}
ibc = {git = "https://github.com/heliaxdev/cosmos-ibc-rs.git", rev = "e71bc2cc79f8c2b32e970d95312f251398c93d9e"}
ibc-proto = {git = "https://github.com/heliaxdev/ibc-proto-rs.git", rev = "6f4038fcf4981f1ed70771d1cd89931267f917af"}
ibc-relayer = {git = "https://github.com/heliaxdev/hermes.git", rev = "a4ad1355fc0b05908881854aa27221cb2b878ac5"}
ibc-relayer-types = {git = "https://github.com/heliaxdev/hermes.git", rev = "a4ad1355fc0b05908881854aa27221cb2b878ac5"}

# patched to a commit on the `eth-bridge-integration` branch of our fork
tower-abci = {git = "https://github.com/heliaxdev/tower-abci.git", rev = "79069a441cee7d9955a3d826d29656a0fb16115c"}
tower-abci = {git = "https://github.com/heliaxdev/tower-abci.git", rev = "367d8d958b83c501ed2c09e9c4595f8bf75a0b01"}

# patched to the yanked 1.2.0 until masp updates bitvec
funty = { git = "https://github.com/bitvecto-rs/funty/", rev = "7ef0d890fbcd8b3def1635ac1a877fc298488446" }
Expand Down
8 changes: 4 additions & 4 deletions apps/Cargo.toml
Expand Up @@ -125,10 +125,10 @@ signal-hook = "0.3.9"
sysinfo = {version = "=0.21.1", default-features = false}
tar = "0.4.37"
# temporarily using fork work-around
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-config-abcipp = {package = "tendermint-config", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", features = ["http-client", "websocket-client"], optional = true}
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
tendermint-config-abcipp = {package = "tendermint-config", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", features = ["http-client", "websocket-client"], optional = true}
tendermint = {version = "0.23.6", optional = true}
tendermint-config = {version = "0.23.6", optional = true}
tendermint-proto = {version = "0.23.6", optional = true}
Expand Down
18 changes: 16 additions & 2 deletions apps/src/lib/config/mod.rs
Expand Up @@ -136,8 +136,13 @@ pub struct Tendermint {
/// Set `true` for strict address routability rules
/// Set `false` for private or local networks
pub p2p_addr_book_strict: bool,
/// How long we wait after committing a block, before starting on the new
/// height
/// Tendermint Consensus Parameters
pub consensus_timeout_propose: Timeout,
pub consensus_timeout_propose_delta: Timeout,
pub consensus_timeout_prevote: Timeout,
pub consensus_timeout_prevote_delta: Timeout,
pub consensus_timeout_precommit: Timeout,
pub consensus_timeout_precommit_delta: Timeout,
pub consensus_timeout_commit: Timeout,
pub tendermint_mode: TendermintMode,
pub instrumentation_prometheus: bool,
Expand Down Expand Up @@ -184,6 +189,15 @@ impl Ledger {
p2p_pex: true,
p2p_allow_duplicate_ip: false,
p2p_addr_book_strict: true,
consensus_timeout_propose: Timeout::from_str("3s").unwrap(),
consensus_timeout_propose_delta: Timeout::from_str("500ms")
.unwrap(),
consensus_timeout_prevote: Timeout::from_str("1s").unwrap(),
consensus_timeout_prevote_delta: Timeout::from_str("500ms")
.unwrap(),
consensus_timeout_precommit: Timeout::from_str("1s").unwrap(),
consensus_timeout_precommit_delta: Timeout::from_str("500ms")
.unwrap(),
consensus_timeout_commit: Timeout::from_str("1s").unwrap(),
tendermint_mode: mode,
instrumentation_prometheus: false,
Expand Down
12 changes: 12 additions & 0 deletions apps/src/lib/node/ledger/tendermint_node.rs
Expand Up @@ -392,6 +392,18 @@ async fn update_tendermint_config(

#[cfg(feature = "abciplus")]
{
config.consensus.timeout_propose =
tendermint_config.consensus_timeout_propose;
config.consensus.timeout_propose_delta =
tendermint_config.consensus_timeout_propose_delta;
config.consensus.timeout_prevote =
tendermint_config.consensus_timeout_prevote;
config.consensus.timeout_prevote_delta =
tendermint_config.consensus_timeout_prevote_delta;
config.consensus.timeout_precommit =
tendermint_config.consensus_timeout_precommit;
config.consensus.timeout_precommit_delta =
tendermint_config.consensus_timeout_precommit_delta;
config.consensus.timeout_commit =
tendermint_config.consensus_timeout_commit;
}
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Expand Up @@ -95,8 +95,8 @@ serde_json = "1.0.62"
sha2 = "0.9.3"
tendermint = {version = "0.23.6", optional = true}
tendermint-proto = {version = "0.23.6", optional = true}
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
thiserror = "1.0.38"
tracing = "0.1.30"
zeroize = {version = "1.5.5", features = ["zeroize_derive"]}
Expand Down
6 changes: 3 additions & 3 deletions shared/Cargo.toml
Expand Up @@ -125,9 +125,9 @@ serde_json = "1.0.62"
sha2 = "0.9.3"
# We switch off "blake2b" because it cannot be compiled to wasm
tempfile = {version = "3.2.0", optional = true}
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", features = ["http-client"], optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "4db3c5ea09fae4057008d22bf9e96bf541b55b35", optional = true}
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", features = ["http-client"], optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "02b256829e80f8cfecf3fa0d625c2a76c79cd043", optional = true}
tendermint = {version = "0.23.6", optional = true}
tendermint-rpc = {version = "0.23.6", default-features = false, features = ["trait-client"], optional = true}
tendermint-proto = {version = "0.23.6", optional = true}
Expand Down

0 comments on commit 03ea05c

Please sign in to comment.