diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e309e8e155..70a6204a54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ name: Build on: + workflow_dispatch: merge_group: pull_request: push: branches: - - main - release/** concurrency: @@ -44,7 +44,7 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' - uses: actions/upload-artifact@v3 with: - name: "cronosd-tarball-${{ matrix.os }}" + name: "supernovad-tarball-${{ matrix.os }}" path: "*.tar.gz" if-no-files-found: ignore diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2d8fba0125..478f4cb77a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,9 +12,9 @@ name: "CodeQL" on: + workflow_dispatch: push: branches: - - main - release/** paths: - "**.go" diff --git a/.github/workflows/deployment_cleanup.yml b/.github/workflows/deployment_cleanup.yml new file mode 100644 index 0000000000..6795c822f3 --- /dev/null +++ b/.github/workflows/deployment_cleanup.yml @@ -0,0 +1,17 @@ +name: Delete Environment (default settings) + +on: + workflow_dispatch: + delete: + branches-ignore: + - main + +jobs: + delete: + runs-on: ubuntu-latest + steps: + - uses: strumwolf/delete-deployment-environment@v2 + with: + # ⚠️ The provided token needs permission for admin write:org + token: ${{ secrets.supernova }} + environment: release diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml index f2ce269515..33802a426f 100644 --- a/.github/workflows/gosec.yml +++ b/.github/workflows/gosec.yml @@ -1,9 +1,9 @@ name: Run Gosec on: + workflow_dispatch: pull_request: push: branches: - - main - release/** jobs: diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 14d1641c96..84a067447d 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -1,11 +1,11 @@ name: Check Markdown links on: + workflow_dispatch: schedule: - cron: "* */24 * * *" pull_request: push: branches: - - main - release/** jobs: markdown-link-check: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dc8f1e64d6..71b0e032f2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,11 +3,11 @@ name: Run Lint # run on every pull request and push to main The `golangci` will pass without # running if no *.{go, mod, sum} files have been changed. on: + workflow_dispatch: merge_group: pull_request: push: branches: - - main - release/** concurrency: diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 52e96b1b9e..e5cb994cfa 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -2,6 +2,7 @@ name: Protobuf # Protobuf runs buf (https://buf.build/) lint and check-breakage # This workflow is only run when a .proto file has been changed on: + workflow_dispatch: pull_request: concurrency: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 017b829b74..2fd8d8f4a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: release on: + workflow_dispatch: push: tags: - "v*.*.*" @@ -19,10 +20,10 @@ jobs: nix_path: nixpkgs=channel:nixos-22.11 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - uses: cachix/cachix-action@v12 - with: - name: cronos - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" + # - uses: cachix/cachix-action@v12 + # with: + # name: cronos + # signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - name: build binaries run: | @@ -60,20 +61,20 @@ jobs: nix_path: nixpkgs=channel:nixos-22.11 extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - uses: apple-actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.MAC_CODE_SIGN_CERT }} - p12-password: ${{ secrets.MAC_CODE_SIGN_CERT_PASS }} - - uses: cachix/cachix-action@v12 - with: - name: cronos - signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" + # - uses: apple-actions/import-codesign-certs@v1 + # with: + # p12-file-base64: ${{ secrets.MAC_CODE_SIGN_CERT }} + # p12-password: ${{ secrets.MAC_CODE_SIGN_CERT_PASS }} + # - uses: cachix/cachix-action@v12 + # with: + # name: cronos + # signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - name: build binaries - env: - MAC_CODE_API_KEY: ${{ secrets.MAC_CODE_API_KEY }} - MAC_CODE_API_KEY_ID: ${{ secrets.MAC_CODE_API_KEY_ID }} - MAC_CODE_API_ISSUER_ID: ${{ secrets.MAC_CODE_API_ISSUER_ID }} - MAC_CODE_API_DEVELOPER_ID: ${{ secrets.MAC_CODE_API_DEVELOPER_ID }} + # env: + # MAC_CODE_API_KEY: ${{ secrets.MAC_CODE_API_KEY }} + # MAC_CODE_API_KEY_ID: ${{ secrets.MAC_CODE_API_KEY_ID }} + # MAC_CODE_API_ISSUER_ID: ${{ secrets.MAC_CODE_API_ISSUER_ID }} + # MAC_CODE_API_DEVELOPER_ID: ${{ secrets.MAC_CODE_API_DEVELOPER_ID }} run: | # install sha256sum nix-env -i coreutils -f '' @@ -82,11 +83,11 @@ jobs: ./scripts/release.sh # codesign - for tarball in *.tar.gz; - do - ./scripts/codesign_macos.sh $tarball - mv signed.tar.gz $tarball - done + # for tarball in *.tar.gz; + # do + # ./scripts/codesign_macos.sh $tarball + # mv signed.tar.gz $tarball + # done # update checksum and upload CHKFILE="checksums-darwin-$(uname -p).txt" diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index c206c10220..e7bc433217 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -1,10 +1,10 @@ name: Semgrep on: + workflow_dispatch: # Scan changed files in PRs, block on new issues only (existing issues ignored) pull_request: {} push: branches: - - main - release/** paths: - .github/workflows/semgrep.yml diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 67c07dfbc8..89e1160a86 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -2,16 +2,16 @@ name: Sims # Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) # This workflow will run on main and release branches, if a .go, .mod or .sum file have been changed on: + workflow_dispatch: push: paths-ignore: - 'docs/**' branches: - - main - release/** tags: - "*" pull_request: - types: auto_merge_enabled + types: [auto_merge_enabled] issue_comment: types: [created, edited] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34ab2aed83..8e582f13c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,10 @@ name: integration tests on: + workflow_dispatch: merge_group: pull_request: push: branches: - - main - release/** tags: - "*" diff --git a/.github/workflows/workflow_cleanup.yml b/.github/workflows/workflow_cleanup.yml new file mode 100644 index 0000000000..e6c10ad4e3 --- /dev/null +++ b/.github/workflows/workflow_cleanup.yml @@ -0,0 +1,66 @@ +name: Delete old workflow runs +on: + workflow_dispatch: + inputs: + days: + description: 'Days-worth of runs to keep for each workflow' + required: true + default: '7' + minimum_runs: + description: 'Minimum runs to keep for each workflow' + required: true + default: '3' + delete_workflow_pattern: + description: 'Name or filename of the workflow (if not set, all workflows are targeted)' + required: false + delete_workflow_by_state_pattern: + description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' + required: true + default: "ALL" + type: choice + options: + - "ALL" + - active + - deleted + - disabled_inactivity + - disabled_manually + delete_run_by_conclusion_pattern: + description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success' + required: true + default: "ALL" + type: choice + options: + - "ALL" + - "Unsuccessful: action_required,cancelled,failure,skipped" + - action_required + - cancelled + - failure + - skipped + - success + dry_run: + description: 'Logs simulated changes, no deletions are performed' + required: false + +jobs: + del_runs: + runs-on: ubuntu-latest + permissions: + actions: write + contents: read + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: ${{ github.event.inputs.days }} + keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} + delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} + delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} + delete_run_by_conclusion_pattern: >- + ${{ + startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:') + && 'action_required,cancelled,failure,skipped' + || github.event.inputs.delete_run_by_conclusion_pattern + }} + dry_run: ${{ github.event.inputs.dry_run }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6cfbc258..227d8bdfc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -163,6 +163,12 @@ ### Bug Fixes * (rpc) [#1397](https://github.com/crypto-org-chain/cronos/pull/1397) Avoid panic on invalid elasticity_multiplier. +* (rpc) [#1466](https://github.com/crypto-org-chain/cronos/pull/1466) Fix handling of pending transactions related APIs. + +### Features + +* [#1406](https://github.com/crypto-org-chain/cronos/pull/1406) Add set-encryption-key for encryption module. +* [#1411](https://github.com/crypto-org-chain/cronos/pull/1411) Add encrypt and decrypt cmds for message. ### Features diff --git a/Makefile b/Makefile index 33cbf460b5..e6e8f332fb 100644 --- a/Makefile +++ b/Makefile @@ -79,8 +79,8 @@ comma := , build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) # process linker flags -ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=cronos \ - -X github.com/cosmos/cosmos-sdk/version.AppName=cronosd \ +ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=supernova \ + -X github.com/cosmos/cosmos-sdk/version.AppName=supernovad \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep) @@ -93,7 +93,7 @@ endif all: build build: check-network print-ledger go.sum - @go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/cronosd ./cmd/cronosd + @go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/supernovad ./cmd/cronosd install: check-network print-ledger go.sum @go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd diff --git a/README.md b/README.md index a71eb12630..1159da6f58 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ parent:
-

Cronos Logo

+

Zenon


@@ -39,7 +39,7 @@ parent: ## 1. Description -**Cronos** is the Crypto.org EVM chain that aims to massively scale the DeFi ecosystem. +**Supernova** is the first Zenon EVM based extension-chain. @@ -163,11 +163,6 @@ pystarport supervisorctl stop all ## 10. Useful links -- [Project Website](http://cronos.org/) -- [Technical Documentation](http://cronos.org/docs) -- Community chatrooms (non-technical): [Discord](https://discord.gg/nsp9JTC) [Telegram](https://t.me/CryptoComOfficial) -- Developer community channel (technical): [![Support Server](https://img.shields.io/discord/783264383978569728.svg?color=7289da&label=Cronos&logo=discord&style=flat-square)](https://discord.gg/pahqHz26q4) - [Ethermint](https://github.com/evmos/ethermint) by Tharsis - [Cosmos SDK documentation](https://docs.cosmos.network) - [Cosmos Discord](https://discord.gg/W8trcGV) -- [Pystarport](https://github.com/crypto-com/pystarport/blob/main/README.md) diff --git a/app/app.go b/app/app.go index 04188c7703..42ae81b3a8 100644 --- a/app/app.go +++ b/app/app.go @@ -178,8 +178,9 @@ import ( _ "github.com/ethereum/go-ethereum/eth/tracers/native" ) +// EXTENSION-CHAIN const ( - Name = "cronos" + Name = "supernova" // AddrLen is the allowed length (in bytes) for an address. // @@ -762,6 +763,7 @@ func New( // Create static IBC router, add transfer route, then set and seal it ibcRouter := porttypes.NewRouter() // Add controller & ica auth modules to IBC router + // Add controller & ica auth modules to IBC router ibcRouter. AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). AddRoute(icahosttypes.SubModuleName, icaHostStack). diff --git a/assets/cronos.svg b/assets/cronos.svg deleted file mode 100644 index 76cf3aab70..0000000000 --- a/assets/cronos.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/cmd/cronosd/cmd/root.go b/cmd/cronosd/cmd/root.go index 77cab2795f..d7af2a1abc 100644 --- a/cmd/cronosd/cmd/root.go +++ b/cmd/cronosd/cmd/root.go @@ -84,9 +84,10 @@ func NewRootCmd() *cobra.Command { panic(err) } + // EXTENSION-CHAIN rootCmd := &cobra.Command{ Use: app.Name + "d", - Short: "Cronos Daemon", + Short: "Supernova Daemon", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) diff --git a/cmd/cronosd/config/prefix_mainnet.go b/cmd/cronosd/config/prefix_mainnet.go index 97b97d0411..ca2b16cd38 100644 --- a/cmd/cronosd/config/prefix_mainnet.go +++ b/cmd/cronosd/config/prefix_mainnet.go @@ -6,8 +6,9 @@ package config import sdk "github.com/cosmos/cosmos-sdk/types" const ( + // EXTENSION-CHAIN // Bech32Prefix defines the Bech32 prefix used for Cronos Accounts - Bech32Prefix = "crc" + Bech32Prefix = "x" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = Bech32Prefix diff --git a/cmd/cronosd/config/prefix_testnet.go b/cmd/cronosd/config/prefix_testnet.go index 8628e4c0db..687dbd9d8d 100644 --- a/cmd/cronosd/config/prefix_testnet.go +++ b/cmd/cronosd/config/prefix_testnet.go @@ -6,8 +6,9 @@ package config import sdk "github.com/cosmos/cosmos-sdk/types" const ( + // EXTENSION-CHAIN // Bech32Prefix defines the Bech32 prefix used for Cronos Accounts - Bech32Prefix = "tcrc" + Bech32Prefix = "tx" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = Bech32Prefix diff --git a/default.nix b/default.nix index e6e031cfa8..e60fd364e1 100644 --- a/default.nix +++ b/default.nix @@ -11,17 +11,20 @@ , nativeByteOrder ? true # nativeByteOrder mode will panic on big endian machines }: let - version = "v1.4.0"; - pname = "cronosd"; + version = "v0.0.2"; + pname = "supernovad"; tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" "pebbledb" "objstore" ] ++ lib.optionals nativeByteOrder [ "nativebyteorder" ]; ldflags = lib.concatStringsSep "\n" ([ - "-X github.com/cosmos/cosmos-sdk/version.Name=cronos" + "-X github.com/cosmos/cosmos-sdk/version.Name=supernova" "-X github.com/cosmos/cosmos-sdk/version.AppName=${pname}" "-X github.com/cosmos/cosmos-sdk/version.Version=${version}" "-X github.com/cosmos/cosmos-sdk/version.BuildTags=${lib.concatStringsSep "," tags}" "-X github.com/cosmos/cosmos-sdk/version.Commit=${rev}" ]); buildInputs = [ rocksdb ]; + isWindows = stdenv.hostPlatform.isWindows; + isLinux = stdenv.hostPlatform.isLinux; + isDarwin = stdenv.isDarwin; in buildGoApplication rec { inherit pname version buildInputs tags ldflags; @@ -45,20 +48,38 @@ buildGoApplication rec { CGO_ENABLED = "1"; CGO_LDFLAGS = lib.optionalString (rocksdb != null) ( if static then "-lrocksdb -pthread -lstdc++ -ldl -lzstd -lsnappy -llz4 -lbz2 -lz" - else if stdenv.hostPlatform.isWindows then "-lrocksdb-shared" + else if isWindows then "-lrocksdb-shared" else "-lrocksdb -pthread -lstdc++ -ldl" ); + + postFixup = '' + # Rename the binary to supernovad if on Darwin + ${lib.optionalString (isDarwin) '' + mv $out/bin/cronosd $out/bin/supernovad + ''} + + # Adjust the install_name_tool command if on Darwin + ${lib.optionalString (isDarwin && rocksdb != null) '' + ${stdenv.cc.bintools.targetPrefix}install_name_tool -change "@rpath/librocksdb.9.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/supernovad + ''} - postFixup = lib.optionalString (stdenv.isDarwin && rocksdb != null) '' - ${stdenv.cc.bintools.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/cronosd + # Rename the binary to supernovad if on Windows + ${lib.optionalString (isWindows) '' + mv $out/bin/cronosd.exe $out/bin/supernovad.exe + ''} + + # Rename the binary to supernovad if on Linux + ${lib.optionalString (isLinux) '' + mv $out/bin/cronosd $out/bin/supernovad + ''} ''; - + doCheck = false; meta = with lib; { - description = "Official implementation of the Cronos blockchain protocol"; + description = "Supernova EVM extension-chain"; homepage = "https://cronos.org/"; license = licenses.asl20; - mainProgram = "cronosd" + stdenv.hostPlatform.extensions.executable; + mainProgram = "supernovad" + stdenv.hostPlatform.extensions.executable; platforms = platforms.all; }; } diff --git a/flake.nix b/flake.nix index d005959740..7795992d42 100644 --- a/flake.nix +++ b/flake.nix @@ -40,15 +40,14 @@ inherit (pkgs) rocksdb testground-image; }; apps = { - cronosd = mkApp packages.cronosd; - cronosd-testnet = mkApp packages.cronosd-testnet; + supernovad = mkApp packages.supernovad; stateless-testcase = { type = "app"; program = "${pkgs.benchmark-testcase}/bin/stateless-testcase"; }; }; - defaultPackage = packages.cronosd; - defaultApp = apps.cronosd; + defaultPackage = packages.supernovad; + defaultApp = apps.supernovad; devShells = rec { default = pkgs.mkShell { buildInputs = [ @@ -76,7 +75,6 @@ (import ./nix/build_overlay.nix) poetry2nix.overlays.default gomod2nix.overlays.default - (import ./testground/benchmark/overlay.nix) (final: super: { go = super.go_1_22; test-env = final.callPackage ./nix/testenv.nix { }; @@ -84,7 +82,6 @@ inherit rev; bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { }; }; - testground-image = final.callPackage ./nix/testground-image.nix { }; }) ]; }; diff --git a/integration_tests/test_ibc_rly.py b/integration_tests/test_ibc_rly.py index f40263a271..f0f7494534 100644 --- a/integration_tests/test_ibc_rly.py +++ b/integration_tests/test_ibc_rly.py @@ -14,6 +14,7 @@ ibc_multi_transfer, ibc_transfer, prepare_network, + rly_transfer, ) from .utils import ( ADDRS, diff --git a/nix/bundle-win-exe.nix b/nix/bundle-win-exe.nix index 44bcf323d7..ae7e5752ef 100644 --- a/nix/bundle-win-exe.nix +++ b/nix/bundle-win-exe.nix @@ -7,11 +7,11 @@ , snappy , zstd , zlib -, cronosd +, supernovad }: -runCommand "tarball-${cronosd.name}" +runCommand "tarball-${supernovad.name}" { - # manually enumerate the runtime dependencies of cronosd on mingwW64 + # manually enumerate the runtime dependencies of supernovad on mingwW64 deps = [ "${rocksdb}/bin/librocksdb-shared.dll" "${snappy}/bin/libsnappy.dll" @@ -31,5 +31,5 @@ runCommand "tarball-${cronosd.name}" cp $so $out/ done - cp ${cronosd}/bin/${cronosd.meta.mainProgram} $out/ + cp ${supernovad}/bin/${supernovad.meta.mainProgram} $out/ '' diff --git a/nix/cronos-matrix.nix b/nix/cronos-matrix.nix index e6016121bb..dd467d81b2 100644 --- a/nix/cronos-matrix.nix +++ b/nix/cronos-matrix.nix @@ -17,9 +17,9 @@ let --owner=0 --group=0 --mode=u+rw,uga+r --hard-dereference . \ | gzip -9 > $out ''; - bundle-win-exe = drv: callPackage ./bundle-win-exe.nix { cronosd = drv; }; + bundle-win-exe = drv: callPackage ./bundle-win-exe.nix { supernovad = drv; }; matrix = lib.cartesianProductOfSets { - network = [ "mainnet" "testnet" ]; + network = [ "mainnet" ]; pkgtype = [ "nix" # normal nix package "bundle" # relocatable bundled package @@ -30,27 +30,27 @@ in builtins.listToAttrs (builtins.map ({ network, pkgtype }: { name = builtins.concatStringsSep "-" ( - [ "cronosd" ] ++ + [ "supernovad" ] ++ lib.optional (network != "mainnet") network ++ lib.optional (pkgtype != "nix") pkgtype ); value = let - cronosd = callPackage ../. { + supernovad = callPackage ../. { inherit rev network; }; bundle = if stdenv.hostPlatform.isWindows then - bundle-win-exe cronosd + bundle-win-exe supernovad else - bundle-exe cronosd; + bundle-exe supernovad; in if pkgtype == "bundle" then bundle else if pkgtype == "tarball" then make-tarball bundle else - cronosd; + supernovad; }) matrix ) diff --git a/scripts/release.sh b/scripts/release.sh index 3be3b5a07c..541691e18a 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -11,7 +11,7 @@ build() { network=$1 host="$2" name="$3" - pkg="cronosd${network}-${build_type}" + pkg="supernovad${network}-${build_type}" if [[ "$host" == "native" ]]; then if [[ "${build_platform: -6}" == "-linux" ]]; then # static link for linux targets @@ -29,7 +29,7 @@ build() { fi echo "building $FLAKE" nix build --no-update-lock-file --no-allow-dirty -L "$FLAKE" - cp result "cronos_${ref_name_clean:1}${network}_${name}.tar.gz" + cp result "supernova_${name}.tar.gz" } if [[ "$build_platform" == "x86_64-linux" ]]; then @@ -47,9 +47,8 @@ else exit 1 fi -for network in "" "-testnet"; do - for t in $hosts; do - IFS=',' read name host <<< "${t}" - build "$network" "$host" "$name" - done +network="" # main network +for t in $hosts; do + IFS=',' read name host <<< "${t}" + build "$network" "$host" "$name" done diff --git a/x/cronos/client/cli/tx.go b/x/cronos/client/cli/tx.go index 7ccfc82b4e..b9f1034aeb 100644 --- a/x/cronos/client/cli/tx.go +++ b/x/cronos/client/cli/tx.go @@ -44,7 +44,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdConvertTokens()) cmd.AddCommand(CmdSendToCryptoOrg()) cmd.AddCommand(CmdUpdateTokenMapping()) - cmd.AddCommand(CmdTurnBridge()) + // cmd.AddCommand(CmdTurnBridge()) cmd.AddCommand(CmdUpdatePermissions()) cmd.AddCommand(CmdStoreBlockList()) cmd.AddCommand(MigrateGenesisCmd()) diff --git a/x/cronos/keeper/msg_server.go b/x/cronos/keeper/msg_server.go index 070c9fd651..4f137becad 100644 --- a/x/cronos/keeper/msg_server.go +++ b/x/cronos/keeper/msg_server.go @@ -82,6 +82,22 @@ func (k msgServer) UpdateTokenMapping(goCtx context.Context, msg *types.MsgUpdat // TurnBridge implements the grpc method func (k msgServer) TurnBridge(goCtx context.Context, msg *types.MsgTurnBridge) (*types.MsgTurnBridgeResponse, error) { return nil, nil + + // EXTENSION-CHAIN + // Disable TurnBridge + return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "msg sender is not authorized") + // ctx := sdk.UnwrapSDKContext(goCtx) + + // check permission + // if !k.Keeper.HasPermission(ctx, msg.GetSigners(), CanTurnBridge) { + // return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "msg sender is not authorized") + // } + + // gravityParams := k.gravityKeeper.GetParams(ctx) + // gravityParams.BridgeActive = msg.Enable + // k.gravityKeeper.SetParams(ctx, gravityParams) + + // return &types.MsgTurnBridgeResponse{}, nil } func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { diff --git a/x/cronos/simulation/genesis.go b/x/cronos/simulation/genesis.go index d11f5f355f..44a0761fc9 100644 --- a/x/cronos/simulation/genesis.go +++ b/x/cronos/simulation/genesis.go @@ -12,6 +12,7 @@ import ( "github.com/crypto-org-chain/cronos/v2/x/cronos/types" ) +// EXTENSION-CHAIN const ( ibcCroDenomKey = "ibc_cro_denom" ibcTimeoutKey = "ibc_timeout" diff --git a/x/cronos/types/params.go b/x/cronos/types/params.go index dea732b8af..261de9c8e9 100644 --- a/x/cronos/types/params.go +++ b/x/cronos/types/params.go @@ -22,8 +22,12 @@ var ( KeyMaxCallbackGas = []byte("MaxCallbackGas") ) +// EXTENSION-CHAIN const ( - IbcCroDenomDefaultValue = "ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865" + // hash() representing a SHA256 hashing function returning a string + // ibc_denom := 'ibc/' + hash('path' + 'base_denom') + // sha256(transfer/channel-0/xznn) = 7C17F42EA0A975EA77611A8084EA11B1DF651E67C16C4AE6F99340566B04FDD1 + IbcCroDenomDefaultValue = "ibc/7C17F42EA0A975EA77611A8084EA11B1DF651E67C16C4AE6F99340566B04FDD1" IbcTimeoutDefaultValue = uint64(86400000000000) // 1 day MaxCallbackGasDefaultValue = uint64(50000) ) @@ -45,6 +49,7 @@ func NewParams(ibcCroDenom string, ibcTimeout uint64, cronosAdmin string, enable } // DefaultParams is the default parameter configuration for the cronos module +// EXTENSION-CHAIN func DefaultParams() Params { return Params{ IbcCroDenom: IbcCroDenomDefaultValue, diff --git a/x/cronos/types/types.go b/x/cronos/types/types.go index b231beb995..ec174fdfa3 100644 --- a/x/cronos/types/types.go +++ b/x/cronos/types/types.go @@ -13,13 +13,15 @@ var ( TenPowTen = Ten.Exp(Ten, Ten, nil) ) +// EXTENSION-CHAIN const ( ibcDenomPrefix = "ibc/" ibcDenomLen = len(ibcDenomPrefix) + 64 gravityDenomPrefix = "gravity0x" gravityDenomLen = len(gravityDenomPrefix) + 40 - cronosDenomPrefix = "cronos0x" - cronosDenomLen = len(cronosDenomPrefix) + 40 + cronosDenomPrefix = "x0x" + // cronosDenomPrefix = "cronos0x" + cronosDenomLen = len(cronosDenomPrefix) + 40 ) // IsValidIBCDenom returns true if denom is a valid ibc denom @@ -53,7 +55,10 @@ func GetContractAddressFromDenom(denom string) (string, error) { if strings.HasPrefix(denom, gravityDenomPrefix) { contractAddress = denom[7:] } else if strings.HasPrefix(denom, cronosDenomPrefix) { - contractAddress = denom[6:] + + // EXTENSION-CHAIN + contractAddress = denom[1:] + // contractAddress = denom[6:] } if !common.IsHexAddress(contractAddress) { return "", fmt.Errorf("invalid contract address (%s)", contractAddress)