Skip to content

Commit

Permalink
Merge branch 'chains/evmos/mainnet' of https://github.com/forbole/bdjuno
Browse files Browse the repository at this point in the history
 into chains/evmos/testnet
  • Loading branch information
MonikaCat committed Mar 22, 2023
2 parents 79db84f + 4ce0cc5 commit 26ad5e3
Show file tree
Hide file tree
Showing 229 changed files with 3,128 additions and 1,984 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,28 @@ jobs:
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@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: "./${{ env.DOCKERFILE }}"
push: true
tags: ${{ steps.prep.outputs.tags }}
tags: ${{ steps.prep.outputs.tags }}
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4.5.0
- uses: amannn/action-semantic-pull-request@v5.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
timeout-minutes: 6
steps:
- uses: actions/checkout@v3
- uses: technote-space/[email protected].0
- uses: technote-space/[email protected].2
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- uses: golangci/golangci-lint-action@v3.2.0
- uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.28
version: v1.50.1
args: --timeout 10m
github-token: ${{ secrets.GITHUB_TOKEN }}
if: "env.GIT_DIFF != ''"
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Test & Create coverage report
run: make install test-unit stop-docker-test
- name: Upload cove coverage
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
# Disable until Msg-based gov proposals are fully implemented
- text: "SA1019:"
linters:
- staticcheck
max-issues-per-linter: 10000
max-same-issues: 10000

Expand Down
42 changes: 41 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## Unreleased
### Changes

#### Evmos Gov Module
- ([\#519](https://github.com/forbole/bdjuno/pull/519)) Upgrade evmos version to `v10.0.0`, update proposals parsing to correctly parse `v1` gov module proposals details

#### CI
- ([\#508](https://github.com/forbole/bdjuno/pull/508)) Upgrade workflow golangci version to v1.50.1

#### 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

#### Upgrade Module
- ([\#467](https://github.com/forbole/bdjuno/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`

#### 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

#### Daily refetch
- ([\#454](https://github.com/forbole/bdjuno/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

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

## Version v3.2.0
### Changes
#### Mint module
Expand All @@ -7,6 +44,9 @@
- ([\#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

### Inflation module
- ([\#438](https://github.com/forbole/bdjuno/pull/438)) Implement `evmos` `x/inflation` module

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

Expand Down Expand Up @@ -97,4 +137,4 @@ This version introduces breaking changes to certain address-specific data that i
- ([\#276](https://github.com/forbole/bdjuno/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/bdjuno/pull/353)) Removed the support for the `history` module
22 changes: 22 additions & 0 deletions Dockerfile.cosmwasm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@


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

RUN apk update && apk add --no-cache ca-certificates build-base git
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 9ecb037336bd56076573dc18c26631a9d2099a7f2b40dc04b6cae31ffb4c8f9a
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 6e4de7ba9bad4ae9679c7f9ecf7e283dd0160e71567c6a7be6ae47c81ebe7f32
## Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a
RUN go mod download
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" ]
4 changes: 2 additions & 2 deletions Dockerfile → Dockerfile.default
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-alpine AS builder
FROM golang:1.18-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
COPY . ./
Expand All @@ -8,4 +8,4 @@ RUN make build
FROM alpine:latest
WORKDIR /bdjuno
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /usr/bin/bdjuno
CMD [ "bdjuno" ]
CMD [ "bdjuno" ]
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ all: lint build test-unit
### Build flags ###
###############################################################################

LD_FLAGS = -X github.com/forbole/juno/v3/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v3/cmd.Commit=$(COMMIT)
LD_FLAGS = -X github.com/forbole/juno/v4/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v4/cmd.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(LD_FLAGS)'

ifeq ($(LINK_STATICALLY),true)
LD_FLAGS += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
endif

build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

BUILD_FLAGS := -ldflags '$(LD_FLAGS)' -tags "$(build_tags)"

###############################################################################
### Build ###
Expand Down
26 changes: 13 additions & 13 deletions cmd/bdjuno/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ package main

import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/forbole/juno/v3/cmd"
initcmd "github.com/forbole/juno/v3/cmd/init"
parsetypes "github.com/forbole/juno/v3/cmd/parse/types"
startcmd "github.com/forbole/juno/v3/cmd/start"
"github.com/forbole/juno/v3/modules/messages"
"github.com/forbole/juno/v4/cmd"
initcmd "github.com/forbole/juno/v4/cmd/init"
parsetypes "github.com/forbole/juno/v4/cmd/parse/types"
startcmd "github.com/forbole/juno/v4/cmd/start"
"github.com/forbole/juno/v4/modules/messages"

migratecmd "github.com/forbole/bdjuno/v3/cmd/migrate"
parsecmd "github.com/forbole/bdjuno/v3/cmd/parse"
migratecmd "github.com/forbole/bdjuno/v4/cmd/migrate"
parsecmd "github.com/forbole/bdjuno/v4/cmd/parse"

"github.com/forbole/bdjuno/v3/types/config"
"github.com/forbole/bdjuno/v4/types/config"

"github.com/forbole/bdjuno/v3/database"
"github.com/forbole/bdjuno/v3/modules"
"github.com/forbole/bdjuno/v4/database"
"github.com/forbole/bdjuno/v4/modules"

gaiaapp "github.com/cosmos/gaia/v7/app"
evmosapp "github.com/tharsis/evmos/v5/app"
"github.com/cosmos/cosmos-sdk/simapp"
evmosapp "github.com/evmos/evmos/v11/app"
)

func main() {
Expand Down Expand Up @@ -56,7 +56,7 @@ func main() {
// This should be edited by custom implementations if needed.
func getBasicManagers() []module.BasicManager {
return []module.BasicManager{
gaiaapp.ModuleBasics,
simapp.ModuleBasics,
evmosapp.ModuleBasics,
}
}
Expand Down
9 changes: 3 additions & 6 deletions cmd/migrate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ import (
"fmt"
"os"

v2 "github.com/forbole/juno/v3/cmd/migrate/v2"
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
"github.com/spf13/cobra"

v3 "github.com/forbole/bdjuno/v3/cmd/migrate/v3"
v3 "github.com/forbole/bdjuno/v4/cmd/migrate/v3"
)

type Migrator func(parseCfg *parsecmdtypes.Config) error

var (
migrations = map[string]Migrator{
"v2": v2.RunMigration,
"v3": v3.RunMigration,
}
)
Expand All @@ -34,8 +32,7 @@ func NewMigrateCmd(appName string, parseConfig *parsecmdtypes.Config) *cobra.Com
Use: "migrate [to-version]",
Short: "Perform the migrations from the current version to the specified one",
Long: `Migrates all the necessary things (config file, database, etc) from the current version to the new one.
If you are upgrading from a very old version to the latest one, migrations must be performed in order
(eg. to migrate from v1 to v3 you need to do v1 -> v2 and then v2 -> v3).
Note that migrations must be performed in order: to migrate from vX to vX+2 you need to do vX -> vX+1 and then vX+1 -> vX+2.
`,
Example: fmt.Sprintf("%s migrate v3", appName),
Args: cobra.RangeArgs(0, 1),
Expand Down
10 changes: 5 additions & 5 deletions cmd/migrate/v3/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"fmt"
"io/ioutil"

"github.com/forbole/bdjuno/v3/modules/actions"
"github.com/forbole/bdjuno/v4/modules/actions"

parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"

"gopkg.in/yaml.v3"

junov3 "github.com/forbole/juno/v3/cmd/migrate/v3"
"github.com/forbole/juno/v3/types/config"
junov3 "github.com/forbole/juno/v4/cmd/migrate/v4"
"github.com/forbole/juno/v4/types/config"
)

// RunMigration runs the migrations from v2 to v3
Expand Down Expand Up @@ -59,7 +59,7 @@ func migrateConfig() (Config, error) {
}

if cfg.Actions == nil {
cfg.Actions = actions.NewConfig(3000, nil)
cfg.Actions = actions.NewConfig("127.0.0.1", 3000, nil)
}

return cfg, nil
Expand Down
4 changes: 2 additions & 2 deletions cmd/migrate/v3/types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package v3

import (
v3 "github.com/forbole/juno/v3/cmd/migrate/v3"
v3 "github.com/forbole/juno/v4/cmd/migrate/v3"

"github.com/forbole/bdjuno/v3/modules/actions"
"github.com/forbole/bdjuno/v4/modules/actions"
)

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/v3/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"path"

"github.com/forbole/juno/v3/types/config"
"github.com/forbole/juno/v4/types/config"
"gopkg.in/yaml.v3"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/parse/auth/cmd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package auth

import (
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
"github.com/spf13/cobra"
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/parse/auth/vesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"encoding/json"
"fmt"

parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types"
"github.com/forbole/juno/v3/types/config"
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
"github.com/forbole/juno/v4/types/config"
"github.com/spf13/cobra"

"github.com/forbole/bdjuno/v3/database"
authutils "github.com/forbole/bdjuno/v3/modules/auth"
"github.com/forbole/bdjuno/v3/utils"
"github.com/forbole/bdjuno/v4/database"
authutils "github.com/forbole/bdjuno/v4/modules/auth"
"github.com/forbole/bdjuno/v4/utils"
)

// vestingCmd returns a Cobra command that allows to fix the vesting data for the accounts
Expand Down Expand Up @@ -38,7 +38,7 @@ func vestingCmd(parseConfig *parsecmdtypes.Config) *cobra.Command {
return fmt.Errorf("error unmarshalling genesis doc: %s", err)
}

vestingAccounts, err := authutils.GetGenesisVestingAccounts(appState, parseCtx.EncodingConfig.Marshaler)
vestingAccounts, err := authutils.GetGenesisVestingAccounts(appState, parseCtx.EncodingConfig.Codec)
if err != nil {
return fmt.Errorf("error while gestting vesting accounts: %s", err)
}
Expand Down
20 changes: 20 additions & 0 deletions cmd/parse/bank/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package bank

import (
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
"github.com/spf13/cobra"
)

// NewBankCmd returns the Cobra command allowing to fix various things related to the x/bank module
func NewBankCmd(parseConfig *parsecmdtypes.Config) *cobra.Command {
cmd := &cobra.Command{
Use: "bank",
Short: "Fix things related to the x/bank module",
}

cmd.AddCommand(
supplyCmd(parseConfig),
)

return cmd
}
Loading

0 comments on commit 26ad5e3

Please sign in to comment.