Skip to content
Merged
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
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
all:

clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.16.69 --depth 1 --single-branch
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.16.91 --depth 1 --single-branch

clone-injective-core:
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.16.3 --depth 1 --single-branch
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.16.4 --depth 1 --single-branch
Comment on lines +4 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Analysis chain

Verify tag/branch availability for reproducible clones.

Ensure these refs exist to avoid CI flakes.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
git ls-remote --tags https://github.com/InjectiveLabs/injective-indexer.git "v1.16.91"
git ls-remote --tags https://github.com/InjectiveLabs/injective-core.git "v1.16.4"

Length of output: 115


🏁 Script executed:

#!/bin/bash
set -euo pipefail
repos=(
  "https://github.com/InjectiveLabs/injective-indexer|v1.16.91"
  "https://github.com/InjectiveLabs/injective-core|v1.16.4"
)
for entry in "${repos[@]}"; do
  url="${entry%%|*}"
  tag="${entry##*|}"
  echo "---- Checking repo page: $url  tag/branch: $tag ----"
  echo "- HTTP status for repo page:"
  curl -sSL -o /dev/null -w "%{http_code}\n" "$url" || true
  echo "- HTTP status for repo.git endpoint:"
  curl -sSL -o /dev/null -w "%{http_code}\n" "${url}.git" || true
  echo "- git ls-remote for tag/branch refs:"
  git ls-remote --heads --tags "${url}.git" "refs/tags/${tag}" "refs/heads/${tag}" || true
  echo "- sample tags (first 20 lines) from git ls-remote --tags:"
  git ls-remote --tags "${url}.git" | sed -n '1,20p' || true
  echo
done

Length of output: 999


Fix unreachable repo URLs referenced in Makefile clones

Both referenced repos/tags (InjectiveLabs/injective-indexer@v1.16.91 and InjectiveLabs/injective-core@v1.16.4) return HTTP 404 and git ls-remote failed — CI will fail to clone. Update the Makefile to point to valid repo URLs/tags (or use mirrors/commit SHAs) and re-verify with git ls-remote.

Location: Makefile lines 4-7

🤖 Prompt for AI Agents
In Makefile around lines 4 to 7, the git clone targets for
InjectiveLabs/injective-indexer@v1.16.91 and
InjectiveLabs/injective-core@v1.16.4 are returning 404s; replace those
unreachable tags with valid references or mirrors (preferred: a verified tag or
commit SHA) and update the clone commands accordingly, then run git ls-remote
<repo> <ref> for each to confirm accessibility; ensure you keep --depth 1
--single-branch and update only the URL or ref (or point to a maintained mirror)
so CI can successfully clone.


copy-exchange-client: clone-injective-indexer
rm -rf exchange/*
Expand Down Expand Up @@ -51,6 +51,12 @@ copy-chain-types: clone-injective-core
mkdir -p chain/auction/types && \
cp injective-core/injective-chain/modules/auction/types/*.pb.go chain/auction/types && \
cp injective-core/injective-chain/modules/auction/types/codec.go chain/auction/types
mkdir -p chain/downtime-detector/types && \
cp injective-core/injective-chain/modules/downtime-detector/types/*.pb.go chain/downtime-detector/types && \
cp injective-core/injective-chain/modules/downtime-detector/types/codec.go chain/downtime-detector/types && \
cp injective-core/injective-chain/modules/downtime-detector/types/constants.go chain/downtime-detector/types && \
cp injective-core/injective-chain/modules/downtime-detector/types/genesis.go chain/downtime-detector/types && \
cp injective-core/injective-chain/modules/downtime-detector/types/keys.go chain/downtime-detector/types
mkdir -p chain/erc20/types && \
cp injective-core/injective-chain/modules/erc20/types/*.pb.go chain/erc20/types && \
cp injective-core/injective-chain/modules/erc20/types/codec.go chain/erc20/types
Expand Down
146 changes: 107 additions & 39 deletions chain/auction/types/auction.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions chain/downtime-detector/types/codec.go
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()
}
83 changes: 83 additions & 0 deletions chain/downtime-detector/types/constants.go
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)
}
Loading