Skip to content

Commit

Permalink
fix(core): workaround for batching issue in V9 (#121)
Browse files Browse the repository at this point in the history
There is an issue with the batch queries in Constantine (which is
running protocol v9)

As a temporary workaround until finding the root cause of this issue, we
can force the ArchwayClient to connect using Tendermint37Client
  • Loading branch information
macku99 authored Sep 11, 2024
2 parents 35ea42b + e368eba commit 7143f60
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## v0.7.2 (Unreleased)

### Fixed

#### **arch3-core**

- make `connectToRpcClient` use 0.37.x version of Tendermint for both 0.37.x
and 0.38.x RPC Clients as a workaround for a bug in batching requests in
Archway V9 ([#121])

## v0.7.1 (2024-07-08)

### Added
Expand Down
10 changes: 6 additions & 4 deletions packages/arch3-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ export async function connectToRpcClient(rpcClient: RpcClient): Promise<CometCli
const tendermint37Client = await Tendermint37Client.create(rpcClient);
const version = (await tendermint37Client.status()).nodeInfo.version;

if (version.startsWith('0.37.')) {
// HACK: Force Tendermint37Client on 0.38.x versions, remove when client batching issue is fixed
if (version.startsWith('0.37.') || version.startsWith('0.38.')) {
return tendermint37Client;
}

tendermint37Client.disconnect();

if (version.startsWith('0.38.')) {
return await Comet38Client.create(rpcClient);
}
// if (version.startsWith('0.38.')) {
// console.log('VERRRRR2222',version)
// return await Comet38Client.create(rpcClient);
// }

return await Tendermint34Client.create(rpcClient);
}

0 comments on commit 7143f60

Please sign in to comment.