Skip to content

Commit

Permalink
feat: support chain v1.4.0 (#105)
Browse files Browse the repository at this point in the history
* feat: support chain v1.4.0
  • Loading branch information
troykessler authored Nov 28, 2023
1 parent 6422faa commit 503b71f
Show file tree
Hide file tree
Showing 27 changed files with 1,772 additions and 1,565 deletions.
Binary file not shown.
21 changes: 7 additions & 14 deletions .github/workflows/integration-release.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Create release binaries
on:
push:
branches: [ main ]
branches: [main]
tags:
- '*'
- "*"
jobs:
prepare:
name: 'Check integrations for release'
name: "Check integrations for release"
runs-on: ubuntu-latest
outputs:
output: ${{ steps.set_env.outputs.test }}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
ref: "main"
- name: fetch tags
run: git fetch --tags
- name: collect integrations names
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
build:
if: needs.prepare.outputs.output != '[]'
runs-on: ubuntu-latest
name: 'Integrations build & release'
name: "Integrations build & release"
needs: prepare
strategy:
matrix:
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: 'main'
ref: "main"
- name: set integration name
run: echo "INTEGRATION_NAME=$(echo ${{ matrix.tag }} | awk -F'[/@]' '{print $3}' | sed 's/ *$//g')" >> $GITHUB_ENV
- name: install yarn
Expand All @@ -66,13 +66,6 @@ jobs:
cd integrations/${{ env.INTEGRATION_NAME }}
ls
yarn build:binaries
cd out
zip kyve-linux-arm64.zip kyve-linux-arm64
rm kyve-linux-arm64
zip kyve-linux-x64.zip kyve-linux-x64
rm kyve-linux-x64
zip kyve-macos-x64.zip kyve-macos-x64
rm kyve-macos-x64
cd ..
- name: Generate Release Body
run: npx extract-changelog-release ${{ github.workspace }}/integrations/${{env.INTEGRATION_NAME}}/CHANGELOG.md > RELEASE_BODY.md
Expand All @@ -84,4 +77,4 @@ jobs:
files: integrations/${{env.INTEGRATION_NAME}}/out/*
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions common/protocol/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kyvejs/protocol",
"version": "1.1.0",
"version": "1.0.14",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"repository": {
Expand All @@ -23,12 +23,12 @@
"@bundlr-network/client": "^0.8.9",
"@cosmjs/proto-signing": "^0.27.1",
"@cosmjs/stargate": "^0.27.1",
"@kyvejs/sdk": "1.1.0-rc1.0",
"@kyvejs/types": "1.2.0-rc0.0",
"@kyvejs/sdk": "1.0.5",
"@kyvejs/types": "1.1.0",
"@types/cli-progress": "^3.9.2",
"@types/jsonfile": "^6.0.1",
"arweave": "^1.10.17",
"axios": "^0.24.0",
"axios": "^0.27.2",
"bignumber.js": "^9.1.2",
"clone": "^2.1.2",
"commander": "^9.4.1",
Expand All @@ -39,7 +39,7 @@
"level": "^8.0.0",
"prando": "^6.0.1",
"prom-client": "^14.1.0",
"protobufjs": "^6.11.2",
"protobufjs": "^6.11.4",
"seedrandom": "^3.0.5",
"semver": "^7.5.3",
"tslog": "^3.2.2",
Expand Down
13 changes: 0 additions & 13 deletions common/protocol/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,6 @@ export class Validator {
await this.setupSDK();
await this.syncPoolState(true);

// perform validation checks
if (!this.isValidRuntime()) {
process.exit(1);
}

if (!this.isValidVersion()) {
process.exit(1);
}

if (await this.isStorageBalanceZero()) {
process.exit(1);
}
Expand All @@ -326,10 +317,6 @@ export class Validator {
await sleep(IDLE_TIME);
}

if (!(await this.isDataAvailable())) {
process.exit(1);
}

await this.setupValidator();
await this.setupCacheProvider();

Expand Down
9 changes: 0 additions & 9 deletions common/protocol/src/methods/main/runNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ export async function runNode(this: Validator): Promise<void> {
await this.syncPoolState();
await this.getBalancesForMetrics();

// perform basic validation checks, if one fails exit
if (!this.isValidRuntime()) {
process.exit(1);
}

if (!this.isValidVersion()) {
process.exit(1);
}

if (!this.isNodeValidator()) {
process.exit(1);
}
Expand Down
10 changes: 9 additions & 1 deletion common/protocol/src/methods/queries/syncPoolState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ export async function syncPoolState(
id: this.poolId.toString(),
});
this.pool = pool!;

this.m.query_pool_successful.inc();

// perform validation checks
if (!this.isValidRuntime()) {
process.exit(1);
}

if (!this.isValidVersion()) {
process.exit(1);
}

// if config link has changed sync the config
if (prevConfig !== this.pool.data!.config) {
try {
Expand Down
16 changes: 14 additions & 2 deletions common/protocol/src/scripts/checksum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import crypto from "crypto";
import JSZip from "jszip";
import { createReadStream, readdirSync, writeFileSync } from "fs";

export const getChecksum = (path: string): Promise<string> => {
Expand All @@ -19,13 +20,24 @@ export const getChecksum = (path: string): Promise<string> => {
};

const main = async () => {
const files = readdirSync(`./out/`);
let files = readdirSync(`./out/`);
let result = "";

const zip = new JSZip();

for (const file of files) {
zip.file(`./out/${file}`);

const content = await zip.generateAsync({ type: "nodebuffer" });
writeFileSync(`./out/${file}.zip`, content);
}

files = readdirSync(`./out/`);

for (const file of files) {
const checksum = await getChecksum(`./out/${file}`);

console.log(`${file} -> ${checksum}`);
console.log(`${checksum} ${file}`);
result += `${checksum} ${file}\n`;
}

Expand Down
2 changes: 1 addition & 1 deletion common/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.1.0-rc1.0](https://github.com/KYVENetwork/kyvejs/compare/@kyvejs/sdk@1.1.0-rc1...@kyvejs/sdk@1.1.0-rc1.0) (2023-11-16)
# [1.1.0](https://github.com/KYVENetwork/kyvejs/compare/@kyvejs/sdk@1.1.0-rc1...@kyvejs/sdk@1.1.0) (2023-11-16)

**Note:** Version bump only for package @kyvejs/sdk

Expand Down
10 changes: 5 additions & 5 deletions common/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kyvejs/sdk",
"version": "1.1.0-rc1.0",
"version": "1.0.5",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -30,16 +30,16 @@
"@cosmjs/stargate": "^0.31.3",
"@cosmjs/tendermint-rpc": "^0.31.3",
"@cosmostation/extension-client": "^0.0.6",
"@keplr-wallet/cosmos": "^0.12.39",
"@kyvejs/types": "1.2.0-rc0.0",
"axios": "0.25.0",
"@keplr-wallet/cosmos": "^0.12.44",
"@kyvejs/types": "1.1.0",
"axios": "^0.27.2",
"bech32": "2.0.0",
"bignumber.js": "9.1.2",
"humanize-number": "0.0.2",
"qs": "^6.10.5"
},
"devDependencies": {
"@keplr-wallet/types": "^0.11.38",
"@keplr-wallet/types": "^0.12.44",
"@types/jest": "^28.1.3",
"@types/qs": "^6.9.7",
"ajv": "^8.11.0",
Expand Down
2 changes: 0 additions & 2 deletions common/sdk/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export const KYVE_KEPLR_CONFIG: ChainInfo = {
bech32Config: Bech32Address.defaultBech32Config("kyve"),
currencies: [],
feeCurrencies: [],
coinType: COIN_TYPE,
features: ["ibc-transfer", "ibc-go"],
};

Expand Down Expand Up @@ -142,6 +141,5 @@ export const KYVE_LEAP_CONFIG: ChainInfo = {
bech32Config: Bech32Address.defaultBech32Config("kyve"),
currencies: [],
feeCurrencies: [],
coinType: 118,
features: ["ibc-transfer", "ibc-go"],
};
2 changes: 1 addition & 1 deletion common/types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.2.0-rc0.0](https://github.com/KYVENetwork/kyvejs/compare/@kyvejs/types@1.2.0-rc0...@kyvejs/types@1.2.0-rc0.0) (2023-11-16)
# [1.2.0](https://github.com/KYVENetwork/kyvejs/compare/@kyvejs/types@1.2.0-rc0...@kyvejs/types@1.2.0) (2023-11-16)

**Note:** Version bump only for package @kyvejs/types

Expand Down
2 changes: 1 addition & 1 deletion common/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kyvejs/types",
"version": "1.2.0-rc0.0",
"version": "1.1.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion common/types/scripts/proto-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Variables
KYVE_CHAIN_REPO="git@github.com:KYVENetwork/chain.git"
KYVE_CHAIN_VERSION="main"
KYVE_CHAIN_VERSION="v1.4.0"

echo "Cloning chain repo version ${KYVE_CHAIN_VERSION}"
mkdir -p ./tmp
Expand Down
9 changes: 5 additions & 4 deletions common/types/src/client/google/protobuf/any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const protobufPackage = "google.protobuf";
* foo = any.unpack(Foo.getDefaultInstance());
* }
*
* Example 3: Pack and unpack a message in Python.
* Example 3: Pack and unpack a message in Python.
*
* foo = Foo(...)
* any = Any()
Expand All @@ -43,7 +43,7 @@ export const protobufPackage = "google.protobuf";
* any.Unpack(foo)
* ...
*
* Example 4: Pack and unpack a message in Go
* Example 4: Pack and unpack a message in Go
*
* foo := &pb.Foo{...}
* any, err := anypb.New(foo)
Expand All @@ -63,7 +63,7 @@ export const protobufPackage = "google.protobuf";
* name "y.z".
*
* JSON
*
* ====
* The JSON representation of an `Any` value uses the regular
* representation of the deserialized, embedded message, with an
* additional field `@type` which contains the type URL. Example:
Expand Down Expand Up @@ -115,7 +115,8 @@ export interface Any {
*
* Note: this functionality is not currently available in the official
* protobuf release, and it is not used for type URLs beginning with
* type.googleapis.com.
* type.googleapis.com. As of May 2023, there are no widely used type server
* implementations and no plans to implement one.
*
* Schemes other than `http`, `https` (or the empty scheme) might be
* used with implementation specific semantics.
Expand Down
2 changes: 1 addition & 1 deletion common/types/src/client/google/protobuf/timestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const protobufPackage = "google.protobuf";
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.
*/
export interface Timestamp {
Expand Down
31 changes: 29 additions & 2 deletions common/types/src/client/kyve/bundles/v1beta1/genesis.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
import _m0 from "protobufjs/minimal";
import { BundleProposal, FinalizedBundle, RoundRobinProgress } from "./bundles";
import { BundleProposal, BundleVersionMap, FinalizedBundle, RoundRobinProgress } from "./bundles";
import { Params } from "./params";

export const protobufPackage = "kyve.bundles.v1beta1";
Expand All @@ -17,10 +17,18 @@ export interface GenesisState {
finalized_bundle_list: FinalizedBundle[];
/** round_robin_progress_list ... */
round_robin_progress_list: RoundRobinProgress[];
/** bundle_version_map ... */
bundle_version_map?: BundleVersionMap | undefined;
}

function createBaseGenesisState(): GenesisState {
return { params: undefined, bundle_proposal_list: [], finalized_bundle_list: [], round_robin_progress_list: [] };
return {
params: undefined,
bundle_proposal_list: [],
finalized_bundle_list: [],
round_robin_progress_list: [],
bundle_version_map: undefined,
};
}

export const GenesisState = {
Expand All @@ -37,6 +45,9 @@ export const GenesisState = {
for (const v of message.round_robin_progress_list) {
RoundRobinProgress.encode(v!, writer.uint32(34).fork()).ldelim();
}
if (message.bundle_version_map !== undefined) {
BundleVersionMap.encode(message.bundle_version_map, writer.uint32(42).fork()).ldelim();
}
return writer;
},

Expand Down Expand Up @@ -75,6 +86,13 @@ export const GenesisState = {

message.round_robin_progress_list.push(RoundRobinProgress.decode(reader, reader.uint32()));
continue;
case 5:
if (tag !== 42) {
break;
}

message.bundle_version_map = BundleVersionMap.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand All @@ -96,6 +114,9 @@ export const GenesisState = {
round_robin_progress_list: globalThis.Array.isArray(object?.round_robin_progress_list)
? object.round_robin_progress_list.map((e: any) => RoundRobinProgress.fromJSON(e))
: [],
bundle_version_map: isSet(object.bundle_version_map)
? BundleVersionMap.fromJSON(object.bundle_version_map)
: undefined,
};
},

Expand All @@ -113,6 +134,9 @@ export const GenesisState = {
if (message.round_robin_progress_list?.length) {
obj.round_robin_progress_list = message.round_robin_progress_list.map((e) => RoundRobinProgress.toJSON(e));
}
if (message.bundle_version_map !== undefined) {
obj.bundle_version_map = BundleVersionMap.toJSON(message.bundle_version_map);
}
return obj;
},

Expand All @@ -128,6 +152,9 @@ export const GenesisState = {
message.finalized_bundle_list = object.finalized_bundle_list?.map((e) => FinalizedBundle.fromPartial(e)) || [];
message.round_robin_progress_list =
object.round_robin_progress_list?.map((e) => RoundRobinProgress.fromPartial(e)) || [];
message.bundle_version_map = (object.bundle_version_map !== undefined && object.bundle_version_map !== null)
? BundleVersionMap.fromPartial(object.bundle_version_map)
: undefined;
return message;
},
};
Expand Down
Loading

0 comments on commit 503b71f

Please sign in to comment.