Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: ics v6 #9

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ node_modules/
/protos/feemarket
/protos/ibc-go
/protos/neutron
/protos/slinky
/protos/connect
/protos/wasmd

/build/
Expand All @@ -25,7 +25,7 @@ node_modules/
/neutron/
/osmosis/
/sdk/
/slinky/
/connect/
/tendermint/
/binary.*
/helpers.*
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
[submodule "neutron"]
path = protos/neutron-src
url = [email protected]:neutron-org/neutron.git
[submodule "slinky"]
path = protos/slinky-src
url = [email protected]:skip-mev/slinky.git
[submodule "wasmd"]
path = protos/wasmd-src
url = [email protected]:neutron-org/wasmd.git
[submodule "protos/connect-src"]
path = protos/connect-src
url = [email protected]:skip-mev/connect.git
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"neutron/",
"osmosis/",
"sdk/",
"slinky/",
"connect/",
"tendermint/",
"/binary.*",
"/helpers.*",
Expand Down
2 changes: 1 addition & 1 deletion protos/block-sdk-src
1 change: 1 addition & 0 deletions protos/connect-src
Submodule connect-src added at 150806
2 changes: 1 addition & 1 deletion protos/feemarket-src
2 changes: 1 addition & 1 deletion protos/ibc-go-src
2 changes: 1 addition & 1 deletion protos/neutron-src
1 change: 0 additions & 1 deletion protos/slinky-src
Submodule slinky-src deleted from ef03f4
2 changes: 1 addition & 1 deletion protos/wasmd-src
Submodule wasmd-src updated 64 files
+23 −19 .circleci/config.yml
+1 −1 .github/workflows/proto-buf-publisher.yml
+117 −38 CHANGELOG.md
+4 −4 Dockerfile
+16 −14 INTEGRATION.md
+1 −1 README.md
+23 −9 app/app.go
+0 −1 app/sim_test.go
+636 −10 docs/proto/proto-docs.md
+52 −51 go.mod
+113 −113 go.sum
+2 −2 proto/buf.lock
+3 −0 proto/cosmwasm/wasm/v1/ibc.proto
+13 −1 proto/cosmwasm/wasm/v1/query.proto
+1 −1 proto/cosmwasm/wasm/v1/tx.proto
+1 −1 tests/e2e/README.md
+225 −0 tests/e2e/ibc_callbacks_test.go
+ tests/e2e/testdata/ibc_callbacks.wasm
+17 −17 tests/system/go.mod
+36 −36 tests/system/go.sum
+1 −1 tests/system/system.go
+48 −24 x/wasm/client/cli/gov_tx.go
+3 −4 x/wasm/client/cli/tx.go
+150 −10 x/wasm/ibc.go
+97 −3 x/wasm/ibc_integration_test.go
+6 −19 x/wasm/ibc_test.go
+1 −1 x/wasm/ibctesting/chain.go
+1 −1 x/wasm/ibctesting/endpoint.go
+1 −1 x/wasm/ibctesting/event_utils.go
+1 −1 x/wasm/ibctesting/events.go
+51 −0 x/wasm/ibctesting/path.go
+2 −2 x/wasm/keeper/addresses.go
+1 −0 x/wasm/keeper/capabilities.go
+1 −1 x/wasm/keeper/contract_keeper.go
+35 −0 x/wasm/keeper/contract_keeper_test.go
+12 −0 x/wasm/keeper/events_test.go
+80 −30 x/wasm/keeper/handler_plugin.go
+1 −1 x/wasm/keeper/handler_plugin_encoders.go
+87 −24 x/wasm/keeper/handler_plugin_test.go
+111 −23 x/wasm/keeper/keeper.go
+1 −1 x/wasm/keeper/keeper_cgo.go
+54 −4 x/wasm/keeper/keeper_test.go
+23 −10 x/wasm/keeper/metrics.go
+1 −1 x/wasm/keeper/msg_server.go
+7 −0 x/wasm/keeper/querier.go
+9 −10 x/wasm/keeper/recurse_test.go
+99 −0 x/wasm/keeper/relay.go
+13 −1 x/wasm/keeper/relay_test.go
+1 −1 x/wasm/keeper/submsg_test.go
+ x/wasm/keeper/testdata/hackatom_42.wasm
+ x/wasm/keeper/testdata/hackatom_420.wasm
+ x/wasm/keeper/testdata/ibc_reflect.wasm
+44 −20 x/wasm/keeper/wasmtesting/mock_engine.go
+66 −4 x/wasm/keeper/wasmtesting/mock_keepers.go
+4 −1 x/wasm/module_test.go
+8 −1 x/wasm/types/expected_keepers.go
+21 −0 x/wasm/types/exported_keepers.go
+2 −2 x/wasm/types/gas_register.go
+149 −23 x/wasm/types/ibc.pb.go
+20 −0 x/wasm/types/keys.go
+96 −95 x/wasm/types/query.pb.go
+0 −20 x/wasm/types/query.pb.gw.go
+1 −1 x/wasm/types/tx.pb.go
+33 −0 x/wasm/types/wasmer_engine.go
4 changes: 2 additions & 2 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

DIRS=(capability cosmos cosmos_proto cosmwasm feemarket gaia gogoproto google ibc neutron osmosis sdk slinky tendermint)
DIRS=(capability cosmos cosmos_proto cosmwasm feemarket gaia gogoproto google ibc neutron osmosis sdk connect tendermint)
FILES=(
binary.d.ts
binary.js
Expand Down Expand Up @@ -36,6 +36,6 @@ done

rm -rf ./build

for dir in admin-module block-sdk cosmos-sdk feemarket ibc-go neutron slinky wasmd ; do
for dir in admin-module block-sdk cosmos-sdk feemarket ibc-go neutron connect wasmd ; do
rm -rf "protos/$dir"
done
12 changes: 8 additions & 4 deletions scripts/codegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ telescope({
"protos/feemarket",
"protos/ibc-go",
"protos/neutron",
"protos/slinky",
"protos/connect",
"protos/wasmd",
],
outPath: outPath,
options: {
logLevel: 0,
useSDKTypes: false,
tsDisable: {
files: ["slinky/oracle/v1/query.ts"],
files: [
"connect/oracle/v2/query.ts",
"connect/marketmap/v2/tx.ts",
"connect/abci/v2/vote_extensions.ts",
],
},
eslintDisable: {
disableAll: true,
Expand All @@ -43,8 +47,8 @@ telescope({
protos: [
"neutron/dex/genesis.proto",
"neutron/transfer/v1/query.proto",
"slinky/abci/v1/vote_extensions.proto",
"slinky/marketmap/v1/tx.proto",
"connect/abci/v1/vote_extensions.proto",
"connect/marketmap/v1/tx.proto",
],
packages: ["google.api"],
},
Expand Down
4 changes: 3 additions & 1 deletion scripts/exports_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ for dir in admin-module cosmos-sdk ibc-go wasmd ; do
buf export "protos/$dir-src/" --output "protos/$dir"
done

for dir in block-sdk feemarket slinky ; do
for dir in block-sdk feemarket connect ; do
rm -rf "protos/$dir"
mkdir -p "protos/$dir"
echo "Autogenerated folder, see export_protos.sh" > "protos/$dir/README.md"

buf export "protos/$dir-src/proto" --output "protos/$dir"
done

sed -i '' '/additional_bindings : \[\]/d' protos/connect/connect/oracle/v2/query.proto

for dir in neutron ; do
rm -rf "protos/$dir"
mkdir -p "protos/$dir"
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare-publishing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

DIRS=(capability cosmos cosmos_proto cosmwasm feemarket gaia gogoproto google ibc neutron osmosis sdk slinky tendermint)
DIRS=(capability cosmos cosmos_proto cosmwasm feemarket gaia gogoproto google ibc neutron osmosis sdk connect tendermint)
FILES=(
binary.d.ts
binary.js
Expand Down
10 changes: 5 additions & 5 deletions scripts/set-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ readonly COSMOS_SDK_DIR="cosmos-sdk-src"
readonly FEEMARKET_DIR="feemarket-src"
readonly IBC_GO_DIR="ibc-go-src"
readonly NEUTRON_DIR="neutron-src"
readonly SLINKY_DIR="slinky-src"
readonly CONNECT_DIR="connect-src"
readonly WASMD_DIR="wasmd-src"

readonly ADMIN_MODULE_REV="v2.0.2"
readonly BLOCK_SDK_REV="v2.1.5"
readonly COSMOS_SDK_REV="v0.50.9-neutron"
readonly FEEMARKET_REV="v1.1.1"
readonly IBC_GO_REV="v8.5.1"
readonly NEUTRON_REV="main"
readonly SLINKY_REV="v1.0.12"
readonly WASMD_REV="v0.51.2-neutron"
readonly NEUTRON_REV="chore/ics-v6"
readonly CONNECT_REV="v2.0.1"
readonly WASMD_REV="v0.53.0-neutron"

checkout_version () {
git -C protos/$1 checkout $2
Expand All @@ -31,5 +31,5 @@ checkout_version $COSMOS_SDK_DIR $COSMOS_SDK_REV
checkout_version $FEEMARKET_DIR $FEEMARKET_REV
checkout_version $IBC_GO_DIR $IBC_GO_REV
checkout_version $NEUTRON_DIR $NEUTRON_REV
checkout_version $SLINKY_DIR $SLINKY_REV
checkout_version $CONNECT_DIR $CONNECT_REV
checkout_version $WASMD_DIR $WASMD_REV
157 changes: 157 additions & 0 deletions src/connect/abci/v2/vote_extensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
//@ts-nocheck
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "../../../binary";
import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact, isObject } from "../../../helpers";
import { JsonSafe } from "../../../json-safe";
export const protobufPackage = "connect.abci.v2";
export interface OracleVoteExtension_PricesEntry {
key: bigint;
value: Uint8Array;
}
/** OracleVoteExtension defines the vote extension structure for oracle prices. */
export interface OracleVoteExtension {
/**
* Prices defines a map of id(CurrencyPair) -> price.Bytes() . i.e. 1 ->
* 0x123.. (bytes). Notice the `id` function is determined by the
* `CurrencyPairIDStrategy` used in the VoteExtensionHandler.
*/
prices: {
[key: bigint]: Uint8Array;
};
}
function createBaseOracleVoteExtension_PricesEntry(): OracleVoteExtension_PricesEntry {
return {
key: BigInt(0),
value: new Uint8Array(),
};
}
export const OracleVoteExtension_PricesEntry = {
encode(
message: OracleVoteExtension_PricesEntry,
writer: BinaryWriter = BinaryWriter.create(),
): BinaryWriter {
if (message.key !== BigInt(0)) {
writer.uint32(8).uint64(message.key);
}
if (message.value.length !== 0) {
writer.uint32(18).bytes(message.value);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): OracleVoteExtension_PricesEntry {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseOracleVoteExtension_PricesEntry();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.key = reader.uint64();
break;
case 2:
message.value = reader.bytes();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): OracleVoteExtension_PricesEntry {
const obj = createBaseOracleVoteExtension_PricesEntry();
if (isSet(object.key)) obj.key = BigInt(object.key.toString());
if (isSet(object.value)) obj.value = bytesFromBase64(object.value);
return obj;
},
toJSON(message: OracleVoteExtension_PricesEntry): JsonSafe<OracleVoteExtension_PricesEntry> {
const obj: any = {};
message.key !== undefined && (obj.key = (message.key || BigInt(0)).toString());
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
fromPartial<I extends Exact<DeepPartial<OracleVoteExtension_PricesEntry>, I>>(
object: I,
): OracleVoteExtension_PricesEntry {
const message = createBaseOracleVoteExtension_PricesEntry();
if (object.key !== undefined && object.key !== null) {
message.key = BigInt(object.key.toString());
}
message.value = object.value ?? new Uint8Array();
return message;
},
};
function createBaseOracleVoteExtension(): OracleVoteExtension {
return {
prices: {},
};
}
export const OracleVoteExtension = {
typeUrl: "/connect.abci.v2.OracleVoteExtension",
encode(message: OracleVoteExtension, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
Object.entries(message.prices).forEach(([key, value]) => {
OracleVoteExtension_PricesEntry.encode(
{
key: key as any,
value,
},
writer.uint32(10).fork(),
).ldelim();
});
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): OracleVoteExtension {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseOracleVoteExtension();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
const entry1 = OracleVoteExtension_PricesEntry.decode(reader, reader.uint32());
if (entry1.value !== undefined) {
message.prices[entry1.key] = entry1.value;
}
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): OracleVoteExtension {
const obj = createBaseOracleVoteExtension();
if (isObject(object.prices))
obj.prices = Object.entries(object.prices).reduce<{
[key: bigint]: bytes;
}>((acc, [key, value]) => {
acc[Number(key)] = bytes.fromJSON(value);
return acc;
}, {});
return obj;
},
toJSON(message: OracleVoteExtension): JsonSafe<OracleVoteExtension> {
const obj: any = {};
obj.prices = {};
if (message.prices) {
Object.entries(message.prices).forEach(([k, v]) => {
obj.prices[k] = bytes.toJSON(v);
});
}
return obj;
},
fromPartial<I extends Exact<DeepPartial<OracleVoteExtension>, I>>(object: I): OracleVoteExtension {
const message = createBaseOracleVoteExtension();
message.prices = Object.entries(object.prices ?? {}).reduce<{
[key: bigint]: bytes;
}>((acc, [key, value]) => {
if (value !== undefined) {
acc[Number(key)] = bytes.fromPartial(value);
}
return acc;
}, {});
return message;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { BinaryReader, BinaryWriter } from "../../../../binary";
import { isSet, DeepPartial, Exact } from "../../../../helpers";
import { JsonSafe } from "../../../../json-safe";
export const protobufPackage = "slinky.marketmap.module.v1";
export const protobufPackage = "connect.marketmap.module.v2";
/** Module is the config object of the builder module. */
export interface Module {
/**
Expand All @@ -24,7 +24,7 @@ function createBaseModule(): Module {
};
}
export const Module = {
typeUrl: "/slinky.marketmap.module.v1.Module",
typeUrl: "/connect.marketmap.module.v2.Module",
encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Params } from "./params";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { isSet, DeepPartial, Exact } from "../../../helpers";
import { JsonSafe } from "../../../json-safe";
export const protobufPackage = "slinky.marketmap.v1";
export const protobufPackage = "connect.marketmap.v2";
/** GenesisState defines the x/marketmap module's genesis state. */
export interface GenesisState {
/**
Expand All @@ -29,7 +29,7 @@ function createBaseGenesisState(): GenesisState {
};
}
export const GenesisState = {
typeUrl: "/slinky.marketmap.v1.GenesisState",
typeUrl: "/connect.marketmap.v2.GenesisState",
encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.marketMap !== undefined) {
MarketMap.encode(message.marketMap, writer.uint32(10).fork()).ldelim();
Expand Down
Loading