Skip to content

Commit

Permalink
bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Nov 8, 2024
1 parent f43ac99 commit 4e74655
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-darwin-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.5"
go-version: "1.22"

- name: Set environment variables
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-darwin-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.5"
go-version: "1.22"
- name: Set environment variables
run: |
MINIMOVE_NETWORK_NAME="minimove-1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.5"
go-version: "1.22"

- name: Set environment variables
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ concurrency:
jobs:
golangci:
env:
GOLANGCI_LINT_VERSION: v1.59.1
GOLANGCI_LINT_VERSION: v1.61.0
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23
check-latest: true
- uses: technote-space/[email protected]
id: git_diff
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23
check-latest: true
- run: |
go mod tidy
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MiniMove is an optimistic rollup consumer chain powered by MoveVM. MiniMove is d

## Prerequisites

- Go v1.22.5+
- Go v1.22.7+

## Getting Started

Expand Down
78 changes: 6 additions & 72 deletions app/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,100 +1,34 @@
package app

import (
"bytes"
"context"
"errors"
"fmt"

"cosmossdk.io/collections"
sdkerrors "cosmossdk.io/errors"
upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/types/module"

movetypes "github.com/initia-labs/initia/x/move/types"
vmprecompile "github.com/initia-labs/movevm/precompile"
vmtypes "github.com/initia-labs/movevm/types"
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
)

const upgradeName = "0.6.0"
const upgradeName = "0.6.2"

// RegisterUpgradeHandlers returns upgrade handlers
func (app *MinitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) {
app.UpgradeKeeper.SetUpgradeHandler(
upgradeName,
func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {

// 1. publish new code module first
codeModuleBz, err := vmprecompile.ReadStdlib("code.mv")
params, err := app.OPChildKeeper.GetParams(ctx)
if err != nil {
return nil, err
}
err = app.MoveKeeper.SetModule(ctx, vmtypes.StdAddress, movetypes.MoveModuleNameCode, codeModuleBz[0])
if err != nil {
return nil, err
}

// 2. update vm data with new seperator and add checksums of each module

// Previous:
// ModuleSeparator = byte(0)
// ResourceSeparator = byte(1)
// TableEntrySeparator = byte(2)
// TableInfoSeparator = byte(3)

// Current:
// ModuleSeparator = byte(0)
// ChecksumSeparator = byte(1)
// ResourceSeparator = byte(2)
// TableEntrySeparator = byte(3)
// TableInfoSeparator = byte(4)

err = app.MoveKeeper.VMStore.Walk(ctx, new(collections.Range[[]byte]).Descending(), func(key, value []byte) (stop bool, err error) {
key = bytes.Clone(key)

cursor := movetypes.AddressBytesLength
if len(key) <= cursor {
return true, fmt.Errorf("invalid key length: %d", len(key))
}

separator := key[cursor]
if separator == movetypes.ModuleSeparator {
checksum := movetypes.ModuleBzToChecksum(value)
value = checksum[:]
} else if separator >= movetypes.TableInfoSeparator {
return true, errors.New("unknown prefix")
} else if err = app.MoveKeeper.VMStore.Remove(ctx, key); err != nil {
return true, err
}

key[cursor] = key[cursor] + 1
err = app.MoveKeeper.VMStore.Set(ctx, key, value)
if err != nil {
return true, err
}
// set non-zero default values for new params
params.HookMaxGas = opchildtypes.DefaultHookMaxGas

return false, nil
})
err = app.OPChildKeeper.SetParams(ctx, params)
if err != nil {
return nil, err
}

// 3. update new modules

codesBz, err := vmprecompile.ReadMinlib("object_code_deployment.mv", "coin.mv", "cosmos.mv", "dex.mv", "json.mv", "bech32.mv", "hash.mv", "collection.mv")
if err != nil {
return nil, err
}
modules := make([]vmtypes.Module, len(codesBz))
for i, codeBz := range codesBz {
modules[i] = vmtypes.NewModule(codeBz)
}

err = app.MoveKeeper.PublishModuleBundle(ctx, vmtypes.StdAddress, vmtypes.NewModuleBundle(modules...), movetypes.UpgradePolicy_COMPATIBLE)
if err != nil {
return nil, sdkerrors.Wrap(err, "failed to publish module bundle")
}

return vm, nil
},
)
Expand Down
48 changes: 25 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/initia-labs/minimove

go 1.22.5
go 1.22.7

toolchain go1.23.0

require (
cosmossdk.io/api v0.7.5
cosmossdk.io/client/v2 v2.0.0-beta.4
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.1
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.4.1
Expand All @@ -26,8 +27,8 @@ require (
github.com/cosmos/ibc-go/v8 v8.5.0
github.com/golang/mock v1.6.0
github.com/gorilla/mux v1.8.1
github.com/initia-labs/OPinit v0.5.5
github.com/initia-labs/initia v0.6.0
github.com/initia-labs/OPinit v0.5.7
github.com/initia-labs/initia v0.6.1
github.com/initia-labs/kvindexer v0.1.9
github.com/initia-labs/kvindexer/submodules/block v0.1.0
github.com/initia-labs/kvindexer/submodules/move-nft v0.1.5
Expand All @@ -54,6 +55,7 @@ require (
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.12 // indirect
cloud.google.com/go/storage v1.41.0 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/depinject v1.0.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -86,7 +88,7 @@ require (
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.12.0 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
Expand All @@ -103,7 +105,7 @@ require (
github.com/creachadair/tomledit v0.0.24 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
Expand All @@ -127,11 +129,11 @@ require (
github.com/gofrs/flock v0.12.1 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // 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/btree v1.1.3 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-github/v43 v43.0.0 // indirect
Expand Down Expand Up @@ -166,7 +168,7 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/initia-labs/OPinit/api v0.5.1 // indirect
github.com/initia-labs/OPinit/api v0.5.7 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/jsternberg/zap-logfmt v1.3.0 // indirect
Expand All @@ -180,7 +182,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/minio/highwayhash v1.0.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -192,11 +194,11 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
Expand All @@ -205,7 +207,7 @@ require (
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
Expand All @@ -231,20 +233,20 @@ require (
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.6.0 // indirect
google.golang.org/api v0.189.0 // indirect
google.golang.org/genproto v0.0.0-20240722135656-d784300faade // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down Expand Up @@ -277,7 +279,7 @@ replace (

// initia custom
replace (
github.com/cometbft/cometbft => github.com/initia-labs/cometbft v0.0.0-20240925132752-ff8ff0126261
github.com/cometbft/cometbft => github.com/initia-labs/cometbft v0.0.0-20241104064728-ef8cadf1bed8
github.com/cosmos/ibc-go/v8 => github.com/initia-labs/ibc-go/v8 v8.0.0-20240802003717-19c0b4ad450d

// use custom version until this PR is merged
Expand Down
Loading

0 comments on commit 4e74655

Please sign in to comment.