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

middleware base #129

Merged
merged 106 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
5d43765
init osmo gamm test; bump neutron_osmosis chainconfig osmo version to…
bekauz Nov 14, 2024
2661681
creating gamm pool
bekauz Nov 14, 2024
db3f1fd
add osmo gamm libraries to program manager
bekauz Nov 15, 2024
c7ea87b
setting up polytone contracts pre-manager init
bekauz Nov 15, 2024
284c1e7
storing polytone info in global config
bekauz Nov 15, 2024
824299f
wip: setting polytone config on non-main domains
bekauz Nov 15, 2024
a6a090d
wip: polytone integration in program manager
bekauz Nov 18, 2024
5ab9d5b
cleanup gc load in program manager
bekauz Nov 18, 2024
34d7bd9
adjust get_bridge_info
bekauz Nov 18, 2024
ce31c1a
manager fixes
bekauz Nov 19, 2024
e73390f
clippyfmt
bekauz Nov 19, 2024
c498862
funding input acc; wip: processing the lp message
bekauz Nov 19, 2024
345325f
wip: passing messages to osmosis processor
bekauz Nov 19, 2024
1a9b6cb
fix library denom order in test
bekauz Nov 19, 2024
6706b01
follow liquidity provision with liquidity withdrawal works
bekauz Nov 19, 2024
0daaa8d
extend test with main domain authorization module callback validation
bekauz Nov 19, 2024
f7f15ca
fix manager processor instantiation
bekauz Nov 19, 2024
2c51981
rename polytone param in instantiate_processor fn
bekauz Nov 19, 2024
7186127
confirm withdraw callback result is success on authorizations
bekauz Nov 19, 2024
47b5464
remote domain processor queue length assertion helper
bekauz Nov 19, 2024
8339f91
more cleanups
bekauz Nov 19, 2024
c310e7f
include workflow in ci
bekauz Nov 19, 2024
765b1dd
remove logs
bekauz Nov 19, 2024
470097d
merge
bekauz Nov 19, 2024
9310661
regen schema
bekauz Nov 20, 2024
e365d40
final cleanup
bekauz Nov 20, 2024
b7404af
init cl e2e test
bekauz Nov 20, 2024
479f6c7
update program manager library with osmo cl variants
bekauz Nov 20, 2024
4c23aeb
alter osmo genesis to allow permissionless pool creation; creating CL…
bekauz Nov 20, 2024
ffe17c8
asserting that CL position was created and transferred to output acc
bekauz Nov 20, 2024
7bead44
wip: debugging cl withdrawal
bekauz Nov 21, 2024
19816ff
cl withdraw takes in optional dec256 for liquidity amount
bekauz Nov 22, 2024
bc5f28c
cleanup reply handler; add comments
bekauz Nov 22, 2024
1bbdcae
extend unit tests
bekauz Nov 22, 2024
2a03ef9
schema regen
bekauz Nov 22, 2024
7827c34
cleanup e2e
bekauz Nov 22, 2024
b5283fe
merge main
bekauz Nov 22, 2024
24fc336
include osmo cl e2e run in ci
bekauz Nov 22, 2024
6ea6245
remove unused dep; update readme
bekauz Nov 22, 2024
303df34
init test icq library
bekauz Nov 25, 2024
53b3419
init local ic icq relayer
bekauz Nov 25, 2024
c15ea13
starting icq-relayer
bekauz Nov 26, 2024
7e4fc32
instantiating icq test lib on icq_test
bekauz Nov 26, 2024
f66436e
balance queries working
bekauz Nov 26, 2024
8839dd7
querying raw kv storagevalue results
bekauz Nov 26, 2024
6f47458
cleanup & generalize contract msg
bekauz Nov 26, 2024
c7351f3
decoding attempts
bekauz Nov 26, 2024
c4a5602
storing json in store
bekauz Nov 27, 2024
51aba70
cleanup
bekauz Nov 27, 2024
aa25831
cleanup cargos
bekauz Nov 27, 2024
4b7dd15
merge main
bekauz Nov 27, 2024
61139ee
init icq-querier library
bekauz Nov 27, 2024
832adfe
wip
bekauz Nov 27, 2024
53ef99f
handling sudo response
bekauz Nov 28, 2024
5e786fb
init query type enums
bekauz Nov 28, 2024
0896dc1
storing json value results instead of strings
bekauz Nov 28, 2024
41f2e6a
wip: icq querier utils; domain specific type registries
bekauz Nov 29, 2024
4afddb5
cleanup imports
bekauz Nov 29, 2024
e2b7b93
init macro for osmo types parser
bekauz Nov 29, 2024
8cd9047
cleanup icq-querier & e2e test
bekauz Nov 29, 2024
8087f82
declaring pool & balance query over macro impl; cleanup get_registrat…
bekauz Nov 30, 2024
6f28d26
remove QueryResult and map directly via type urls; extend type macro …
bekauz Dec 1, 2024
9070486
cleanup; move global stuff to packages
bekauz Dec 1, 2024
fee1217
type_definitions mod
bekauz Dec 1, 2024
cd01680
move domain registry error to utils
bekauz Dec 1, 2024
ddb4185
init: basic rpm asserter logic
bekauz Dec 1, 2024
d5dc81e
add bank query unit tests
bekauz Dec 2, 2024
7742ab8
merge icq-query-library
bekauz Dec 12, 2024
8c28d9c
init middleware utils package
bekauz Dec 12, 2024
a0286b3
setup base osmosis middleware contract
bekauz Dec 12, 2024
a43aacd
base valence xyk pool & osmo gamm adapters
bekauz Dec 13, 2024
2bc238d
extend middleware with icq type conversion
bekauz Dec 13, 2024
1d4a851
const out the strings
bekauz Dec 16, 2024
ef45e9b
add canonical-types package; rework middleware impl
bekauz Dec 16, 2024
31fd78d
merge packages into middleware-utils
bekauz Dec 16, 2024
9cdaa37
cleanup org
bekauz Dec 16, 2024
4b9c680
base bank balance integration
bekauz Dec 16, 2024
9756fec
integrate balance query into valence types
bekauz Dec 16, 2024
181f533
init broker
bekauz Dec 17, 2024
e3a00e0
registry cntd; init type_registry type mod in utils
bekauz Dec 17, 2024
28caad3
replace individual type adapters with ValenceTypeAdapter
bekauz Dec 17, 2024
f293e04
testing mod in broker; integrate kv_key & proto_reconstruct carryover…
bekauz Dec 17, 2024
007d2dc
cleanup broker
bekauz Dec 17, 2024
6af3591
remove broker utils by moving logic into broker
bekauz Dec 17, 2024
d5a5ad3
simplify broker query logic by wrapping the type registry query msg
bekauz Dec 17, 2024
22616e1
rename middleware domains to type_registries
bekauz Dec 18, 2024
d6ecb31
middleware & type registry readmes
bekauz Dec 18, 2024
3ce96a3
integrate to & from canonical type conversions to broker
bekauz Dec 18, 2024
d46e8a3
remove hardcoded type urls; add middleware-utils readme
bekauz Dec 18, 2024
8423e2f
wip: type registry unifying api macro seems to be working but i have …
bekauz Dec 18, 2024
594bb4d
cleanup
bekauz Dec 19, 2024
31ff6a4
init middleware e2e test
bekauz Dec 19, 2024
ee9411a
adjust icq querier to broker logic
bekauz Dec 20, 2024
579f11b
e2e run to getting valence type and querying the price
bekauz Dec 20, 2024
81308f8
remove old type registry
bekauz Dec 20, 2024
5eec62c
remove icq-querier-utils; cleanup
bekauz Dec 20, 2024
ed66059
rename icq-querier to neutron-icq-querier
bekauz Jan 7, 2025
27c20e7
add neutron icq querier schema script; schema regen
bekauz Jan 7, 2025
11c89d8
cleanup prost imports
bekauz Jan 7, 2025
a700317
remove hardcoded icq registration update period
bekauz Jan 7, 2025
d5c56c9
update middleware & neutron icq relayer readmes
bekauz Jan 7, 2025
bc60e59
remove testing mod from icq querier
bekauz Jan 8, 2025
e050260
broker & type registry schemas
bekauz Jan 8, 2025
ef66568
remove leftover comments; cleanup broker cargo
bekauz Jan 8, 2025
37072b5
setting contract versions
bekauz Jan 8, 2025
438a212
merge dev
bekauz Jan 8, 2025
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
885 changes: 502 additions & 383 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ members = [
"contracts/processor",
"contracts/testing/*",
"contracts/program-registry",
"contracts/middleware/type-registries/osmosis/osmo-26-0-0",
"contracts/middleware/broker",
"packages/*",
"program-manager",
"local-interchaintest",
Expand Down Expand Up @@ -73,6 +75,11 @@ valence-osmosis-gamm-lper = { path = "contracts/libraries/osmosis-gam
valence-osmosis-gamm-withdrawer = { path = "contracts/libraries/osmosis-gamm-withdrawer", features = ["library"] }
valence-osmosis-cl-lper = { path = "contracts/libraries/osmosis-cl-lper", features = ["library"] }
valence-osmosis-cl-withdrawer = { path = "contracts/libraries/osmosis-cl-withdrawer", features = ["library"] }
valence-neutron-icq-querier = { path = "contracts/libraries/neutron-icq-querier", features = ["library"] }

# middleware
valence-middleware-osmosis = { path = "contracts/middleware/type-registries/osmosis/osmo-26-0-0", features = ["library"] }
valence-middleware-broker = { path = "contracts/middleware/broker", features = ["library"] }

# our packages
valence-account-utils = { path = "packages/account-utils" }
Expand All @@ -89,6 +96,7 @@ valence-library-utils = { path = "packages/library-utils" }
valence-program-registry-utils = { path = "packages/program-registry-utils" }
valence-program-manager = { path = "program-manager" }
valence-program-registry = { path = "contracts/program-registry", features = ["library"] }
valence-middleware-utils = { path = "packages/middleware-utils" }

# dev-dependencies
cw-multi-test = { version = "2.1.1", features = ["cosmwasm_1_4"] }
Expand All @@ -102,3 +110,6 @@ tokio = "1.40.0"
osmosis-test-tube = "26.0.1"
env_logger = "0.11.5"
log = "0.4.22"
prost = "0.13.3"
prost-types = "0.13.3"
semver = "1.0.24"
3 changes: 3 additions & 0 deletions contracts/libraries/neutron-icq-querier/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
schema = "run --bin schema"
32 changes: 32 additions & 0 deletions contracts/libraries/neutron-icq-querier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "valence-neutron-icq-querier"
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }
repository = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# use library feature to disable all instantiate/execute/query exports
library = []

[dependencies]
cosmwasm-std = { workspace = true }
cosmwasm-schema = { workspace = true }
cw-ownable = { workspace = true }
valence-macros = { workspace = true }
valence-library-utils = { workspace = true }
valence-library-base = { workspace = true }
neutron-sdk = { workspace = true }
serde-json-wasm = { version = "1.0.0", default-features = false }
cw-storage-plus = { workspace = true }
thiserror = { workspace = true }
valence-middleware-broker = { workspace = true }
valence-middleware-utils = { workspace = true }
cw2 = { workspace = true }

[dev-dependencies]
cw20 = { workspace = true }
35 changes: 35 additions & 0 deletions contracts/libraries/neutron-icq-querier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Neutron ICQ-querier library

**Neutron ICQ Querier library** allows registering and receiving results for KV-based queries.
This library is effectively a wrapper around the `interchainqueries` module on Neutron.

## Prerequisites

### Active Neutron ICQ relayer

This library requires active [neutron icq relayers](https://github.com/neutron-org/neutron-query-relayer) operating on the specified routes.

### Valence Middleware broker

Each KV-based query requires a correctly encoded key in order to be registered.
This library obtains the query keys from [Valence Middleware brokers](../../middleware/README.md).
For a given KV-query to be performed, the select broker must have that type enabled.

## Flow

Queries can be registered by submitting the following message:

```rust
RegisterKvQuery {
broker_addr: String,
registry_version: Option<String>,
type_id: String,
connection_id: String,
update_period: Uint64,
params: BTreeMap<String, Binary>,
},
```

After a query result is fetched, sudo `SudoMsg::KVQueryResult` is triggered.
That will, in turn, decode the response and parse it into the respective `ValenceType`,
object of which is then encoded as a json binary and stored in storage.
Loading