Skip to content

Commit

Permalink
Merge branch 'main-v0.50' into nullpointer0x00-cosmos-sdk-v50-todos
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Mar 14, 2024
2 parents e63e0d3 + 8cd9893 commit 6fed1b7
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 2,817 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ jobs:
- name: Build osx binary
run: |
export VERSION=${{ needs.build_init.outputs.version }}
export WITH_CLEVELDB=false
export WITH_ROCKSDB=false
make build-release-zip
- name: Provenanced version
# TODO[1760]: github: Re-enable the build_osx provenanced version step.
Expand Down Expand Up @@ -102,12 +100,9 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
- name: Build and install cleveldb
run: make cleveldb
- name: Build linux binary
run: |
export VERSION=${{ needs.build_init.outputs.version }}
export WITH_CLEVELDB=true
make build-release-zip
- name: Provenanced version
# TODO[1760]: github: Re-enable the build_linux provenanced version step.
Expand All @@ -121,40 +116,6 @@ jobs:
name: linux-zip
path: build/provenance*.zip

build_dbmigrate:
runs-on: ubuntu-20.04
needs:
- build_init
name: Build dbmigrate
env:
LD_LIBRARY_PATH: /usr/local/lib:/usr/local/lib/x86_64-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ needs.build_init.outputs.go_version }}
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
- name: Build and install cleveldb
run: make cleveldb
- name: Build dbmigrate binary
run: |
export VERSION=${{ needs.build_init.outputs.version }}
export WITH_CLEVELDB=true
export WITH_ROCKSDB=false
export WITH_BADGERDB=false
make build-dbmigrate-zip
- name: dbmigrate --help
run: build/dbmigrate --help
- uses: actions/upload-artifact@v3
with:
name: dbmigrate-zip
path: build/dbmigrate*.zip

buf_push:
needs:
- build_init
Expand All @@ -176,7 +137,6 @@ jobs:
needs:
- build_init
- build_linux
- build_dbmigrate
if: needs.build_init.outputs.is_release == 'true'
runs-on: ubuntu-latest
name: Create Release
Expand Down Expand Up @@ -216,11 +176,6 @@ jobs:
with:
name: linux-zip
path: build/
- name: Download dbmigrate zip artifact
uses: actions/download-artifact@v3
with:
name: dbmigrate-zip
path: build/
- name: Create release items
id: create-items
run: |
Expand All @@ -235,16 +190,6 @@ jobs:
asset_path: ./build/provenance-linux-amd64-${{ needs.build_init.outputs.version }}.zip
asset_name: provenance-linux-amd64-${{ needs.build_init.outputs.version }}.zip
asset_content_type: application/octet-stream
- name: Upload dbmigrate zip artifact
if: always() && steps.create-items.outcome == 'success'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.release_url }}
asset_path: ./build/dbmigrate-linux-amd64-${{ needs.build_init.outputs.version }}.zip
asset_name: dbmigrate-linux-amd64-${{ needs.build_init.outputs.version }}.zip
asset_content_type: application/octet-stream
- name: Upload release checksum
if: always() && steps.create-items.outcome == 'success'
uses: actions/upload-release-asset@v1
Expand Down
49 changes: 1 addition & 48 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,13 @@ jobs:
file_prefix="sim-test-${GITHUB_SHA:0:7}-${GITHUB_RUN_ATTEMPT}"
echo "Setting output: file-prefix=$file_prefix"
echo "file-prefix=$file_prefix" >> "$GITHUB_OUTPUT"
db_cache_key_hash="${{ hashFiles('scripts/cleveldb_build_and_install.sh') }}"
echo "Setting output: db-cache-key-hash=$db_cache_key_hash"
echo "db-cache-key-hash=$db_cache_key_hash" >> "$GITHUB_OUTPUT"
go_cache_key_hash="${{ hashFiles('go.sum') }}"
echo "Setting output: go-cache-key-hash=$go_cache_key_hash"
echo "go-cache-key-hash=$go_cache_key_hash" >> "$GITHUB_OUTPUT"
outputs:
go-version: '1.21'
should-run: ${{ env.GIT_DIFF }}
file-prefix: ${{ steps.def-vars.outputs.file-prefix }}
db-cache-key-suffix: sims-db3-${{ steps.def-vars.outputs.db-cache-key-hash }}
# In Order:
# * The leveldb repo tarball
# * The directory extracted from the leveldb tarball
db-cache-path: |
leveldb*.tar.gz
leveldb-*
go-cache-key-suffix: sims-go3-${{ steps.def-vars.outputs.go-cache-key-hash }}
# In Order:
# * Go binary directory
Expand All @@ -79,16 +69,8 @@ jobs:
echo " go-version: [${{ needs.setup.outputs.go-version }}]"
echo " should-run: [${{ needs.setup.outputs.should-run }}]"
echo " file-prefix: [${{ needs.setup.outputs.file-prefix }}]"
echo "db-cache-key-suffix: [${{ needs.setup.outputs.db-cache-key-suffix }}]"
echo " db-cache-path: [${{ needs.setup.outputs.db-cache-path }}]"
echo "go-cache-key-suffix: [${{ needs.setup.outputs.go-cache-key-suffix }}]"
echo " go-cache-path: [${{ needs.setup.outputs.go-cache-path }}]"
- uses: actions/cache@v3
name: Load db cache
id: db-cache-setup
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.db-cache-key-suffix }}
path: ${{ needs.setup.outputs.db-cache-path }}
- uses: actions/cache@v3
name: Load go cache
id: go-cache-setup
Expand All @@ -101,21 +83,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev wget curl build-essential cmake gcc sqlite3
- name: Build cleveldb
if: steps.db-cache-setup.outputs.cache-hit != 'true'
run: |
export CLEVELDB_DO_BUILD='true'
export CLEVELDB_DO_INSTALL='false'
export CLEVELDB_DO_CLEANUP='false'
make cleveldb
- name: Install cleveldb
run: |
export CLEVELDB_DO_BUILD='false'
export CLEVELDB_DO_INSTALL='true'
export CLEVELDB_SUDO='true'
export CLEVELDB_DO_CLEANUP='false'
make cleveldb
echo 'WITH_CLEVELDB=true' >> "$GITHUB_ENV"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.setup.outputs.go-version }}
Expand Down Expand Up @@ -198,16 +165,11 @@ jobs:
# The test-sim-simple test is pretty quick and should be able to identify glaring problems.
# The test-sim-benchmark is handy to have for each db type.
test: ["simple", "benchmark"]
db-backend: ["goleveldb", "cleveldb"]
db-backend: ["goleveldb"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
name: Load db cache
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.db-cache-key-suffix }}
path: ${{ needs.setup.outputs.db-cache-path }}
- uses: actions/cache@v3
name: Load go cache
with:
Expand All @@ -219,15 +181,6 @@ jobs:
test_logs="${{ needs.setup.outputs.file-prefix }}-${{ matrix.test }}-${{ matrix.db-backend }}-${{ matrix.os }}"
echo "Setting output: test-logs=$test_logs"
echo "test-logs=$test_logs" >> "$GITHUB_OUTPUT"
- name: Install cleveldb
if: matrix.db-backend == 'cleveldb'
run: |
export CLEVELDB_DO_BUILD='false'
export CLEVELDB_DO_INSTALL='true'
export CLEVELDB_SUDO='true'
export CLEVELDB_DO_CLEANUP='false'
make cleveldb
echo 'WITH_CLEVELDB=true' >> "$GITHUB_ENV"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.setup.outputs.go-version }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ data/
.idea/
*.swp
utils/
!cmd/dbmigrate/utils
.blockade
blockade.yaml
*.sock
Expand Down
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ linters-settings:

- github.com/grpc-ecosystem/grpc-gateway

- github.com/otiai10/copy # Used by the dbmigrate only

- github.com/provenance-io/provenance

- github.com/rakyll/statik/fs
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add CLI commands for the exchange module endpoints and queries [#1701](https://github.com/provenance-io/provenance/issues/1701).
* Add CLI command to generate autocomplete shell scripts [#1762](https://github.com/provenance-io/provenance/pull/1762).
* Create CLI commands for adding a market to a genesis file [#1757](https://github.com/provenance-io/provenance/issues/1757).
* Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).

### Improvements

* Add upgrade handler for 1.18 [#1756](https://github.com/provenance-io/provenance/pull/1756).
* Updated documentation for each module to work with docusaurus [PR 1763](https://github.com/provenance-io/provenance/pull/1763).
* Create a default market in `make run`, `localnet`, `devnet` and the `provenanced testnet` command [#1757](https://github.com/provenance-io/provenance/issues/1757).
* Remove unsupported database types [#1760](https://github.com/provenance-io/provenance/issues/1760).

### Dependencies

Expand Down
83 changes: 2 additions & 81 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,11 @@ BINDIR ?= $(GOPATH)/bin
BUILDDIR ?= $(CURDIR)/build

WITH_LEDGER ?= true
WITH_CLEVELDB ?= false
WITH_ROCKSDB ?= false
WITH_BADGERDB ?= false

# We used to use 'yes' on these flags, so at least for now, change 'yes' into 'true'
ifeq ($(WITH_LEDGER),yes)
WITH_LEDGER=true
endif
ifeq ($(WITH_CLEVELDB),yes)
WITH_CLEVELDB=true
endif
ifeq ($(WITH_ROCKSDB),yes)
WITH_ROCKSDB=true
endif
ifeq ($(WITH_BADGERDB),yes)
WITH_BADGERDB=true
endif

BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2> /dev/null)
BRANCH_PRETTY := $(subst /,-,$(BRANCH))
Expand Down Expand Up @@ -79,21 +67,6 @@ endif
# Build Flags/Tags
##############################

ifeq ($(WITH_CLEVELDB),true)
ifneq ($(have_gcc),true)
$(error gcc not installed for cleveldb support, please install or set WITH_CLEVELDB=false)
else
build_tags += gcc
build_tags += cleveldb
endif
endif
ifeq ($(WITH_ROCKSDB),true)
build_tags += rocksdb
endif
ifeq ($(WITH_BADGERDB),true)
build_tags += badgerdb
endif

ifeq ($(WITH_LEDGER),true)
ifeq ($(UNAME_S),openbsd)
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
Expand All @@ -114,20 +87,6 @@ else ifeq ($(UNAME_S),linux)
cgo_ldflags += -Wl,-rpath,\$$ORIGIN
endif

# cleveldb linker settings
ifeq ($(WITH_CLEVELDB),true)
ifeq ($(UNAME_S),darwin)
LEVELDB_PATH ?= $(shell brew --prefix leveldb 2> /dev/null)
# Only do stuff if that LEVELDB_PATH exists. Otherwise, leave it up to already installed libraries.
ifneq ($(wildcard $(LEVELDB_PATH)/.),)
cgo_cflags += -I$(LEVELDB_PATH)/include
cgo_ldflags += -L$(LEVELDB_PATH)/lib
endif
else ifeq ($(UNAME_S),linux)
# Intentionally left blank to leave it up to already installed libraries.
endif
endif

cgo_ldflags += $(CGO_LDFLAGS)
cgo_ldflags := $(strip $(cgo_ldflags))
CGO_LDFLAGS := $(cgo_ldflags)
Expand Down Expand Up @@ -206,17 +165,6 @@ endif

.PHONY: install build build-linux run

##############################
# Build DB Migration Tools #
##############################

install-dbmigrate: go.sum
CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install $(BUILD_FLAGS) ./cmd/dbmigrate

build-dbmigrate: validate-go-version go.sum
mkdir -p $(BUILDDIR)
CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -o $(BUILDDIR)/ $(BUILD_FLAGS) ./cmd/dbmigrate

##############################
# Release artifacts and plan #
##############################
Expand Down Expand Up @@ -251,14 +199,10 @@ RELEASE_PIO=$(RELEASE_BIN)/provenanced
RELEASE_ZIP_BASE=provenance-$(UNAME_S)-$(ARCH)
RELEASE_ZIP_NAME=$(RELEASE_ZIP_BASE)-$(VERSION).zip
RELEASE_ZIP=$(BUILDDIR)/$(RELEASE_ZIP_NAME)
DBMIGRATE=$(BUILDDIR)/dbmigrate
DBMIGRATE_ZIP_BASE=dbmigrate-$(UNAME_S)-$(ARCH)
DBMIGRATE_ZIP_NAME=$(DBMIGRATE_ZIP_BASE)-$(VERSION).zip
DBMIGRATE_ZIP=$(BUILDDIR)/$(DBMIGRATE_ZIP_NAME)

.PHONY: build-release-clean
build-release-clean:
rm -rf $(RELEASE_BIN) $(RELEASE_PLAN) $(RELEASE_CHECKSUM) $(RELEASE_ZIP) $(DBMIGRATE_ZIP)
rm -rf $(RELEASE_BIN) $(RELEASE_PLAN) $(RELEASE_CHECKSUM) $(RELEASE_ZIP)

.PHONY: build-release-checksum
build-release-checksum: $(RELEASE_CHECKSUM)
Expand Down Expand Up @@ -299,17 +243,6 @@ $(RELEASE_ZIP): $(RELEASE_PIO) $(RELEASE_WASM)
zip -u $(RELEASE_ZIP_NAME) bin/$(LIBWASMVM) bin/provenanced && \
cd ..

$(DBMIGRATE):
$(MAKE) build-dbmigrate

.PHONY: build-dbmigrate-zip
build-dbmigrate-zip: $(DBMIGRATE_ZIP)

$(DBMIGRATE_ZIP): $(DBMIGRATE)
cd $(BUILDDIR) && \
zip -u $(DBMIGRATE_ZIP_NAME) dbmigrate && \
cd ..

# gon packages the zip wrong. need bin/provenanced and bin/libwasmvm
.PHONY: build-release-rezip
build-release-rezip: ZIP_FROM = $(BUILDDIR)/$(RELEASE_ZIP_BASE).zip
Expand Down Expand Up @@ -370,15 +303,7 @@ linkify:
update-tocs:
scripts/update-toc.sh x docs CONTRIBUTING.md

# Download, compile, and install rocksdb so that it can be used when doing a build.
rocksdb:
scripts/rocksdb_build_and_install.sh

# Download, compile, and install cleveldb so that it can be used when doing a build.
cleveldb:
scripts/cleveldb_build_and_install.sh

.PHONY: go-mod-cache go.sum lint clean format check-built linkify update-tocs rocksdb cleveldb
.PHONY: go-mod-cache go.sum lint clean format check-built linkify update-tocs


validate-go-version: ## Validates the installed version of go against Provenance's minimum requirement.
Expand Down Expand Up @@ -406,10 +331,6 @@ PACKAGES_SIMULATION := $(filter %/simulation%,$(PACKAGES))
TEST_PACKAGES=./...
TEST_TARGETS := test-unit test-unit-amino test-unit-proto test-ledger-mock test-race test-ledger test-race

ifeq ($(WITH_CLEVELDB),true)
TAGS+= cleveldb
endif

# Test runs-specific rules. To add a new test target, just add
# a new rule, customise TAGS, ARGS and/or TEST_PACKAGES ad libitum, and
# append the new rule to the TEST_TARGETS list.
Expand Down
Loading

0 comments on commit 6fed1b7

Please sign in to comment.