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

upgrade to support v0.51 + backwards compatible wasm parsing #59

Open
wants to merge 29 commits into
base: chains/nyx/mainnet
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
472ead2
build(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#674)
dependabot[bot] Nov 23, 2023
6174514
build(deps): Bump github.com/golangci/golangci-lint from 1.55.1 to 1.…
dependabot[bot] Nov 23, 2023
18bb694
build(deps): Bump cosmossdk.io/math from 1.1.2 to 1.2.0 (#677)
dependabot[bot] Nov 23, 2023
78fd2ad
build(deps): Bump github.com/go-co-op/gocron from 1.35.3 to 1.36.0 (#…
dependabot[bot] Nov 23, 2023
f65a87c
build(deps): Bump amannn/action-semantic-pull-request from 5.3.0 to 5…
dependabot[bot] Nov 23, 2023
433afde
build(deps): Bump github.com/go-co-op/gocron from 1.36.0 to 1.37.0 (#…
dependabot[bot] Dec 28, 2023
c9b0544
build(deps): Bump github.com/prometheus/client_golang from 1.17.0 to …
dependabot[bot] Dec 28, 2023
0a9940b
build(deps): Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#688)
dependabot[bot] Dec 28, 2023
900d294
build(deps): Bump google.golang.org/grpc from 1.59.0 to 1.60.1 (#689)
dependabot[bot] Dec 28, 2023
c2014dc
build(deps): Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0…
dependabot[bot] Dec 29, 2023
340f59b
build(deps): Bump github.com/cometbft/cometbft from 0.37.2 to 0.38.2 …
dependabot[bot] Jan 2, 2024
0fec8c8
chore: fix typos (#687)
GoodDaisy Feb 1, 2024
ab2774e
build(deps): Bump google.golang.org/grpc from 1.60.1 to 1.61.0 (#697)
dependabot[bot] Feb 1, 2024
366f26e
feat: add `message_type` module and store msg types inside `message_t…
MonikaCat Feb 2, 2024
f7336cc
build(deps): Bump github.com/rs/zerolog from 1.31.0 to 1.32.0 (#705)
dependabot[bot] Feb 5, 2024
175993c
build(deps): Bump actions/setup-go from 4 to 5 (#683)
dependabot[bot] Feb 5, 2024
d744a9f
build(deps): Bump codecov/codecov-action from 4.pre.beta to 4.0.1 (#703)
dependabot[bot] Feb 5, 2024
4590e64
fix: add x/gov module proposal status change from deposit to voting (…
dzmitryhil Feb 5, 2024
3a54294
chore: update BDJuno name to Callisto (#704)
MonikaCat Feb 5, 2024
631ae42
fix: replace message related to json into JSON type from JSONB (#723)
dadamu Apr 17, 2024
cf05236
fix: re-add support for gov v1beta1 messages (#725)
dadamu Apr 17, 2024
d43ec0e
ci: fix secret env name of docker-build (#731)
dadamu Apr 17, 2024
09f92fa
fix: add missing proposal event type handling during update proposal …
dadamu Apr 17, 2024
868bbd5
feat: add parse gov params command (#735)
dadamu Jun 21, 2024
ca1ebaa
feat: support cosmos-sdk v0.50.x (#746)
dadamu Jun 25, 2024
055c368
bdjuno -> callisto + gov parsing
pwnfoo Jul 2, 2024
4b0e377
migrate to cosmos v0.5x
pwnfoo Jul 2, 2024
edc6ace
feat: wasm parsing for sdk >0.50
pwnfoo Jul 3, 2024
18da81f
make linter happy
pwnfoo Jul 3, 2024
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
59 changes: 59 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: docker-build

on:
push:
branches:
- cosmos/*/*
- chains/*/*

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Set Callisto chain name 🔧
shell: bash
run: echo "CHAIN_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_ENV

- name: Set Callisto version 🔧
shell: bash
run: echo "GITHUB_VERSION=$(git describe --tags)" >> $GITHUB_ENV

- name: Prepare tags 🏷️
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKERHUB_BDJUNO_REPO }}
CHAIN_NAME="${{env.CHAIN_NAME}}"
VERSION="${{env.GITHUB_VERSION}}"
TAGS="${DOCKER_IMAGE}:${CHAIN_NAME}-${VERSION}"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')

- name: Determine Dockerfile to use 🔍
run: |
if [[ -f Dockerfile.cosmwasm ]]; then
export DOCKERFILE=Dockerfile.cosmwasm
else
export DOCKERFILE=Dockerfile.default
fi
echo "DOCKERFILE=${DOCKERFILE}" >> $GITHUB_ENV

- name: Set up Docker Buildx 🧰
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub 👤
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push 📤
uses: docker/build-push-action@v5
with:
context: .
file: "./${{ env.DOCKERFILE }}"
push: true
tags: ${{ steps.prep.outputs.tags }}
16 changes: 16 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
uses: actions/checkout@v4

- name: Setup Go 🧰
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"

- name: Compute diff 📜
uses: technote-space/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
uses: actions/checkout@v4

- name: Setup Go 🧰
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"

- name: Compute diff 📜
uses: technote-space/[email protected]
Expand All @@ -47,6 +47,6 @@ jobs:

- name: Upload coverage 📤
if: "env.GIT_DIFF != ''"
uses: codecov/codecov-action@v4-beta
uses: codecov/codecov-action@v4.0.1
with:
file: ./coverage.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
build/
pgdata
vendor/

# Configuration
*.toml
Expand Down
89 changes: 46 additions & 43 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Unreleased
- ([\#610](https://github.com/forbole/bdjuno/pull/610)) Add support for gov `v1` proposals
- ([\#652](https://github.com/forbole/bdjuno/pull/652)) Update gov module parsing
- ([\#610](https://github.com/forbole/callisto/pull/610)) Add support for gov `v1` proposals
- ([\#652](https://github.com/forbole/callisto/pull/652)) Update gov module parsing
- ([\#702](https://github.com/forbole/callisto/pull/702)) Add `message_type` module and store msg types inside `message_type` table, add `messages_by_type` function to allow to query messages by their types
- ([\#704](https://github.com/forbole/callisto/pull/704)) Update `BDJuno` name to `Callisto`

## Version v4.0.0
## Notes
Expand All @@ -9,56 +11,57 @@ This version is thought to be used with Cosmos SDK `v0.47.x`.
### Changes

#### Parse Command
- ([\#492](https://github.com/forbole/bdjuno/pull/492)) Add parse command for periodic tasks: `x/bank` total supply, `x/distribution` community pool, `x/mint` inflation, `pricefeed` token price and price history, `x/staking` staking pool
- ([\#492](https://github.com/forbole/callisto/pull/492)) Add parse command for periodic tasks: `x/bank` total supply, `x/distribution` community pool, `x/mint` inflation, `pricefeed` token price and price history, `x/staking` staking pool

#### Upgrade Module
- ([\#467](https://github.com/forbole/bdjuno/pull/467)) Store software upgrade plan and refresh data at upgrade height
- ([\#467](https://github.com/forbole/callisto/pull/467)) Store software upgrade plan and refresh data at upgrade height

#### Staking Module
- ([\#443](https://github.com/forbole/bdjuno/pull/443)) Remove tombstone status from staking module(already stored in slashing module)
- ([\#455](https://github.com/forbole/bdjuno/pull/455)) Added `unbonding_tokens` and `staked_not_bonded_tokens` values to staking pool table
- ([\#536](https://github.com/forbole/bdjuno/pull/536)) Fix `PoolSnapshot` tokens type from `sdk.Int` to `sdkmath.Int`
- ([\#443](https://github.com/forbole/callisto/pull/443)) Remove tombstone status from staking module(already stored in slashing module)
- ([\#455](https://github.com/forbole/callisto/pull/455)) Added `unbonding_tokens` and `staked_not_bonded_tokens` values to staking pool table
- ([\#536](https://github.com/forbole/callisto/pull/536)) Fix `PoolSnapshot` tokens type from `sdk.Int` to `sdkmath.Int`

#### Gov Module
- ([\#461](https://github.com/forbole/bdjuno/pull/461)) Parse `x/gov` genesis with `genesisDoc.InitialHeight` instead of the hard-coded height 1
- ([\#465](https://github.com/forbole/bdjuno/pull/465)) Get open proposal ids in deposit or voting period by block time instead of current time
- ([\#489](https://github.com/forbole/bdjuno/pull/489)) Remove block height foreign key from proposal_vote and proposal_deposit tables and add column timestamp
- ([\#499](https://github.com/forbole/bdjuno/pull/499)) Check if proposal has passed voting end time before marking it invalid
- ([\#523](https://github.com/forbole/bdjuno/pull/523)) Update proposal snapshots handling on block

- ([\#461](https://github.com/forbole/callisto/pull/461)) Parse `x/gov` genesis with `genesisDoc.InitialHeight` instead of the hard-coded height 1
- ([\#465](https://github.com/forbole/callisto/pull/465)) Get open proposal ids in deposit or voting period by block time instead of current time
- ([\#489](https://github.com/forbole/callisto/pull/489)) Remove block height foreign key from proposal_vote and proposal_deposit tables and add column timestamp
- ([\#499](https://github.com/forbole/callisto/pull/499)) Check if proposal has passed voting end time before marking it invalid
- ([\#523](https://github.com/forbole/callisto/pull/523)) Update proposal snapshots handling on block
- ([\#681](https://github.com/forbole/callisto/pull/681)) Handle proposal status change from deposit to voting
-
#### Daily refetch
- ([\#454](https://github.com/forbole/bdjuno/pull/454)) Added `daily refetch` module to refetch missing blocks every day
- ([\#454](https://github.com/forbole/callisto/pull/454)) Added `daily refetch` module to refetch missing blocks every day

#### Hasura
- ([\#473](https://github.com/forbole/bdjuno/pull/473)) Improved Hasura permissions
- ([\#491](https://github.com/forbole/bdjuno/pull/491)) Add host address to Hasura actions
- ([\#473](https://github.com/forbole/callisto/pull/473)) Improved Hasura permissions
- ([\#491](https://github.com/forbole/callisto/pull/491)) Add host address to Hasura actions

### Dependencies
- ([\#542](https://github.com/forbole/bdjuno/pull/542)) Updated Juno to `v5.1.0`
- ([\#542](https://github.com/forbole/callisto/pull/542)) Updated Juno to `v5.1.0`


## Version v3.2.0
### Changes
#### Mint module
- ([\#432](https://github.com/forbole/bdjuno/pull/432)) Update inflation rate when mint param change proposal is passed
- ([\#432](https://github.com/forbole/callisto/pull/432)) Update inflation rate when mint param change proposal is passed

#### Gov module
- ([\#401](https://github.com/forbole/bdjuno/pull/401)) Update the proposal status to the latest in `bdjuno parse gov proposal [id]` command
- ([\#430](https://github.com/forbole/bdjuno/pull/430)) Update the proposals that have invalid status but can still be in voting or deposit periods
- ([\#401](https://github.com/forbole/callisto/pull/401)) Update the proposal status to the latest in `bdjuno parse gov proposal [id]` command
- ([\#430](https://github.com/forbole/callisto/pull/430)) Update the proposals that have invalid status but can still be in voting or deposit periods

### Dependencies
- ([\#440](https://github.com/forbole/bdjuno/pull/440)) Updated Juno to `v3.3.0`
- ([\#440](https://github.com/forbole/callisto/pull/440)) Updated Juno to `v3.3.0`

## Version v3.1.0
### Dependencies
- ([\#412](https://github.com/forbole/bdjuno/pull/412)) Updated Juno to `v3.2.1`
- ([\#412](https://github.com/forbole/callisto/pull/412)) Updated Juno to `v3.2.1`

### Changes
#### Hasura
- ([\#395](https://github.com/forbole/bdjuno/pull/395)) Remove time label from Hasura Prometheus monitoring
- ([\#395](https://github.com/forbole/callisto/pull/395)) Remove time label from Hasura Prometheus monitoring

#### Bank module
- ([\#410](https://github.com/forbole/bdjuno/pull/410)) Change total supply query from only 1 page to all pages
- ([\#410](https://github.com/forbole/callisto/pull/410)) Change total supply query from only 1 page to all pages

## Version v3.0.1
### Dependencies
Expand All @@ -70,36 +73,36 @@ This version introduces breaking changes to `transaction` and `message` PostgreS

### New features
#### CLI
- ([\#356](https://github.com/forbole/bdjuno/pull/356)) Implemented `migrate` command to perform easy migration to higher BDJuno versions
- ([\#356](https://github.com/forbole/bdjuno/pull/356)) Updated `parse-genesis` command to parse genesis file without accessing the node
- ([\#356](https://github.com/forbole/callisto/pull/356)) Implemented `migrate` command to perform easy migration to higher BDJuno versions
- ([\#356](https://github.com/forbole/callisto/pull/356)) Updated `parse-genesis` command to parse genesis file without accessing the node

#### Database
- ([\#356](https://github.com/forbole/bdjuno/pull/356)) Added PostgreSQL table partition to `transaction` and `message` table
- ([\#356](https://github.com/forbole/bdjuno/pull/356)) Created new `messages_by_address` function
- ([\#356](https://github.com/forbole/callisto/pull/356)) Added PostgreSQL table partition to `transaction` and `message` table
- ([\#356](https://github.com/forbole/callisto/pull/356)) Created new `messages_by_address` function

### Changes
#### Hasura
- ([\#377](https://github.com/forbole/bdjuno/pull/377)) Updated Hasura metadata
- ([\#381](https://github.com/forbole/bdjuno/pull/381)) Hasura actions are now a module
- ([\#377](https://github.com/forbole/callisto/pull/377)) Updated Hasura metadata
- ([\#381](https://github.com/forbole/callisto/pull/381)) Hasura actions are now a module

### Dependencies
- ([\#356](https://github.com/forbole/bdjuno/pull/356)) Updated Juno to `v3.0.0`
- ([\#356](https://github.com/forbole/callisto/pull/356)) Updated Juno to `v3.0.0`

## Version v2.0.0
### Notes
This version introduces breaking changes to certain address-specific data that is no longer periodically parsed from the node and stored in the database. Instead, the data is now obtained directly from the node when needed using Hasura Actions. Read more details about [migrating to v2.0.0](https://docs.bigdipper.live/cosmos-based/parser/migrations/v2.0.0)

### New features
#### CLI
- ([\#257](https://github.com/forbole/bdjuno/pull/257)) Added `parse-genesis` command to parse the genesis file
- ([\#228](https://github.com/forbole/bdjuno/pull/228)) ([\#248](https://github.com/forbole/bdjuno/pull/248)) Added `fix` command:
- ([\#257](https://github.com/forbole/callisto/pull/257)) Added `parse-genesis` command to parse the genesis file
- ([\#228](https://github.com/forbole/callisto/pull/228)) ([\#248](https://github.com/forbole/callisto/pull/248)) Added `fix` command:
- `auth`: fix vesting accounts details
- `blocks`: fix missing blocks and transactions from given start height
- `gov`: fix proposal with given proposal ID
- `staking`: fix validators info at the latest height

#### Hasura Actions
- ([\#329](https://github.com/forbole/bdjuno/pull/329)) Implemented Hasura Actions service to replace periodic queries. If you are using GraphQL queries on your application, you should updated the old queries to use the below new actions instead.
- ([\#329](https://github.com/forbole/callisto/pull/329)) Implemented Hasura Actions service to replace periodic queries. If you are using GraphQL queries on your application, you should updated the old queries to use the below new actions instead.
Here's a list of data acquired through Hasura Actions:
- Of a certain address/delegator:
- Account balance (`action_account_balance`)
Expand All @@ -115,25 +118,25 @@ This version introduces breaking changes to certain address-specific data that i
- Delegations to this validator (`action_validator_delegations`)
- Redelegations from this validator (`action_validator_redelegations_from`)
- Unbonding delegations (`action_validator_unbonding_delegations`)
- ([\#352](https://github.com/forbole/bdjuno/pull/352)) Added prometheus monitoring to hasura actions
- ([\#352](https://github.com/forbole/callisto/pull/352)) Added prometheus monitoring to hasura actions

#### Local node support
- Added the support for `node.type = "local"` for parsing a static local node without the usage gRPC queries: [config reference](https://docs.bigdipper.live/cosmos-based/parser/config/config#node).

#### Modules
- ([\#232](https://github.com/forbole/bdjuno/pull/232)) Updated the `x/auth` module support to handle and store `vesting accounts` and `vesting periods` inside the database.
- ([\#276](https://github.com/forbole/bdjuno/pull/276)) Added the support for the `x/feegrant` module (v0.44.x)
- ([\#232](https://github.com/forbole/callisto/pull/232)) Updated the `x/auth` module support to handle and store `vesting accounts` and `vesting periods` inside the database.
- ([\#276](https://github.com/forbole/callisto/pull/276)) Added the support for the `x/feegrant` module (v0.44.x)

### Changes

#### CLI
- ([\#351](https://github.com/forbole/bdjuno/pull/351)) Fixed version display for `bdjuno version` cmd
- ([\#351](https://github.com/forbole/callisto/pull/351)) Fixed version display for `bdjuno version` cmd

#### Database
- ([\#300](https://github.com/forbole/bdjuno/pull/300)) Changed `bonded_tokens` and `not_bonded_tokens` type inside `staking_pool` table to `TEXT` to avoid value overflow
- ([\#275](https://github.com/forbole/bdjuno/pull/275)) Added `tombstoned` column inside `validator_status` table
- ([\#232](https://github.com/forbole/bdjuno/pull/232)) Added `vesting_account` and `vesting_period` table
- ([\#276](https://github.com/forbole/bdjuno/pull/276)) Added `fee_grant_allowance` table (v0.44.x)
- ([\#300](https://github.com/forbole/callisto/pull/300)) Changed `bonded_tokens` and `not_bonded_tokens` type inside `staking_pool` table to `TEXT` to avoid value overflow
- ([\#275](https://github.com/forbole/callisto/pull/275)) Added `tombstoned` column inside `validator_status` table
- ([\#232](https://github.com/forbole/callisto/pull/232)) Added `vesting_account` and `vesting_period` table
- ([\#276](https://github.com/forbole/callisto/pull/276)) Added `fee_grant_allowance` table (v0.44.x)

#### Modules
- ([\#353](https://github.com/forbole/bdjuno/pull/353)) Removed the support for the `history` module
- ([\#353](https://github.com/forbole/callisto/pull/353)) Removed the support for the `history` module
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM golang:1.19-bullseye AS builder
WORKDIR /go/src/github.com/forbole/bdjuno
WORKDIR /go/src/github.com/forbole/callisto
COPY . ./
RUN go mod download
RUN make build
Expand All @@ -12,7 +12,7 @@ WORKDIR /root
RUN apt-get update && apt-get install ca-certificates -y
COPY --from=builder /deps.txt /root/deps.txt
COPY --from=builder /go/pkg/mod/github.com/!cosm!wasm/[email protected]/internal/api/libwasmvm.x86_64.so /root
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /root/bdjuno
COPY --from=builder /go/src/github.com/forbole/callisto/build/bdjuno /root/bdjuno
ENV LD_LIBRARY_PATH=/root
CMD [ "bdjuno" ]

8 changes: 4 additions & 4 deletions Dockerfile.cosmwasm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FROM golang:1.20-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
WORKDIR /go/src/github.com/forbole/callisto
COPY . ./

RUN apk update && apk add --no-cache ca-certificates build-base git
Expand All @@ -17,6 +17,6 @@ RUN LINK_STATICALLY=true BUILD_TAGS="muslc" make build

FROM alpine:latest
RUN apk update && apk add --no-cache ca-certificates build-base
WORKDIR /bdjuno
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /usr/bin/bdjuno
CMD [ "bdjuno" ]
WORKDIR /callisto
COPY --from=builder /go/src/github.com/forbole/callisto/build/callisto /usr/bin/callisto
CMD [ "callisto" ]
8 changes: 4 additions & 4 deletions Dockerfile.default
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.20-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
WORKDIR /go/src/github.com/forbole/callisto
COPY . ./
RUN go mod download
RUN make build

FROM alpine:latest
WORKDIR /bdjuno
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /usr/bin/bdjuno
CMD [ "bdjuno" ]
WORKDIR /callisto
COPY --from=builder /go/src/github.com/forbole/callisto/build/callisto /usr/bin/callisto
CMD [ "callisto" ]
Loading
Loading