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

bump pfm #183

Merged
merged 6 commits into from
Mar 8, 2024
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
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker build . -t terpnetwork/terpd:latest
# docker run --rm -it terpnetwork/terpd:latest /bin/sh
FROM golang:1.19-alpine3.15 AS go-builder
FROM golang:1.21-alpine AS go-builder
ARG arch=x86_64

# this comes from standard alpine nightly file
Expand All @@ -16,21 +16,25 @@ WORKDIR /code
COPY . /code/
# See https://github.com/CosmWasm/wasmvm/releases

ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep b89c242ffe2c867267621a6469f07ab70fc204091809d9c6f482c3fdf9293830
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep c0f4614d0835be78ac8f3d647a70ccd7ed9f48632bc1374db04e4df2245cb467
# Cosmwasm - Download correct libwasmvm version
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)

# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a
COPY . .

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
RUN echo "Ensuring binary is statically linked ..." \
&& (file /code/build/terpd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.15

FROM alpine:3.16

COPY --from=go-builder /code/build/terpd /usr/bin/terpd

Expand Down
11 changes: 5 additions & 6 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"

"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
icq "github.com/cosmos/ibc-apps/modules/async-icq/v7"
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
Expand Down Expand Up @@ -418,12 +417,12 @@ func NewAppKeepers(
appKeepers.PacketForwardKeeper = packetforwardkeeper.NewKeeper(
appCodec,
appKeepers.keys[packetforwardtypes.StoreKey],
appKeepers.GetSubspace(packetforwardtypes.ModuleName),
appKeepers.TransferKeeper, // Will be zero-value here. Reference is set later on with SetTransferKeeper.
appKeepers.IBCKeeper.ChannelKeeper,
appKeepers.DistrKeeper,
appKeepers.BankKeeper,
appKeepers.IBCKeeper.ChannelKeeper,
appKeepers.HooksICS4Wrapper,
govModAddress,
)

// Create Transfer Keepers
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"
Expand Down
6 changes: 3 additions & 3 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

mint "github.com/cosmos/cosmos-sdk/x/mint"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
icq "github.com/cosmos/ibc-apps/modules/async-icq/v7"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts"
Expand Down Expand Up @@ -163,7 +163,7 @@ func appModules(
ibcfee.NewAppModule(app.AppKeepers.IBCFeeKeeper),
ica.NewAppModule(&app.AppKeepers.ICAControllerKeeper, &app.AppKeepers.ICAHostKeeper),
icq.NewAppModule(app.AppKeepers.ICQKeeper),
packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper),
packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)),
clock.NewAppModule(appCodec, app.AppKeepers.ClockKeeper),
// cwhooks.NewAppModule(appCodec, app.AppKeepers.CWHooksKeeper),
ibchooks.NewAppModule(app.AppKeepers.AccountKeeper),
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v2/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v2

import (
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types"

Expand Down
6 changes: 4 additions & 2 deletions app/upgrades/v2/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"

packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"

"github.com/terpnetwork/terp-core/v4/app/keepers"
"github.com/terpnetwork/terp-core/v4/app/upgrades"
Expand Down Expand Up @@ -85,7 +85,9 @@ func CreateV2UpgradeHandler(
keepers.ICQKeeper.SetParams(ctx, icqParams)

// Packet Forward middleware initial params
keepers.PacketForwardKeeper.SetParams(ctx, packetforwardtypes.DefaultParams())
if err := keepers.PacketForwardKeeper.SetParams(ctx, packetforwardtypes.DefaultParams()); err != nil {
return nil, err
}

// Leave modules are as-is to avoid running InitGenesis.
logger.Debug("running module migrations ...")
Expand Down
16 changes: 8 additions & 8 deletions cmd/terpd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
}

customAppTemplate, customAppConfig := initAppConfig()
customTMConfig := initTendermintConfig()
customTMConfig := tmcfg.DefaultConfig()

return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig)
},
Expand All @@ -106,15 +106,15 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {

// initTendermintConfig helps to override default Tendermint Config values.
// return tmcfg.DefaultConfig if no custom configuration is required for the application.
func initTendermintConfig() *tmcfg.Config {
cfg := tmcfg.DefaultConfig()
// func initTendermintConfig() *tmcfg.Config {
// cfg := tmcfg.DefaultConfig()

// these values put a higher strain on node memory
// cfg.P2P.MaxNumInboundPeers = 100
// cfg.P2P.MaxNumOutboundPeers = 40
// // these values put a higher strain on node memory
// // cfg.P2P.MaxNumInboundPeers = 100
// // cfg.P2P.MaxNumOutboundPeers = 40

return cfg
}
// return
// }

// initAppConfig helps to override default appConfig template and configs.
// return "", nil if no custom configuration is required for the application.
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/terpnetwork/terp-core/v4

go 1.19
go 1.21

require (
github.com/CosmWasm/wasmd v0.45.0
Expand All @@ -12,7 +12,8 @@ require (
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/iavl v0.20.1 // indirect
github.com/cosmos/ibc-go/v7 v7.3.0
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
Expand Down Expand Up @@ -40,7 +41,6 @@ require (
cosmossdk.io/log v1.2.1
cosmossdk.io/math v1.1.2
cosmossdk.io/tools/rosetta v0.2.1
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1-0.20231012160012-d0f49580a238
github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230906222317-d88d4028e5c9
github.com/spf13/viper v1.16.0
Expand Down Expand Up @@ -188,6 +188,8 @@ require (

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 => github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// See: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
Expand Down
Loading
Loading