Skip to content

Commit 1463444

Browse files
authored
Merge pull request #1898 from cosmos/rm-tendermint34
Remove Tendermint 0.34 support
2 parents a2ea9b5 + 878630c commit 1463444

32 files changed

+82
-3729
lines changed

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,43 @@ and this project adheres to
4646

4747
This change requires users to use TypeScript 5.7 or newer. ([#1883])
4848

49+
- @cosmjs/tendermint-rpc: Remove union type `TendermintClient`. Use
50+
`CometClient` or just `Tendermint37Client` instead. ([#1866])
51+
- @cosmjs/tendermint-rpc: Remove `isTendermint34Client`. Remove
52+
`Tendermint34Client` from `CometClient` union type. Remove
53+
`Tendermint34Client`. Remove module `tendermint34`. ([#1866])
54+
- @cosmjs/tendermint-rpc: Remove top-level exports `broadcastTxCommitSuccess`,
55+
`broadcastTxSyncSuccess`, `AbciInfoRequest`, `AbciInfoResponse`,
56+
`AbciQueryParams`, `AbciQueryRequest`, `AbciQueryResponse`, `Attribute`,
57+
`Block`, `BlockchainRequest`, `BlockchainResponse`, `BlockGossipParams`,
58+
`BlockId`, `BlockMeta`, `BlockParams`, `BlockRequest`, `BlockResponse`,
59+
`BlockResultsRequest`, `BlockResultsResponse`, `BroadcastTxAsyncResponse`,
60+
`BroadcastTxCommitResponse`, `BroadcastTxParams`, `BroadcastTxRequest`,
61+
`BroadcastTxSyncResponse`, `Commit`, `CommitRequest`, `CommitResponse`,
62+
`ConsensusParams`, `Event`, `Evidence`, `EvidenceParams`, `GenesisRequest`,
63+
`GenesisResponse`, `Header`, `HealthRequest`, `HealthResponse`, `Method`,
64+
`NewBlockEvent`, `NewBlockHeaderEvent`, `NodeInfo`,
65+
`NumUnconfirmedTxsRequest`, `NumUnconfirmedTxsResponse`, `ProofOp`,
66+
`QueryProof`, `QueryTag`, `Request`, `Response`, `StatusRequest`,
67+
`StatusResponse`, `SubscriptionEventType`, `SyncInfo`, `TxData`, `TxEvent`,
68+
`TxParams`, `TxProof`, `TxRequest`, `TxResponse`, `TxSearchParams`,
69+
`TxSearchRequest`, `TxSearchResponse`, `TxSizeParams`, `Validator`,
70+
`ValidatorsParams`, `ValidatorsRequest`, `ValidatorsResponse`, `Version`,
71+
`Vote`, `VoteType` which all came from `tendermint34`.
72+
73+
If you needs any of those you can import them from a version specific module,
74+
such as `comet1.Version` or
75+
76+
```ts
77+
import { comet1, comet38, tendermint37 } from "@cosmjs/tendermint-rpc";
78+
79+
function convertEvent(e: tendermint37.Event | comet38.Event | comet1.Event);
80+
```
81+
82+
in case you want to support multiple versions. ([#1866])
83+
4984
[#1883]: https://github.com/cosmos/cosmjs/issues/1883
85+
[#1866]: https://github.com/cosmos/cosmjs/issues/1866
5086

5187
## [0.37.0] - 2025-10-29
5288

HACKING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ order to avoid conflicts. Here is an overview of the ports used:
115115
| 5555 | httpserver | @cosmjs/tendermint-rpc tests |
116116
| 9090 | simapp gRPC | Manual Stargate debugging |
117117
| 11101 | Standalone CometBFT 1.x RPC | @cosmjs/tendermint-rpc tests |
118-
| 11134 | Standalone Tendermint 0.34 RPC | @cosmjs/tendermint-rpc tests |
119-
| 11135 | Standalone Tendermint 0.35 RPC | @cosmjs/tendermint-rpc tests |
120118
| 11137 | Standalone Tendermint 0.37 RPC | @cosmjs/tendermint-rpc tests |
121119
| 11138 | Standalone CometBFT 0.38 RPC | @cosmjs/tendermint-rpc tests |
122120
| 26658 | simapp Tendermint RPC | Stargate client tests |

packages/cosmwasm-stargate/src/cosmwasmclient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class CosmWasmClient {
9292
/**
9393
* Creates an instance by connecting to the given CometBFT RPC endpoint.
9494
*
95-
* This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client.
95+
* This uses auto-detection to decide between a CometBFT 1.x, CometBFT 0.38 and Tendermint 0.37 client.
9696
* To set the Comet client explicitly, use `create`.
9797
*/
9898
public static async connect(endpoint: string | HttpEndpoint): Promise<CosmWasmClient> {
@@ -102,7 +102,8 @@ export class CosmWasmClient {
102102

103103
/**
104104
* Creates an instance from a manually created Comet client.
105-
* Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`.
105+
* Use this to use `Comet38Client` or `Tendermint37Client` instead of
106+
* auto-detection.
106107
*/
107108
public static create(cometClient: CometClient): CosmWasmClient {
108109
return new CosmWasmClient(cometClient);

packages/cosmwasm-stargate/src/signingcosmwasmclient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
208208
/**
209209
* Creates an instance by connecting to the given CometBFT RPC endpoint.
210210
*
211-
* This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client.
211+
* This uses auto-detection to decide between a CometBFT 1.x, CometBFT 0.38 and Tendermint 0.37 client.
212212
* To set the Comet client explicitly, use `createWithSigner`.
213213
*/
214214
public static async connectWithSigner(
@@ -222,7 +222,8 @@ export class SigningCosmWasmClient extends CosmWasmClient {
222222

223223
/**
224224
* Creates an instance from a manually created Comet client.
225-
* Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`.
225+
* Use this to use `Comet38Client` or `Tendermint37Client` instead of
226+
* auto-detection.
226227
*/
227228
public static createWithSigner(
228229
cometClient: CometClient,

packages/stargate/src/events.ts

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,26 @@
1-
import { fromUtf8 } from "@cosmjs/encoding";
2-
import { tendermint34, tendermint37 } from "@cosmjs/tendermint-rpc";
1+
import { comet1, comet38, tendermint37 } from "@cosmjs/tendermint-rpc";
32

4-
/**
5-
* An event attribute.
6-
*
7-
* This is the same attribute type as tendermint34.Attribute and tendermint35.EventAttribute
8-
* but `key` and `value` are unified to strings. The conversion
9-
* from bytes to string in the Tendermint 0.34 case should be done by performing
10-
* [lossy] UTF-8 decoding.
11-
*
12-
* [lossy]: https://doc.rust-lang.org/stable/std/string/struct.String.html#method.from_utf8_lossy
13-
*/
3+
/** An event attribute */
144
export interface Attribute {
155
readonly key: string;
166
readonly value: string;
177
}
188

19-
/**
20-
* The same event type as tendermint34.Event and tendermint35.Event
21-
* but attribute keys and values are unified to strings. The conversion
22-
* from bytes to string in the Tendermint 0.34 case should be done by performing
23-
* [lossy] UTF-8 decoding.
24-
*
25-
* [lossy]: https://doc.rust-lang.org/stable/std/string/struct.String.html#method.from_utf8_lossy
26-
*/
9+
/** An event */
2710
export interface Event {
2811
readonly type: string;
2912
readonly attributes: readonly Attribute[];
3013
}
3114

3215
/**
33-
* Takes a Tendermint 0.34 or 0.37 event with binary encoded key and value
34-
* and converts it into an `Event` with string attributes.
16+
* Takes a CometBFT event and converts it into an `Event` with string attributes.
17+
*
18+
* This is not doing much anymore because we always get string events
19+
* since CometBFT 0.37+. So maybe this can be refactored away at some point.
3520
*/
36-
export function fromTendermintEvent(event: tendermint34.Event | tendermint37.Event): Event {
21+
export function fromTendermintEvent(event: tendermint37.Event | comet38.Event | comet1.Event): Event {
3722
return {
3823
type: event.type,
39-
attributes: event.attributes.map(
40-
(attr): Attribute => ({
41-
key: typeof attr.key == "string" ? attr.key : fromUtf8(attr.key, true),
42-
value: typeof attr.value == "string" ? attr.value : fromUtf8(attr.value, true),
43-
}),
44-
),
24+
attributes: event.attributes.map((attr): Attribute => ({ key: attr.key, value: attr.value })),
4525
};
4626
}

packages/stargate/src/signingstargateclient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class SigningStargateClient extends StargateClient {
115115
/**
116116
* Creates an instance by connecting to the given CometBFT RPC endpoint.
117117
*
118-
* This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client.
118+
* This uses auto-detection to decide between a CometBFT 1.x, CometBFT 0.38 and Tendermint 0.37 client.
119119
* To set the Comet client explicitly, use `createWithSigner`.
120120
*/
121121
public static async connectWithSigner(
@@ -129,7 +129,8 @@ export class SigningStargateClient extends StargateClient {
129129

130130
/**
131131
* Creates an instance from a manually created Comet client.
132-
* Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`.
132+
* Use this to use `Comet38Client` or `Tendermint37Client` instead of
133+
* auto-detection.
133134
*/
134135
public static createWithSigner(
135136
cometClient: CometClient,

packages/stargate/src/stargateclient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export class StargateClient {
213213
/**
214214
* Creates an instance by connecting to the given CometBFT RPC endpoint.
215215
*
216-
* This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client.
216+
* This uses auto-detection to decide between a CometBFT 1.x, CometBFT 0.38 and Tendermint 0.37 client.
217217
* To set the Comet client explicitly, use `create`.
218218
*/
219219
public static async connect(
@@ -226,7 +226,8 @@ export class StargateClient {
226226

227227
/**
228228
* Creates an instance from a manually created Comet client.
229-
* Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`.
229+
* Use this to use `Comet38Client` or `Tendermint37Client` instead of
230+
* auto-detection.
230231
*/
231232
public static create(cometClient: CometClient, options: StargateClientOptions = {}): StargateClient {
232233
return new StargateClient(cometClient, options);

packages/tendermint-rpc/src/comet1/comet1client.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ export class Comet1Client {
9999

100100
// this should paginate through all blockSearch options to ensure it returns all results.
101101
// starts with page 1 or whatever was provided (eg. to start on page 7)
102-
//
103-
// NOTE
104-
// This method will error on any node that is running a Tendermint version lower than 0.34.9.
105102
public async blockSearchAll(params: requests.BlockSearchParams): Promise<responses.BlockSearchResponse> {
106103
let page = params.page || 1;
107104
const blocks: responses.BlockResponse[] = [];

packages/tendermint-rpc/src/comet38/comet38client.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ export class Comet38Client {
8585
/**
8686
* Search for events that are in a block.
8787
*
88-
* NOTE
89-
* This method will error on any node that is running a Tendermint version lower than 0.34.9.
90-
*
9188
* @see https://docs.tendermint.com/master/rpc/#/Info/block_search
9289
*/
9390
public async blockSearch(params: requests.BlockSearchParams): Promise<responses.BlockSearchResponse> {
@@ -102,9 +99,6 @@ export class Comet38Client {
10299

103100
// this should paginate through all blockSearch options to ensure it returns all results.
104101
// starts with page 1 or whatever was provided (eg. to start on page 7)
105-
//
106-
// NOTE
107-
// This method will error on any node that is running a Tendermint version lower than 0.34.9.
108102
public async blockSearchAll(params: requests.BlockSearchParams): Promise<responses.BlockSearchResponse> {
109103
let page = params.page || 1;
110104
const blocks: responses.BlockResponse[] = [];

packages/tendermint-rpc/src/index.ts

Lines changed: 7 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ export {
44
rawEd25519PubkeyToRawAddress,
55
rawSecp256k1PubkeyToRawAddress,
66
} from "./addresses";
7+
export * as comet1 from "./comet1";
8+
export { Comet1Client } from "./comet1";
9+
export * as comet38 from "./comet38";
10+
export { Comet38Client } from "./comet38";
711
export {
812
type ReadonlyDateWithNanoseconds,
913
DateTime,
@@ -12,99 +16,15 @@ export {
1216
toRfc3339WithNanoseconds,
1317
toSeconds,
1418
} from "./dates";
15-
// The public Tendermint34Client.create constructor allows manually choosing an RpcClient.
19+
// The public Comet37Client/Comet38Client/Comet1Client.create constructor allows manually choosing an RpcClient.
1620
// This is currently the only way to switch to the HttpBatchClient (which may become default at some point).
1721
// Due to this API, we make RPC client implementations public.
18-
export * as comet1 from "./comet1";
19-
export { Comet1Client } from "./comet1";
20-
export * as comet38 from "./comet38";
21-
export { Comet38Client } from "./comet38";
2222
export type { HttpBatchClientOptions, HttpEndpoint, RpcClient } from "./rpcclients";
2323
export { HttpBatchClient, HttpClient, WebsocketClient } from "./rpcclients";
24-
export type {
25-
AbciInfoRequest,
26-
AbciInfoResponse,
27-
AbciQueryParams,
28-
AbciQueryRequest,
29-
AbciQueryResponse,
30-
Attribute,
31-
Block,
32-
BlockchainRequest,
33-
BlockchainResponse,
34-
BlockGossipParams,
35-
BlockId,
36-
BlockMeta,
37-
BlockParams,
38-
BlockRequest,
39-
BlockResponse,
40-
BlockResultsRequest,
41-
BlockResultsResponse,
42-
BroadcastTxAsyncResponse,
43-
BroadcastTxCommitResponse,
44-
BroadcastTxParams,
45-
BroadcastTxRequest,
46-
BroadcastTxSyncResponse,
47-
Commit,
48-
CommitRequest,
49-
CommitResponse,
50-
ConsensusParams,
51-
Event,
52-
Evidence,
53-
EvidenceParams,
54-
GenesisRequest,
55-
GenesisResponse,
56-
Header,
57-
HealthRequest,
58-
HealthResponse,
59-
NewBlockEvent,
60-
NewBlockHeaderEvent,
61-
NodeInfo,
62-
NumUnconfirmedTxsRequest,
63-
NumUnconfirmedTxsResponse,
64-
ProofOp,
65-
QueryProof,
66-
QueryTag,
67-
Request,
68-
Response,
69-
StatusRequest,
70-
StatusResponse,
71-
SyncInfo,
72-
TxData,
73-
TxEvent,
74-
TxParams,
75-
TxProof,
76-
TxRequest,
77-
TxResponse,
78-
TxSearchParams,
79-
TxSearchRequest,
80-
TxSearchResponse,
81-
TxSizeParams,
82-
Validator,
83-
ValidatorsParams,
84-
ValidatorsRequest,
85-
ValidatorsResponse,
86-
Version,
87-
Vote,
88-
} from "./tendermint34";
89-
export {
90-
broadcastTxCommitSuccess,
91-
broadcastTxSyncSuccess,
92-
Method,
93-
SubscriptionEventType,
94-
VoteType,
95-
} from "./tendermint34";
96-
export * as tendermint34 from "./tendermint34";
97-
export { Tendermint34Client } from "./tendermint34";
9824
export * as tendermint37 from "./tendermint37";
9925
export { Tendermint37Client } from "./tendermint37";
100-
export type { CometClient, TendermintClient } from "./tendermintclient";
101-
export {
102-
connectComet,
103-
isComet1Client,
104-
isComet38Client,
105-
isTendermint34Client,
106-
isTendermint37Client,
107-
} from "./tendermintclient";
26+
export type { CometClient } from "./tendermintclient";
27+
export { connectComet, isComet1Client, isComet38Client, isTendermint37Client } from "./tendermintclient";
10828
export type {
10929
CommitSignature,
11030
ValidatorEd25519Pubkey,

0 commit comments

Comments
 (0)