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

[Clients] embed ParamsQuerier into ApplicationQueryClient #996

Draft
wants to merge 1 commit into
base: issues/543/params-querier/shared
Choose a base branch
from

Conversation

bryanchriswhite
Copy link
Contributor

@bryanchriswhite bryanchriswhite commented Dec 11, 2024

Summary

Embed the ParamsQuerier interface into ApplicationQueryClient and update both off- and on-chain implementations; i.e. appQuerier and AppKeeperQueryClient, respectively.

---
title: Legend
---

classDiagram-v2

class GenericInterface__T__any {
    <<interface>>
    GenericMethod() T
}

class Implementer {
    ExportedField FieldType
    unexportedField FieldType
}

Implementer --|> GenericInterface__T__any: implements

class Embedder__T__any {
    <<interface>>
    GenericInterface[T]
}

Embedder__T__any ..|> GenericInterface__T__any: embeds

Implementer --* FieldType: composes*
Implementer --o FieldType: aggregates*

Loading

*Aggregation implies that the compose component instance DOES have an independent existence from its composition, composition DOES NOT.

---
title: Application Query Client Integration (off-chain)
---

classDiagram-v2

class ParamsQuerier__P__sdk_Msg {
    <<interface>>
    GetParams(ctx context.Context) (params P, err error)
    GetParamsAtHeight(ctx context.Context, height int64) (params P, err error)
}


class cachedParamsQuerier__P__sdk_Msg__Q__paramsQuerier {
    queryClient Q__paramsQuerier[P]
    paramsCache HistoricalQueryCache[P]
    ...
}
cachedParamsQuerier__P__sdk_Msg__Q__paramsQuerier --|> ParamsQuerier__P__sdk_Msg

class HistoricalQueryCache__T__any {
    <<interface>>
    QueryCache__T__any  // omitted from this diagram
    GetAtHeight(key string, heigt int64) (value T, err error)
    SetAtHeight(key string, value T, heigt int64) (err error)
}

cachedParamsQuerier__P__sdk_Msg__Q__paramsQuerier --* HistoricalQueryCache__T__any

class ApplicationQueryClient {
    <<interface>>
    ParamsQuerier__P__sdk_Msg
}
ApplicationQueryClient ..|> ParamsQuerier__P__sdk_Msg
applicationQuerier --|> ApplicationQueryClient

class applicationQuerier {
    ParamsQuerier__P__sdk_Msg
}
applicationQuerier --* cachedParamsQuerier__P__sdk_Msg__Q__paramsQuerier
Loading
---
title: Application Querier Integration (on-chain)
---

classDiagram-v2

class ParamsQuerier__P__sdk_Msg {
    <<interface>>
    GetParams(ctx context.Context) (params P, err error)
    GetParamsAtHeight(ctx context.Context, height int64) (params P, err error)
}

class keeperParamsQuerier__P__any__K__paramsKeeperIface {
    keeper K

    GetParams(ctx context.Context) (params P, err error)
    GetParamsAtHeight(ctx context.Context, height int64) (params P, err error)  // NEVER called; blocked by #931
}

keeperParamsQuerier__P__any__K__paramsKeeperIface --|> ParamsQuerier__P__sdk_Msg

%% class paramsKeeperIface__P__any {
%%     GetParams(context.Context) P
%% }
%% keeperParamsQuerier__P__any__K__paramsKeeperIface --> paramsKeeperIface__P__any

class applicationkeeper.Keeper {
    GetParams(ctx context.Context) (params P, err error)
    %% GetParamsAtHeight(ctx context.Context, height int64) (params P, err error)
}

keeperParamsQuerier__P__any__K__paramsKeeperIface --o applicationkeeper.Keeper

class ApplicationQuerier {
    <<interface>>
    ParamsQuerier__P__sdk_Msg
}
ApplicationQuerier ..|> ParamsQuerier__P__sdk_Msg
applicationKeeperQueryClient --|> ApplicationQuerier

class applicationKeeperQueryClient {
    ParamsQuerier__P__sdk_Msg

    applicationKeeper applicationKeeper
    sessionKeeper SessionKeeper  // omitted from this diagram
}
applicationKeeperQueryClient --* keeperParamsQuerier__P__any__K__paramsKeeperIface
applicationKeeperQueryClient --o applicationkeeper.Keeper
Loading

Issue

Type of change

Select one or more from the following:

Testing

  • Documentation: make docusaurus_start; only needed if you make doc changes
  • Unit Tests: make go_develop_and_test
  • LocalNet E2E Tests: make test_e2e
  • DevNet E2E Tests: Add the devnet-test-e2e label to the PR.

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

@bryanchriswhite bryanchriswhite added application Changes related to the Application actor off-chain Off-chain business logic on-chain On-chain business logic consensus-breaking IMPORTANT! If the PR with this tag is merged, next release WILL HAVE TO BE an upgrade. labels Dec 11, 2024
@bryanchriswhite bryanchriswhite self-assigned this Dec 11, 2024
@bryanchriswhite bryanchriswhite force-pushed the issues/543/params-querier/app branch from b69d3d7 to 144004c Compare December 11, 2024 16:36
@bryanchriswhite bryanchriswhite changed the base branch from issues/543/params/query-client to issues/543/params-querier/shared December 11, 2024 16:41
@bryanchriswhite bryanchriswhite force-pushed the issues/543/params-querier/app branch from 144004c to 195073d Compare December 11, 2024 16:57
@bryanchriswhite bryanchriswhite linked an issue Dec 11, 2024 that may be closed by this pull request
4 tasks
@bryanchriswhite bryanchriswhite force-pushed the issues/543/params-querier/shared branch 4 times, most recently from 9397ffe to 03269f1 Compare December 12, 2024 15:17
Copy link

The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks.

You may need to run make trigger_ci to submit an empty commit that'll trigger the tests.

GCP workloads (requires changing the namespace to 996)
Grafana network dashboard for devnet-issue-996

@github-actions github-actions bot added devnet push-image CI related - pushes images to ghcr.io labels Dec 13, 2024
@bryanchriswhite bryanchriswhite force-pushed the issues/543/params-querier/app branch 2 times, most recently from 4add56e to f16b5f2 Compare December 13, 2024 13:41
@bryanchriswhite bryanchriswhite force-pushed the issues/543/params-querier/shared branch from d52af81 to d630484 Compare December 13, 2024 14:31
@bryanchriswhite bryanchriswhite force-pushed the issues/543/params-querier/app branch from f16b5f2 to 32be74f Compare December 13, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application Changes related to the Application actor consensus-breaking IMPORTANT! If the PR with this tag is merged, next release WILL HAVE TO BE an upgrade. devnet devnet-test-e2e off-chain Off-chain business logic on-chain On-chain business logic push-image CI related - pushes images to ghcr.io
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

[Off-Chain] ModuleParamsClient & Historical Params
1 participant