Skip to content

Commit

Permalink
Tendermint consensus params settable in Namada config
Browse files Browse the repository at this point in the history
This change enables all Tendermint consensus parameters to be set in
<chain_id>/config.toml which are then passed through to
<chain_id>/tendermint/config/config.toml.
  • Loading branch information
adrianbrink committed May 20, 2023
1 parent f7b7e3b commit 5fe0bf5
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 121 deletions.
78 changes: 30 additions & 48 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 = "a2cd889ae706854e7bf476880a37408d75b4a8e1"}
tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "a2cd889ae706854e7bf476880a37408d75b4a8e1"}
tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "a2cd889ae706854e7bf476880a37408d75b4a8e1"}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "a2cd889ae706854e7bf476880a37408d75b4a8e1"}
tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "a2cd889ae706854e7bf476880a37408d75b4a8e1"}
tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "a2cd889ae706854e7bf476880a37408d75b4a8e1"}
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 = "dcce4ac23d4d0a4324d23c54a1a99d41f0be2076"}
ibc-proto = {git = "https://github.com/heliaxdev/ibc-proto-rs.git", rev = "acc378e5e1865fbf559fa4e36e3c2b0dc1da51bb"}
ibc-relayer = {git = "https://github.com/heliaxdev/hermes.git", rev = "b475b1cc9c94eac91d44da22aee2038f0512d702"}
ibc-relayer-types = {git = "https://github.com/heliaxdev/hermes.git", rev = "b475b1cc9c94eac91d44da22aee2038f0512d702"}
ibc = {git = "https://github.com/heliaxdev/cosmos-ibc-rs.git", rev = "4ec09135f5ef669144ef48c0a111a6428164c9ed"}
ibc-proto = {git = "https://github.com/heliaxdev/ibc-proto-rs.git", rev = "19ad1cdfda14e95bd45fba0e0c710c086f71d0bc"}
ibc-relayer = {git = "https://github.com/heliaxdev/hermes.git", rev = "2230dcf0c8ec212bc18032c93ea184be2fe464a4"}
ibc-relayer-types = {git = "https://github.com/heliaxdev/hermes.git", rev = "2230dcf0c8ec212bc18032c93ea184be2fe464a4"}

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

# patched to the yanked 1.2.0 until masp updates bitvec
funty = { git = "https://github.com/bitvecto-rs/funty/", rev = "7ef0d890fbcd8b3def1635ac1a877fc298488446" }
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -119,7 +119,7 @@ test-unit-coverage:
-- --skip e2e -Z unstable-options --report-time

test-e2e:
RUST_BACKTRACE=1 $(cargo) test e2e \
RUST_BACKTRACE=1 $(cargo) +$(nightly) test e2e \
-Z unstable-options \
-- \
--test-threads=1 \
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 = "a3a0ad5f07d380976bbd5321239aec9cc3a8f916", optional = true}
tendermint-config-abcipp = {package = "tendermint-config", git = "https://github.com/heliaxdev/tendermint-rs", rev = "a3a0ad5f07d380976bbd5321239aec9cc3a8f916", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "a3a0ad5f07d380976bbd5321239aec9cc3a8f916", optional = true}
tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "a3a0ad5f07d380976bbd5321239aec9cc3a8f916", 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
15 changes: 13 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,12 @@ 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 @@ -96,8 +96,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 = "a3a0ad5f07d380976bbd5321239aec9cc3a8f916", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "a3a0ad5f07d380976bbd5321239aec9cc3a8f916", 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

0 comments on commit 5fe0bf5

Please sign in to comment.