Skip to content

Commit

Permalink
Merge branch 'main' into feat/update_changelog_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdv2429 authored May 6, 2024
2 parents 3510931 + 6c745ac commit 388ed5e
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality

- name: Build
run: make build
run: make build BECH32_PREFIX=ethm

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.1-alpine3.18 as go-builder
FROM golang:1.22.2-alpine3.18 as go-builder

WORKDIR /app

Expand All @@ -12,7 +12,7 @@ ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3

RUN apk add --no-cache $PACKAGES

RUN make build
RUN make build BECH32_PREFIX=ethm

FROM alpine:3.16.1

Expand Down
45 changes: 42 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
PROJECT_NAME=rollappd
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true

ifndef BECH32_PREFIX
$(error BECH32_PREFIX is not set)
endif

# don't override user values
ifeq (,$(VERSION))
Expand All @@ -22,22 +27,56 @@ TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::

export GO111MODULE = on

build_tags = netgo
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
GCCEXE = $(shell where gcc.exe 2> NUL)
ifeq ($(GCCEXE),)
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
build_tags += ledger
endif
else
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S),OpenBSD)
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
else
GCC = $(shell command -v gcc 2> /dev/null)
ifeq ($(GCC),)
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
build_tags += ledger
endif
endif
endif
endif

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

whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=dymension-rdk \
-X github.com/cosmos/cosmos-sdk/version.AppName=rollapp-evm \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) \
-X github.com/dymensionxyz/rollapp-evm/app.AccountAddressPrefix=$(BECH32_PREFIX)



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


###########
# Install #
###########


all: install

.PHONY: install
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ It uses Cosmos-SDK's [simapp](https://github.com/cosmos/cosmos-sdk/tree/main/sim
Build and install the ```rollapp-evm``` binary:

```shell
make install
export BECH32_PREFIX=ethm
make install BECH32_PREFIX=$BECH32_PREFIX
```

### Initial configuration
Expand All @@ -32,7 +33,7 @@ export the following variables:

```shell
export EXECUTABLE="rollapp-evm"

export BECH32_PREFIX="ethm"
export ROLLAPP_CHAIN_ID="rollappevm_1234-1"
export KEY_NAME_ROLLAPP="rol-user"
export BASE_DENOM="arax"
Expand Down Expand Up @@ -166,11 +167,31 @@ sed -i '' 's|rollapp_id =.*|rollapp_id = '\"$ROLLAPP_CHAIN_ID\"'|' "${ROLLAPP_HO
sh scripts/update_genesis_file.sh
```

Validate genesis file:

```shell
rollapp-evm validate-genesis
```

```shell
# this script automatically adds 2 vesting accounts, adjust the timestampts to your liking or skip this step
sh scripts/add_vesting_accounts_to_genesis_file.sh
```

### Change to 3s block time for ibc connection initialization

Linux:

```shell
sed -i 's/empty_blocks_max_time = "1h0m0s"/empty_blocks_max_time = "3s"/' ${ROLLAPP_HOME_DIR}/config/dymint.toml
```

Mac:

```shell
sed -i '' 's/empty_blocks_max_time = "1h0m0s"/empty_blocks_max_time = "3s"/' ${ROLLAPP_HOME_DIR}/config/dymint.toml
```

### Run rollapp locally

```shell
Expand Down
11 changes: 6 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ const (
)

var (
kvstorekeys = []string{
authtypes.StoreKey, authzkeeper.StoreKey,
feegrant.StoreKey, banktypes.StoreKey,
AccountAddressPrefix string
kvstorekeys = []string{
authtypes.StoreKey, banktypes.StoreKey,
stakingtypes.StoreKey, seqtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey,
Expand All @@ -162,6 +162,7 @@ var (
evmtypes.StoreKey, feemarkettypes.StoreKey,
// evmos keys
erc20types.StoreKey,
claimstypes.StoreKey,

Check failure on line 165 in app/app.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: claimstypes (typecheck)
denommetadatamoduletypes.StoreKey,
}
)
Expand Down Expand Up @@ -487,7 +488,7 @@ func NewRollapp(

// Create IBC Keeper
app.IBCKeeper = ibckeeper.NewKeeper(
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper,
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.SequencersKeeper, app.UpgradeKeeper, scopedIBCKeeper,
)

// Register the proposal types
Expand Down Expand Up @@ -541,10 +542,10 @@ func NewRollapp(
app.DenomMetadataKeeper = denommetadatamodulekeeper.NewKeeper(
appCodec,
keys[denommetadatamoduletypes.StoreKey],
app.SequencersKeeper,
app.BankKeeper,
app.TransferKeeper,
denomMetadataHooks,
app.GetSubspace(denommetadatamoduletypes.ModuleName),
)

app.HubGenesisKeeper = hubgenkeeper.NewKeeper(
Expand Down
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module github.com/dymensionxyz/rollapp-evm

go 1.22.1
go 1.22.2

require (
cosmossdk.io/errors v1.0.1
github.com/bcdevtools/block-explorer-rpc-cosmos v1.1.2
github.com/bcdevtools/evm-block-explorer-rpc-cosmos v1.1.1-de
github.com/bcdevtools/block-explorer-rpc-cosmos v1.1.0
github.com/bcdevtools/evm-block-explorer-rpc-cosmos v1.1.0
github.com/cosmos/cosmos-sdk v0.46.16
github.com/cosmos/ibc-go/v6 v6.2.1
github.com/dymensionxyz/dymension-rdk v1.1.0-rc02
github.com/dymensionxyz/dymint v1.1.0-rc01
github.com/ethereum/go-ethereum v1.10.26
github.com/evmos/ethermint v0.22.0
github.com/dymensionxyz/dymension-rdk v1.6.0
github.com/dymensionxyz/dymint v1.1.3-rc02
github.com/ethereum/go-ethereum v1.12.0
github.com/evmos/evmos/v12 v12.1.6
github.com/gorilla/mux v1.8.1
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
Expand Down Expand Up @@ -128,7 +128,7 @@ require (
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
Expand Down Expand Up @@ -306,7 +306,7 @@ require (
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand All @@ -321,11 +321,12 @@ replace (
github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/availproject/go-substrate-rpc-client/v4 v4.0.12-avail-1.4.0-rc1-5e286e3
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
// use Evmos geth fork
github.com/evmos/ethermint => github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20240425133751-6d4e0eb538c0

github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26
github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/gorilla/rpc => github.com/dymensionxyz/rpc v1.3.1
github.com/libp2p/go-libp2p-pubsub => github.com/dymensionxyz/go-libp2p-pubsub v0.0.0-20231219183151-4504d4995913
github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2
github.com/rollkit/celestia-openrpc => github.com/celestiaorg/celestia-openrpc v0.3.0
// replace broken goleveldb
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
Expand Down
Loading

0 comments on commit 388ed5e

Please sign in to comment.