Skip to content

Commit

Permalink
Add support for Tendermint Core v0.34.21 (#1198)
Browse files Browse the repository at this point in the history
* config: Add support for new storage section

Signed-off-by: Thane Thomson <[email protected]>

* tools: Add Tendermint dockerfile config that pulls from Tendermint releases

Signed-off-by: Thane Thomson <[email protected]>

* tools: Format readme for readability

Signed-off-by: Thane Thomson <[email protected]>

* tools: Replace versioned Tendermint image builds with custom bin option

Signed-off-by: Thane Thomson <[email protected]>

* tools: Update readme to reflect Docker image build changes

Signed-off-by: Thane Thomson <[email protected]>

* tools: Rename ABCI harness folder to emphasize custom bin

Signed-off-by: Thane Thomson <[email protected]>

* tools: Fix typo in readme

Signed-off-by: Thane Thomson <[email protected]>

* tools: Enforce specifying Tendermint version during Docker image build

Signed-off-by: Thane Thomson <[email protected]>

* tools: Add ABCI harness Docker build from official Tendermint releases

Signed-off-by: Thane Thomson <[email protected]>

* tools: Add script to automate building development images

Signed-off-by: Thane Thomson <[email protected]>

* tools/rpc: Regenerate fixtures from Tendermint v0.34.21

Signed-off-by: Thane Thomson <[email protected]>

* tools: Bump kvstore test to Tendermint v0.34.21

Signed-off-by: Thane Thomson <[email protected]>

* tools/rpc/proto: Bump Tendermint version to v0.34.21

Signed-off-by: Thane Thomson <[email protected]>

* Add changelog entry

Signed-off-by: Thane Thomson <[email protected]>

* tools: Bump Tendermint version in abci test

Signed-off-by: Thane Thomson <[email protected]>

* Bump supported version of Tendermint Core in repo readme

Signed-off-by: Thane Thomson <[email protected]>

* rpc: Use http dependency when enabling WebSocket client

Signed-off-by: Thane Thomson <[email protected]>

* Formatting

Signed-off-by: Thane Thomson <[email protected]>

Signed-off-by: Thane Thomson <[email protected]>
  • Loading branch information
thanethomson authored Sep 23, 2022
1 parent 57e5c9b commit 55b8937
Show file tree
Hide file tree
Showing 95 changed files with 2,032 additions and 717 deletions.
4 changes: 4 additions & 0 deletions .changelog/unreleased/enhancements/1198-tmcore-v0.34.21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Add support for [Tendermint Core
v0.34.21](https://github.com/tendermint/tendermint/blob/v0.34.21/CHANGELOG.md#v03421),
which primarily involves a small addition to the configuration file
([#1198](https://github.com/informalsystems/tendermint-rs/pull/1198))
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tolerant applications written in any programming language.

## Tendermint Core Compatibility

tendermint-rs has been tested for compatibility with Tendermint Core v0.34.20.
tendermint-rs has been tested for compatibility with Tendermint Core v0.34.21.

## Requirements

Expand Down
12 changes: 12 additions & 0 deletions config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ pub struct TendermintConfig {
/// consensus configuration options
pub consensus: ConsensusConfig,

/// Storage configuration options. This section was only first made
/// available in Tendermint Core v0.34.21.
#[serde(default)]
pub storage: StorageConfig,

/// transactions indexer configuration options
pub tx_index: TxIndexConfig,

Expand Down Expand Up @@ -591,6 +596,13 @@ pub struct ConsensusConfig {
pub peer_query_maj23_sleep_duration: Timeout,
}

/// Storage configuration options.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Default)]
pub struct StorageConfig {
#[serde(default)]
pub discard_abci_responses: bool,
}

/// transactions indexer configuration options
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct TxIndexConfig {
Expand Down
4 changes: 4 additions & 0 deletions config/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ fn config_toml_parser() {
Duration::from_secs(2)
);

// storage configuration options
let storage = &config.storage;
assert!(storage.discard_abci_responses);

// transactions indexer configuration options

let tx_index = &config.tx_index;
Expand Down
11 changes: 11 additions & 0 deletions config/tests/support/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,17 @@ create_empty_blocks_interval = "0s"
peer_gossip_sleep_duration = "100ms"
peer_query_maj23_sleep_duration = "2s"

#######################################################
### Storage Configuration Options ###
#######################################################
[storage]

# Set to true to discard ABCI responses from the state store, which can save a
# considerable amount of disk space. Set to false to ensure ABCI responses are
# persisted. ABCI responses are required for /block_results RPC queries, and to
# reindex events in the command-line tool.
discard_abci_responses = true

#######################################################
### Transaction Indexer Configuration Options ###
#######################################################
Expand Down
7 changes: 7 additions & 0 deletions proto/src/prost/tendermint.state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ pub struct ConsensusParamsInfo {
pub last_height_changed: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbciResponsesInfo {
#[prost(message, optional, tag="1")]
pub abci_responses: ::core::option::Option<AbciResponses>,
#[prost(int64, tag="2")]
pub height: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Version {
#[prost(message, optional, tag="1")]
pub consensus: ::core::option::Option<super::version::Consensus>,
Expand Down
2 changes: 1 addition & 1 deletion proto/src/tendermint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ pub mod crypto {

pub mod meta {
pub const REPOSITORY: &str = "https://github.com/tendermint/tendermint";
pub const COMMITISH: &str = "v0.34.20";
pub const COMMITISH: &str = "v0.34.21";
}
1 change: 1 addition & 0 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ websocket-client = [
"async-trait",
"async-tungstenite",
"futures",
"http",
"tokio/rt-multi-thread",
"tokio/fs",
"tokio/macros",
Expand Down
4 changes: 2 additions & 2 deletions rpc/tests/kvstore_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ fn incoming_fixtures() {
assert!(result.check_tx.events.is_empty());
assert_eq!(result.check_tx.gas_used.value(), 0);
// Todo: https://github.com/informalsystems/tendermint-rs/issues/761
//assert_eq!(result.check_tx.gas_wanted.value(), 1);
// assert_eq!(result.check_tx.gas_wanted.value(), 1);
assert!(result.check_tx.info.to_string().is_empty());
assert!(result.check_tx.log.value().is_empty());
assert_eq!(result.deliver_tx.code, tendermint::abci::Code::Ok);
Expand Down Expand Up @@ -807,7 +807,7 @@ fn incoming_fixtures() {
app: 1
}
);
assert_eq!(result.node_info.version.to_string(), "v0.34.20");
assert_eq!(result.node_info.version.to_string(), "0.34.21");
assert!(!result.sync_info.catching_up);
assert_eq!(
result.sync_info.latest_app_hash.value(),
Expand Down
4 changes: 2 additions & 2 deletions rpc/tests/kvstore_fixtures/incoming/abci_info.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"id": "3eca6aa7-d378-48ab-9490-fe9138ce933e",
"id": "4002bbd1-206d-4770-a5c5-ff8097a4ad13",
"jsonrpc": "2.0",
"result": {
"response": {
"app_version": "1",
"data": "{\"size\":0}",
"last_block_app_hash": "AAAAAAAAAAA=",
"last_block_height": "15",
"last_block_height": "36",
"version": "0.17.0"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "d1b03892-d65f-4cd7-b0d6-0dd18c1d46ed",
"id": "32780c32-760c-47a2-8933-b58664f65b4f",
"jsonrpc": "2.0",
"result": {
"response": {
"code": 0,
"codespace": "",
"height": "69",
"height": "89",
"index": "0",
"info": "",
"key": "dHgw",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "e9723579-afc5-4f32-abc9-f5a71f8a7b1a",
"id": "274d8e66-1dbe-42c8-84f9-704714c73265",
"jsonrpc": "2.0",
"result": {
"response": {
"code": 0,
"codespace": "",
"height": "17",
"height": "38",
"index": "0",
"info": "",
"key": "bm9uX2V4aXN0ZW50X2tleQ==",
Expand Down
2 changes: 1 addition & 1 deletion rpc/tests/kvstore_fixtures/incoming/block_at_height_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"data": "height must be greater than 0, but got 0",
"message": "Internal error"
},
"id": "762cee69-8060-4aa0-8ac7-1ba8eb58d33d",
"id": "02e1e336-eecb-438f-926d-01518b470fff",
"jsonrpc": "2.0"
}
14 changes: 7 additions & 7 deletions rpc/tests/kvstore_fixtures/incoming/block_at_height_1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "3bed7f72-2d3a-4cfc-be6d-a11b36c0b1a5",
"id": "ab54305b-6a48-4b66-b40a-cabb634c12ad",
"jsonrpc": "2.0",
"result": {
"block": {
Expand All @@ -25,10 +25,10 @@
},
"last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"next_validators_hash": "9D1A9A1EC41D301004C5766EF94FD941B5ADBE90205C1586DFEA76BC9DF4FE77",
"proposer_address": "CCD08E1A253A3A53929EA9FB71C3C9018E9D2678",
"time": "2022-07-21T22:06:01.373424724Z",
"validators_hash": "9D1A9A1EC41D301004C5766EF94FD941B5ADBE90205C1586DFEA76BC9DF4FE77",
"next_validators_hash": "6B95A63B261D3DDC1DFF6FA53F4C591AB8DA58BBA545700BFD45E6A54AAA2A84",
"proposer_address": "675F52E8FDA5F4047B8EAF498F946F551ED53DC2",
"time": "2022-09-22T18:57:22.193215438Z",
"validators_hash": "6B95A63B261D3DDC1DFF6FA53F4C591AB8DA58BBA545700BFD45E6A54AAA2A84",
"version": {
"app": "1",
"block": "11"
Expand All @@ -48,9 +48,9 @@
}
},
"block_id": {
"hash": "F4FA302B25AF6113B997EB3870189A29177A593184F0AE0AC08DB4D1BE1BE568",
"hash": "56527562E5142C279254641CE18DB0D845767F2933AAFB784D752905ABF410E8",
"parts": {
"hash": "72AC431F45F5633946AA0E7C4ACE646BF116456CCE461968BAD174A520E3BD0C",
"hash": "5A903E453C6010A0186885B39A52CCF004831A8909B80BA81D950BE7E305762A",
"total": 1
}
}
Expand Down
30 changes: 15 additions & 15 deletions rpc/tests/kvstore_fixtures/incoming/block_at_height_10.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "d02562e6-65d7-4619-af75-529c7ab1d439",
"id": "b521989c-a7e9-4b38-bf82-f84352863885",
"jsonrpc": "2.0",
"result": {
"block": {
Expand All @@ -17,28 +17,28 @@
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"height": "10",
"last_block_id": {
"hash": "91FD98892CE6313DE7A5C8574C71C2F44CF86AC8140A1D7CB8606E81BADD5872",
"hash": "C84DC8FF0364FB7E79D3E0EA6ADDB5B1CC7A648B5F940D9480BF1063D7D8594A",
"parts": {
"hash": "2DCCD7515860671A67FEFB621D3775BF4F780A71BFE7B2AD589519A1EDC4ABA0",
"hash": "6490012AB9FF265F7E7C23A85A118F4C0671BF37E5B3868A59F5F17F8FB292E2",
"total": 1
}
},
"last_commit_hash": "BF6EA2D96423A568C5937A7DABF6E22B68FA516BE0EB5A26CF1DAB173A18A754",
"last_commit_hash": "9F439795B974EC8482447F624110B141BC21B349187177EF0D1C07FEEDACF248",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"next_validators_hash": "9D1A9A1EC41D301004C5766EF94FD941B5ADBE90205C1586DFEA76BC9DF4FE77",
"proposer_address": "CCD08E1A253A3A53929EA9FB71C3C9018E9D2678",
"time": "2022-07-21T22:06:06.082388196Z",
"validators_hash": "9D1A9A1EC41D301004C5766EF94FD941B5ADBE90205C1586DFEA76BC9DF4FE77",
"next_validators_hash": "6B95A63B261D3DDC1DFF6FA53F4C591AB8DA58BBA545700BFD45E6A54AAA2A84",
"proposer_address": "675F52E8FDA5F4047B8EAF498F946F551ED53DC2",
"time": "2022-09-22T18:57:27.243575136Z",
"validators_hash": "6B95A63B261D3DDC1DFF6FA53F4C591AB8DA58BBA545700BFD45E6A54AAA2A84",
"version": {
"app": "1",
"block": "11"
}
},
"last_commit": {
"block_id": {
"hash": "91FD98892CE6313DE7A5C8574C71C2F44CF86AC8140A1D7CB8606E81BADD5872",
"hash": "C84DC8FF0364FB7E79D3E0EA6ADDB5B1CC7A648B5F940D9480BF1063D7D8594A",
"parts": {
"hash": "2DCCD7515860671A67FEFB621D3775BF4F780A71BFE7B2AD589519A1EDC4ABA0",
"hash": "6490012AB9FF265F7E7C23A85A118F4C0671BF37E5B3868A59F5F17F8FB292E2",
"total": 1
}
},
Expand All @@ -47,17 +47,17 @@
"signatures": [
{
"block_id_flag": 2,
"signature": "K3tRLxg9f++2GCNTYUOzB+64l++MCORXM30PhYfwhlnxlW+UipgYh0RSGnKU0llnQvOIbdluUdq/U2tJAtDLAA==",
"timestamp": "2022-07-21T22:06:06.082388196Z",
"validator_address": "CCD08E1A253A3A53929EA9FB71C3C9018E9D2678"
"signature": "44oHR5mAbjwOGjAzFzCD28waXBOlwoRGFck9rKrnq3EmbYz5lY5LObmVXomuo48Fo3y7ZsS9wY4Mj1Gd912/BA==",
"timestamp": "2022-09-22T18:57:27.243575136Z",
"validator_address": "675F52E8FDA5F4047B8EAF498F946F551ED53DC2"
}
]
}
},
"block_id": {
"hash": "A33CD4A336E3452CFCDB105BD52FD6AEFE905A5B4F62176D6FA138F89B04A206",
"hash": "6AA59493037B1673949755B88F86B840FB75285485D95FDBA5BE79D28588F2AC",
"parts": {
"hash": "D598CFB5B50C8E616E845F12A8BC6FACA82D6015E7B176B03C54A64077F4B4D4",
"hash": "0DCBB02A8DFB86E78859A24426ED1D9D2A2C9C3D5C6CD1851477B98705564DD8",
"total": 1
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "a03aa5bc-5c50-4486-9b86-84cac2efaf19",
"id": "8976ea5d-a682-43b6-b08d-490d619b8b61",
"jsonrpc": "2.0",
"result": {
"begin_block_events": null,
Expand Down
Loading

0 comments on commit 55b8937

Please sign in to comment.