Skip to content

Commit

Permalink
Problem: dependencies are not up to date (#1091)
Browse files Browse the repository at this point in the history
* Problem: sdk is not up to date

* update cometbft

* Revert "update cometbft"

This reverts commit 414cf7d.

* Revert "Revert "update cometbft""

This reverts commit c58109c.

* bump cronos

* fix lint

* fix build

* lint

* lint nix

* changelog

* lint

---------

Co-authored-by: HuangYi <[email protected]>
  • Loading branch information
mmsqe and yihuang authored Oct 31, 2024
1 parent c23a527 commit 4576955
Show file tree
Hide file tree
Showing 12 changed files with 383 additions and 307 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,35 @@ concurrency:
jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 6
runs-on: macos-latest
timeout-minutes: 120
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.22
- uses: actions/checkout@v4
go-version: '1.22.7'
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
with:
submodules: true
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.55
args: --timeout 10m
github-token: ${{ secrets.github_token }}
*.mod
*.sum
- name: golangci-lint
run: |
nix profile install -f ./nix golangci-lint
nix profile install -f ./nix rocksdb
export PKG_CONFIG_PATH=$HOME/.nix-profile/lib/pkgconfig
export CGO_CFLAGS="$(pkg-config --cflags rocksdb)" CGO_LDFLAGS="$(pkg-config --libs rocksdb)"
golangci-lint version
BUILD_TAGS=rocksdb,grocksdb_clean_link
go build -tags $BUILD_TAGS ./cmd/chain-maind
golangci-lint run --out-format=github-actions --path-prefix=./ --timeout 30m --build-tags $BUILD_TAGS
# Check only if there are differences in the source code
if: steps.changed-files.outputs.any_changed == 'true'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [#1086](https://github.com/crypto-org-chain/chain-main/pull/1086) Upgrade ibc-go to `v8.4.0`.
- [#1087](https://github.com/crypto-org-chain/chain-main/pull/1087) Ensure expedited related gov params pass the basic validation.
- [#1088](https://github.com/crypto-org-chain/chain-main/pull/1088) Upgrade solomachine to `v0.1.4` and ibc-go to `v8.5.1`.
* [#1091](https://github.com/crypto-org-chain/chain-main/pull/1091) Update cometbft to `0.38.13`, sdk to `v0.50.10` and memiavl to latest.
- [#1091](https://github.com/crypto-org-chain/chain-main/pull/1091) Upgrade cometbft to v0.38.13, cosmos-sdk to `v0.50.10`.

*Dec 6, 2023*

Expand Down
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ func New(
interfaceRegistry := encodingConfig.InterfaceRegistry

homePath := cast.ToString(appOpts.Get(flags.FlagHome))
baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, baseAppOptions)
cacheSize := cast.ToInt(appOpts.Get(memiavlstore.FlagCacheSize))
baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, baseAppOptions)
// NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx
// Setup Mempool and Proposal Handlers
baseAppOptions = append(baseAppOptions, func(app *baseapp.BaseApp) {
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ in
buildGoApplication rec {
pname = "chain-maind";
version = "v5.0.0";
go = buildPackages.go_1_22;
go = buildPackages.go_1_23;
src = lib.cleanSourceWith {
name = "src";
src = lib.sourceByRegex ./. src_regexes;
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

202 changes: 112 additions & 90 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
flake-utils.url = "github:numtide/flake-utils";
nix-bundle-exe = {
url = "github:3noch/nix-bundle-exe";
Expand All @@ -13,106 +13,128 @@
};
};

outputs = { self, nixpkgs, nix-bundle-exe, gomod2nix, flake-utils }:
outputs =
{ self
, nixpkgs
, nix-bundle-exe
, gomod2nix
, flake-utils
,
}:
let
rev = self.shortRev or "dirty";
mkApp = drv: {
type = "app";
program = "${drv}/bin/${drv.meta.mainProgram}";
};
in
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(import ./nix/build_overlay.nix)
gomod2nix.overlays.default
self.overlay
];
config = { };
};
in
rec {
packages = pkgs.chain-main-matrix;
apps = {
chain-maind = mkApp packages.chain-maind;
chain-maind-testnet = mkApp packages.chain-maind-testnet;
update-gomod2nix = {
type = "app";
program = "${packages.chain-maind.updateScript}";
};
};
defaultPackage = packages.chain-maind;
defaultApp = apps.chain-maind;
devShells = {
chain-maind = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_22
rocksdb
];
};
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(import ./nix/build_overlay.nix)
gomod2nix.overlays.default
self.overlay
];
config = { };
};
in
rec {
packages = pkgs.chain-main-matrix;
apps = {
chain-maind = mkApp packages.chain-maind;
chain-maind-testnet = mkApp packages.chain-maind-testnet;
update-gomod2nix = {
type = "app";
program = "${packages.chain-maind.updateScript}";
};
devShell = devShells.chain-maind;
legacyPackages = pkgs;
}
)
) // {
overlay = final: prev: {
bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { };
# make-tarball don't follow symbolic links to avoid duplicate file, the bundle should have no external references.
# reset the ownership and permissions to make the extract result more normal.
make-tarball = drv: final.runCommand "tarball-${drv.name}"
{
nativeBuildInputs = with final.buildPackages; [ gnutar gzip ];
} ''
tar cfv - -C "${drv}" \
--owner=0 --group=0 --mode=u+rw,uga+r --hard-dereference . \
| gzip -9 > $out
'';
bundle-win-exe = drv: final.callPackage ./nix/bundle-win-exe.nix { chain-maind = drv; };
} // (with final;
let
matrix = lib.cartesianProductOfSets {
network = [ "mainnet" "testnet" ];
pkgtype = [
"nix" # normal nix package
"bundle" # relocatable bundled package
"tarball" # tarball of the bundle, for distribution and checksum
};
defaultPackage = packages.chain-maind;
defaultApp = apps.chain-maind;
devShells = {
chain-maind = pkgs.mkShell {
buildInputs = [
defaultPackage.go
pkgs.gomod2nix
pkgs.rocksdb
];
};
binaries = builtins.listToAttrs (builtins.map
({ network, pkgtype }: {
name = builtins.concatStringsSep "-" (
[ "chain-maind" ] ++
lib.optional (network != "mainnet") network ++
lib.optional (pkgtype != "nix") pkgtype
);
value =
let
chain-maind = callPackage ./. {
inherit rev network;
};
bundle =
if stdenv.hostPlatform.isWindows then
bundle-win-exe chain-maind
else
bundle-exe chain-maind;
in
if pkgtype == "bundle" then
bundle
else if pkgtype == "tarball" then
make-tarball bundle
else
chain-maind;
})
matrix
);
in
};
devShell = devShells.chain-maind;
legacyPackages = pkgs;
}
))
// {
overlay =
final: prev:
{
chain-main-matrix = binaries;
bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { };
# make-tarball don't follow symbolic links to avoid duplicate file, the bundle should have no external references.
# reset the ownership and permissions to make the extract result more normal.
make-tarball =
drv:
final.runCommand "tarball-${drv.name}"
{
nativeBuildInputs = with final.buildPackages; [
gnutar
gzip
];
}
''
tar cfv - -C "${drv}" \
--owner=0 --group=0 --mode=u+rw,uga+r --hard-dereference . \
| gzip -9 > $out
'';
bundle-win-exe = drv: final.callPackage ./nix/bundle-win-exe.nix { chain-maind = drv; };
}
);
// (
with final;
let
matrix = lib.cartesianProductOfSets {
network = [
"mainnet"
"testnet"
];
pkgtype = [
"nix" # normal nix package
"bundle" # relocatable bundled package
"tarball" # tarball of the bundle, for distribution and checksum
];
};
binaries = builtins.listToAttrs (
builtins.map
(
{ network, pkgtype }:
{
name = builtins.concatStringsSep "-" (
[ "chain-maind" ]
++ lib.optional (network != "mainnet") network
++ lib.optional (pkgtype != "nix") pkgtype
);
value =
let
chain-maind = callPackage ./. {
inherit rev network;
};
bundle =
if stdenv.hostPlatform.isWindows then bundle-win-exe chain-maind else bundle-exe chain-maind;
in
if pkgtype == "bundle" then
bundle
else if pkgtype == "tarball" then
make-tarball bundle
else
chain-maind;
}
)
matrix
);
in
{
chain-main-matrix = binaries;
}
);
};
}
Loading

0 comments on commit 4576955

Please sign in to comment.