-
Notifications
You must be signed in to change notification settings - Fork 61
release/v1_58_3 #331
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
Merged
Merged
release/v1_58_3 #331
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ef71da5
(feat) Updated the proto definitions to match injective-core v1.16.4 …
aarmoa 594940e
(feat) added the downtime detector module to the codec configuration
aarmoa ad916d4
(feat) Updated proto definitions to match Injective core v1.16.4 and …
aarmoa 6110ccf
(fix) Updated the official tokens JSON files URLs
aarmoa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package types | ||
|
|
||
| import ( | ||
| "github.com/cosmos/cosmos-sdk/codec" | ||
| "github.com/cosmos/cosmos-sdk/codec/types" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| authzcdc "github.com/cosmos/cosmos-sdk/x/authz/codec" | ||
| ) | ||
|
|
||
| func RegisterLegacyAminoCodec(*codec.LegacyAmino) {} | ||
|
|
||
| func RegisterInterfaces(types.InterfaceRegistry) {} | ||
|
|
||
| var ( | ||
| ModuleCdc = codec.NewLegacyAmino() | ||
| ) | ||
|
|
||
| func init() { | ||
| RegisterLegacyAminoCodec(ModuleCdc) | ||
| // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be | ||
| // used to properly serialize MsgGrant and MsgExec instances | ||
| sdk.RegisterLegacyAminoCodec(ModuleCdc) | ||
| RegisterLegacyAminoCodec(authzcdc.Amino) | ||
|
|
||
| ModuleCdc.Seal() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| package types | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/tidwall/btree" | ||
| ) | ||
|
|
||
| const ( | ||
| // we don't use a `-` as RouterKey must be alphanumeric | ||
| ModuleName = "downtimedetector" | ||
| StoreKey = ModuleName | ||
| RouterKey = ModuleName | ||
|
|
||
| QuerierRoute = ModuleName | ||
| ) | ||
|
|
||
| var ( | ||
| DowntimeToDuration = btree.NewMap[Downtime, time.Duration](16) | ||
| DefaultLastDowntime = time.Unix(0, 0) | ||
| ) | ||
|
|
||
| // init initializes the DowntimeToDuration map with mappings | ||
| // from the Duration enum values to their corresponding | ||
| // time.Duration values. | ||
| func init() { | ||
| DowntimeToDuration.Set(Downtime_DURATION_30S, 30*time.Second) | ||
| DowntimeToDuration.Set(Downtime_DURATION_1M, time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_2M, 2*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_3M, 3*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_4M, 4*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_5M, 5*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_10M, 10*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_20M, 20*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_30M, 30*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_40M, 40*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_50M, 50*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_1H, time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_1_5H, time.Hour+30*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_2H, 2*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_2_5H, 2*time.Hour+30*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_3H, 3*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_4H, 4*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_5H, 5*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_6H, 6*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_9H, 9*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_12H, 12*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_18H, 18*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_24H, 24*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_36H, 36*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_48H, 48*time.Hour) | ||
| } | ||
|
|
||
| func DowntimeStrings() []string { | ||
| arr := []string{} | ||
| DowntimeToDuration.Ascend(Downtime(0), func(_ Downtime, v time.Duration) bool { | ||
| s := strings.Replace(v.String(), "m0s", "m", 1) | ||
| s = strings.Replace(s, "h0m", "h", 1) | ||
| arr = append(arr, s) | ||
| return true | ||
| }) | ||
| return arr | ||
| } | ||
|
|
||
| func DowntimeByDuration(duration time.Duration) (Downtime, error) { | ||
| var result Downtime | ||
| found := false | ||
| DowntimeToDuration.Ascend(Downtime(0), func(k Downtime, v time.Duration) bool { | ||
| if v == duration { | ||
| result = k | ||
| found = true | ||
| return false | ||
| } | ||
| return true | ||
| }) | ||
| if found { | ||
| return result, nil | ||
| } | ||
| downtimeOptions := strings.Join(DowntimeStrings(), ", ") | ||
| return result, fmt.Errorf("downtime of %s does not exist. Chain-provided downtimes [%s]", duration.String(), downtimeOptions) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Version bump looks fine; consider pinning to a commit SHA and centralizing the version.
To prevent tag retargeting and ease future bumps, prefer a variable and/or a commit SHA.
Proposed Makefile snippet (outside this line range):
Verify the tag exists and resolve its SHA:
🏁 Script executed:
Length of output: 138
Pin upstream clone to an immutable ref and centralize the version — tag v1.16.91 not found
gh API returned 404 for refs/tags/v1.16.91; Makefile line 4 currently runs
git clone ... -b v1.16.91— this will fail or be unsafe. Replace the hardcoded tag with a variable and pin to a commit SHA (or fix the tag). Example:INDEXER_TAG ?= v1.16.91
clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b $(INDEXER_TAG) --depth 1 --single-branch
For immutability prefer INDEXER_SHA and fetch+checkout that SHA instead of relying on a floating tag. Makefile:4
🤖 Prompt for AI Agents