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

ICA Oracle #884

Merged
merged 94 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
8bad60b
scaffolded module
sampocs Feb 14, 2023
26b1c05
added types
sampocs Feb 14, 2023
b746e63
scaffolded queries
sampocs Feb 14, 2023
abc704a
scaffolded user transactions
sampocs Feb 15, 2023
7e9e7c7
scaffolded gov transactions
sampocs Feb 16, 2023
bcd228d
scaffolded icacallbacks
sampocs Feb 16, 2023
5391e32
added keeper functions and unit tests
sampocs Feb 17, 2023
827a5c7
implemented queries
sampocs Feb 17, 2023
b3a8faf
added wasmd types
sampocs Feb 17, 2023
cafe838
chaned oracle id from moniker to chain-id
sampocs Feb 17, 2023
60320e3
scaffolded ibc and middleware implementation
sampocs Feb 17, 2023
f95e0bb
implemented gov transactions
sampocs Feb 17, 2023
be33635
updated protos and moved cosmwasm protos to stride
sampocs Feb 20, 2023
8bce92c
implemented add-oracle, OnChanOpenInit, and OnChanOpenAck
sampocs Feb 20, 2023
4688642
scaffolded instantiate oracle tx
sampocs Feb 20, 2023
3f6816b
whoops, should have left cosmwasm types in their own folder
sampocs Feb 20, 2023
57170c4
implemented instantiate-oracle and on-ack-packet
sampocs Feb 20, 2023
645430c
refactored - moved submit ica tx into its own function
sampocs Feb 21, 2023
831d1a8
implemented redemption rate metric update
sampocs Feb 22, 2023
4cfce95
added unit tests for add/instantiate oracle and types
sampocs Feb 23, 2023
b145bbf
added unit tests for callbacks
sampocs Feb 23, 2023
f38c2be
added unit tests for ibc callbacks and ica submission
sampocs Feb 23, 2023
4cf5bb4
moved submit metric update to its own file
sampocs Feb 23, 2023
692fecc
added unit test for submit metric update
sampocs Feb 23, 2023
15460fc
nitty nit nit
sampocs Feb 24, 2023
314e233
implemented restore oracle ica
sampocs Feb 24, 2023
18c8293
removed ica address field from instantiate message
sampocs Feb 24, 2023
25d0284
updated schemas to refect contract refactor
sampocs Mar 6, 2023
79817ae
refactored pending metric store and ICA re-submission logic after a f…
sampocs Mar 7, 2023
1a95062
implemented import/export genesis and unit tests
sampocs Mar 7, 2023
7b6c260
removed update oracle contract gov tx
sampocs Mar 7, 2023
e71ef6c
added tx and query cli tests
sampocs Mar 7, 2023
d4822a5
added gov cli queries
sampocs Mar 7, 2023
ff714bf
[refactor] modified protos
sampocs Jun 29, 2023
2f54693
[refactor] generated protos
sampocs Jun 29, 2023
9426208
[refactor] added NewMetric and GetMetricID
sampocs Jun 29, 2023
7bb9b4b
[refactor] redid all metric keeper functions
sampocs Jun 29, 2023
2e7b4a1
[refactor] fixed queries
sampocs Jun 29, 2023
055b8f0
[refactor] fixed genesis and moved to keeper
sampocs Jun 29, 2023
70bfad4
[refactor] metric keeper tests
sampocs Jun 29, 2023
efbe18e
[refactor] updated QueueMetricUpdate function
sampocs Jun 29, 2023
436bf6f
[refactor] updated metric submission and callbacks
sampocs Jun 29, 2023
1ea27fe
[refactor] renamed metric status enum
sampocs Jun 29, 2023
dfd7166
[refactor] fixed unit tests
sampocs Jun 29, 2023
8821262
[refactor] moved endblocker to PostAllQueuedMetrics function and adde…
sampocs Jun 30, 2023
332d797
[refactor] moved contract message types out of proto and base64 encod…
sampocs Jul 3, 2023
192e967
[refactor] combined all and pending metrics queries into a single query
sampocs Jul 3, 2023
d4b3e0f
Merge branch 'main' into ica-oracle
sampocs Jul 4, 2023
050b79e
updated import paths to v11
sampocs Jul 4, 2023
b6afb51
sdkerrors -> errorsmod
sampocs Jul 4, 2023
e75913c
first batch of changes post merge
sampocs Jul 4, 2023
95fd808
Merge branch 'main' into ica-oracle
sampocs Jul 4, 2023
2d2f647
updated icacallback setup
sampocs Jul 4, 2023
cd0b74f
fixed unit tests
sampocs Jul 4, 2023
1e641f9
removed legacy use of ICA SendTx
sampocs Jul 4, 2023
de99fa5
moved contract types back into protos
sampocs Jul 5, 2023
2a9ead5
misc changes when integration testing
sampocs Jul 5, 2023
0c13438
[oak-audit-issue-1] register MsgInstantiateContract as sdk.Msg
sampocs Jul 28, 2023
91541b2
[oak-audit-issue-2] register amino
sampocs Jul 28, 2023
e1d1b63
[oak-audit-issue-3] validate genesis
sampocs Jul 28, 2023
92b4af4
[oak-audit-issue-9] removed duplicate validate basic calls
sampocs Jul 28, 2023
7640b14
[oak-audit-issue-10] oracle query usage message
sampocs Jul 28, 2023
cca0da9
[oak-audit-issue-11] remove unused errors
sampocs Jul 28, 2023
3d17661
[oak-audit-issue-6] remove metrics after oracle is removed
sampocs Jul 30, 2023
234d8ac
[oak-audit-issue-5] validate oracle setup before toggling active
sampocs Jul 30, 2023
d51949b
[oak-audit-issue-8] restore checks channel is closed
sampocs Jul 30, 2023
d6f68ac
[oak-audit-issue-7] added support for adding back a previously remove…
sampocs Jul 30, 2023
bed4b5f
Merge branch 'ica-oracle' into ica-oracle-oak-audit/gov-activate-oracles
sampocs Aug 4, 2023
a13239f
Merge branch 'ica-oracle' into ica-oracle-oak-audit/remove-obsolete-m…
sampocs Aug 4, 2023
71d06f0
Merge branch 'ica-oracle' into ica-oracle-oak-audit/add-back-removed-…
sampocs Aug 4, 2023
7d7ef65
Merge branch 'ica-oracle' into ica-oracle-oak-audit/restore-validate-…
sampocs Aug 4, 2023
09194a2
added helper function to update channel state
sampocs Aug 4, 2023
608d5de
refactored gov setup and moved gov functions to keeper
sampocs Aug 4, 2023
6574198
removed legacy sdk interface functions
sampocs Aug 4, 2023
a04e617
removed legacy handlers
sampocs Aug 4, 2023
851a416
converted gov types to msg types in protos
sampocs Aug 4, 2023
96182be
converted gov types to msg types in types
sampocs Aug 4, 2023
885444c
moved handler to message server
sampocs Aug 4, 2023
d640430
hollowed out cosmwasm messages
sampocs Aug 4, 2023
a69e8a7
lint
sampocs Aug 4, 2023
d38e9b4
Merge branch 'main' into ica-oracle
sampocs Aug 4, 2023
eacbe48
increased stride epoch lengths
sampocs Aug 7, 2023
9d9ca03
updated submodules
sampocs Aug 7, 2023
624bf8b
added store key
sampocs Aug 8, 2023
080c326
switched to expected keepers
sampocs Aug 8, 2023
0e6a03f
reverted config.sh and run_all_tests.sh
sampocs Aug 8, 2023
d61959e
added events
sampocs Aug 8, 2023
c277b78
nit
sampocs Aug 8, 2023
f1c024b
Merge branch 'main' into ica-oracle
sampocs Aug 8, 2023
5ba8816
added helper script to run a local node for debugging purposes
sampocs Aug 9, 2023
983a129
removed Type function from messages and added messages to whitelist
sampocs Aug 9, 2023
b2312b8
added docs
sampocs Aug 9, 2023
66ee28b
Merge branch 'main' into ica-oracle
sampocs Aug 9, 2023
d1a0eae
only push oracle metric update if within safety bounds
sampocs Aug 9, 2023
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
38 changes: 33 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ import (
icacallbacksmodule "github.com/Stride-Labs/stride/v12/x/icacallbacks"
icacallbacksmodulekeeper "github.com/Stride-Labs/stride/v12/x/icacallbacks/keeper"
icacallbacksmoduletypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"
icaoracle "github.com/Stride-Labs/stride/v12/x/icaoracle"
icaoraclekeeper "github.com/Stride-Labs/stride/v12/x/icaoracle/keeper"
icaoracletypes "github.com/Stride-Labs/stride/v12/x/icaoracle/types"
ratelimitmodule "github.com/Stride-Labs/stride/v12/x/ratelimit"
ratelimitclient "github.com/Stride-Labs/stride/v12/x/ratelimit/client"
ratelimitmodulekeeper "github.com/Stride-Labs/stride/v12/x/ratelimit/keeper"
Expand Down Expand Up @@ -214,6 +217,7 @@ var (
claim.AppModuleBasic{},
ccvconsumer.AppModuleBasic{},
autopilot.AppModuleBasic{},
icaoracle.AppModuleBasic{},
tendermint.AppModuleBasic{},
)

Expand Down Expand Up @@ -299,8 +303,7 @@ type StrideApp struct {
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedCCVConsumerKeeper capabilitykeeper.ScopedKeeper

ScopedStakeibcKeeper capabilitykeeper.ScopedKeeper
StakeibcKeeper stakeibcmodulekeeper.Keeper
StakeibcKeeper stakeibcmodulekeeper.Keeper

EpochsKeeper epochsmodulekeeper.Keeper
InterchainqueryKeeper interchainquerykeeper.Keeper
Expand All @@ -310,6 +313,7 @@ type StrideApp struct {
ScopedratelimitKeeper capabilitykeeper.ScopedKeeper
RatelimitKeeper ratelimitmodulekeeper.Keeper
ClaimKeeper claimkeeper.Keeper
ICAOracleKeeper icaoraclekeeper.Keeper

mm *module.Manager
sm *module.SimulationManager
Expand Down Expand Up @@ -353,6 +357,7 @@ func NewStrideApp(
ratelimitmoduletypes.StoreKey,
icacallbacksmoduletypes.StoreKey,
claimtypes.StoreKey,
icaoracletypes.StoreKey,
ccvconsumertypes.StoreKey,
crisistypes.StoreKey,
consensusparamtypes.StoreKey,
Expand Down Expand Up @@ -525,7 +530,7 @@ func NewStrideApp(
// )
// monitoringModule := monitoringp.NewAppModule(appCodec, app.MonitoringKeeper)

// Note: must be above app.StakeibcKeeper
// Note: must be above app.StakeibcKeeper and app.ICAOracleKeeper
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName),
app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee
Expand Down Expand Up @@ -556,6 +561,21 @@ func NewStrideApp(
)
recordsModule := recordsmodule.NewAppModule(appCodec, app.RecordsKeeper, app.AccountKeeper, app.BankKeeper)

// Note: Must be above stakeibc keeper
app.ICAOracleKeeper = *icaoraclekeeper.NewKeeper(
appCodec,
keys[icaoracletypes.StoreKey],
app.GetSubspace(icaoracletypes.ModuleName),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.IBCKeeper.ChannelKeeper, // ICS4Wrapper - Note: this technically should be ICAController but it doesn't implement ICS4
app.IBCKeeper.ClientKeeper,
app.IBCKeeper.ConnectionKeeper,
app.IBCKeeper.ChannelKeeper,
app.ICAControllerKeeper,
app.IcacallbacksKeeper,
)
icaoracleModule := icaoracle.NewAppModule(appCodec, app.ICAOracleKeeper)

stakeibcKeeper := stakeibcmodulekeeper.NewKeeper(
appCodec,
keys[stakeibcmoduletypes.StoreKey],
Expand All @@ -570,6 +590,7 @@ func NewStrideApp(
app.StakingKeeper,
app.IcacallbacksKeeper,
app.RatelimitKeeper,
app.ICAOracleKeeper,
app.ConsumerKeeper,
)
app.StakeibcKeeper = *stakeibcKeeper.SetHooks(
Expand Down Expand Up @@ -625,6 +646,7 @@ func NewStrideApp(
if err := app.IcacallbacksKeeper.SetICACallbacks(
app.StakeibcKeeper.Callbacks(),
app.RecordsKeeper.Callbacks(),
app.ICAOracleKeeper.Callbacks(),
); err != nil {
return nil
}
Expand Down Expand Up @@ -652,12 +674,14 @@ func NewStrideApp(

// Stack two (ICACallbacks Stack) contains
// - IBC
// - ICA
// - ICAController
// - ICAOracle
// - stakeibc
// - ICACallbacks
// - base app
var icacallbacksStack porttypes.IBCModule = icacallbacksIBCModule
icacallbacksStack = stakeibcmodule.NewIBCMiddleware(icacallbacksStack, app.StakeibcKeeper)
icacallbacksStack = icaoracle.NewIBCMiddleware(icacallbacksStack, app.ICAOracleKeeper)
icacallbacksStack = icacontroller.NewIBCMiddleware(icacallbacksStack, app.ICAControllerKeeper)

// Stack three contains
Expand Down Expand Up @@ -729,6 +753,7 @@ func NewStrideApp(
icacallbacksModule,
consumerModule,
autopilotModule,
icaoracleModule,
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand Down Expand Up @@ -765,6 +790,7 @@ func NewStrideApp(
claimtypes.ModuleName,
ccvconsumertypes.ModuleName,
autopilottypes.ModuleName,
icaoracletypes.ModuleName,
consensusparamtypes.ModuleName,
)

Expand Down Expand Up @@ -798,6 +824,7 @@ func NewStrideApp(
claimtypes.ModuleName,
ccvconsumertypes.ModuleName,
autopilottypes.ModuleName,
icaoracletypes.ModuleName,
consensusparamtypes.ModuleName,
)

Expand Down Expand Up @@ -836,6 +863,7 @@ func NewStrideApp(
claimtypes.ModuleName,
ccvconsumertypes.ModuleName,
autopilottypes.ModuleName,
icaoracletypes.ModuleName,
consensusparamtypes.ModuleName,
)

Expand Down Expand Up @@ -1109,7 +1137,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icacallbacksmoduletypes.ModuleName)
paramsKeeper.Subspace(ccvconsumertypes.ModuleName)
paramsKeeper.Subspace(autopilottypes.ModuleName)

paramsKeeper.Subspace(icaoracletypes.ModuleName)
paramsKeeper.Subspace(claimtypes.ModuleName)
return paramsKeeper
}
Expand Down
8 changes: 8 additions & 0 deletions app/apptesting/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,14 @@ func CopyConnectionAndClientToPath(path *ibctesting.Path, pathToCopy *ibctesting
return path
}

// Helper function to change the state of a channel (i.e. to open/close it)
func (s *AppTestHelper) UpdateChannelState(portId, channelId string, channelState channeltypes.State) {
channel, found := s.App.IBCKeeper.ChannelKeeper.GetChannel(s.Ctx, portId, channelId)
s.Require().True(found, "ica channel should have been found")
channel.State = channelState
s.App.IBCKeeper.ChannelKeeper.SetChannel(s.Ctx, portId, channelId, channel)
}

// Constructs an ICA Packet Acknowledgement compatible with ibc-go v5+
func ICAPacketAcknowledgement(t *testing.T, msgType string, msgResponses []proto.Message) channeltypes.Acknowledgement {
txMsgData := &sdk.TxMsgData{
Expand Down
2 changes: 2 additions & 0 deletions app/proposals_whitelisting.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ var WhiteListModule = map[string]struct{}{
"/cosmos.mint.v1beta1.MsgUpdateParams": {},
"/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": {},
"/cosmos.upgrade.v1beta1.MsgCancelUpgrade": {},
"/stride.icaoracle.MsgToggleOracle": {},
"/stride.icaoracle.MsgRemoveOracle": {},
}

func IsModuleWhiteList(typeUrl string) bool {
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
autopilottypes "github.com/Stride-Labs/stride/v12/x/autopilot/types"
claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types"
icacallbacktypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"
icaoracletypes "github.com/Stride-Labs/stride/v12/x/icaoracle/types"
ratelimittypes "github.com/Stride-Labs/stride/v12/x/ratelimit/types"
recordtypes "github.com/Stride-Labs/stride/v12/x/records/types"
stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types"
Expand Down Expand Up @@ -193,6 +194,10 @@ func (app *StrideApp) setupUpgradeHandlers(appOpts servertypes.AppOptions) {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{consumertypes.ModuleName},
}
case "v13":
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{icaoracletypes.ModuleName},
}
}

if storeUpgrades != nil {
Expand Down
2 changes: 1 addition & 1 deletion dockernet/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ STRIDE_LOGS=$LOGS/stride.log
TX_LOGS=$DOCKERNET_HOME/logs/tx.log
KEYS_LOGS=$DOCKERNET_HOME/logs/keys.log

# List of hosts enabled
# List of hosts enabled
HOST_CHAINS=()

# If no host zones are specified above:
Expand Down
4 changes: 3 additions & 1 deletion dockernet/config/ica_host.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
"/ibc.applications.transfer.v1.MsgTransfer"
"/ibc.applications.transfer.v1.MsgTransfer",
"/cosmwasm.wasm.v1.MsgExecuteContract",
"/cosmwasm.wasm.v1.MsgInstantiateContract"
]
}
}
Expand Down
50 changes: 50 additions & 0 deletions proto/cosmwasm/wasm/v1/cosmwasm.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
syntax = "proto3";
package cosmwasm.wasm.v1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/Stride-Labs/stride/v12/x/icaoracle/types";

// MsgExecuteContract submits the given message data to a smart contract
message MsgExecuteContract {
// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
string contract = 2;
// Msg json encoded message to be passed to the contract
bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ];
// Funds coins that are transferred to the contract on execution
repeated cosmos.base.v1beta1.Coin funds = 5 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}

// MsgInstantiateContract create a new smart contract instance for the given
// code id.
message MsgInstantiateContract {
// Sender is the that actor that signed the messages
string sender = 1;
// Admin is an optional address that can execute migrations
string admin = 2;
// CodeID is the reference to the stored WASM code
uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ];
// Label is optional metadata to be stored with a contract instance.
string label = 4;
// Msg json encoded message to be passed to the contract on instantiation
bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 6 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}

// MsgInstantiateContractResponse return instantiation result data
message MsgInstantiateContractResponse {
// Address is the bech32 address of the new contract instance.
string address = 1;
// Data contains bytes to returned from the contract
bytes data = 2;
}
15 changes: 15 additions & 0 deletions proto/stride/icaoracle/callbacks.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package stride.icaoracle;

import "stride/icaoracle/icaoracle.proto";

option go_package = "github.com/Stride-Labs/stride/v12/x/icaoracle/types";

// Callback data for instantiating an oracle
message InstantiateOracleCallback { string oracle_chain_id = 1; }

// Callback data for updating a value in the oracle
message UpdateOracleCallback {
string oracle_chain_id = 1;
Metric metric = 2;
}
20 changes: 20 additions & 0 deletions proto/stride/icaoracle/contract.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";
package stride.icaoracle;

option go_package = "github.com/Stride-Labs/stride/v12/x/icaoracle/types";

// InstanitateOracleContract is the contract-specific instantiate message
message MsgInstantiateOracleContract { string admin_address = 1; }

// ExecuteContractPostMetric is the contract-specific metric update message
message MsgExecuteContractPostMetric { MsgPostMetric post_metric = 1; }

// Body of PostMetric contract message
message MsgPostMetric {
string key = 1;
string value = 2;
string metric_type = 3;
int64 update_time = 4;
int64 block_height = 5;
string attributes = 6;
}
28 changes: 28 additions & 0 deletions proto/stride/icaoracle/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";
package stride.icaoracle;

import "gogoproto/gogo.proto";
import "stride/icaoracle/icaoracle.proto";

option go_package = "github.com/Stride-Labs/stride/v12/x/icaoracle/types";

// Params defines the icaoracle module parameters.
message Params {}

// GenesisState defines the icaoracle module's genesis state.
message GenesisState {
Params params = 1 [
(gogoproto.moretags) = "yaml:\"params\"",
(gogoproto.nullable) = false
];

repeated Oracle oracles = 2 [
(gogoproto.moretags) = "yaml:\"oracles\"",
(gogoproto.nullable) = false
];

repeated Metric metrics = 3 [
(gogoproto.moretags) = "yaml:\"metrics\"",
(gogoproto.nullable) = false
];
}
45 changes: 45 additions & 0 deletions proto/stride/icaoracle/icaoracle.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
syntax = "proto3";
package stride.icaoracle;

import "gogoproto/gogo.proto";

option go_package = "github.com/Stride-Labs/stride/v12/x/icaoracle/types";

// Oracle structure stores context about the CW oracle sitting a different chain
message Oracle {
string chain_id = 1;
string connection_id = 2;
string channel_id = 3;
string port_id = 4;
string ica_address = 5;
string contract_address = 6;
bool active = 7;
}

// MetricStatus indicates whether the Metric update ICA has been sent
enum MetricStatus {
METRIC_STATUS_UNSPECIFIED = 0
[ (gogoproto.enumvalue_customname) = "UNSPECIFIED" ];
METRIC_STATUS_QUEUED = 1 [ (gogoproto.enumvalue_customname) = "QUEUED" ];
METRIC_STATUS_IN_PROGRESS = 2
[ (gogoproto.enumvalue_customname) = "IN_PROGRESS" ];
}

// Metric structure stores a generic metric using a key value structure
// along with additional context
message Metric {
string key = 1;
string value = 2;
string metric_type = 3;
int64 update_time = 4;
int64 block_height = 5;
string attributes = 6;
string destination_oracle = 7;
MetricStatus status = 8;
}

// Attributes associated with a RedemptionRate metric update
message RedemptionRateAttributes {
string denom = 1;
string base_denom = 2;
}
Loading