Skip to content

Commit

Permalink
Problem: cometbft is not up to date (#1103)
Browse files Browse the repository at this point in the history
* Problem: cometbft is not up to date

* Update CHANGELOG.md

Signed-off-by: yihuang <[email protected]>

* fmt

* fix workflow

* update ibc-rs

* bump deps

fix build

* bump ci go

* fix build

* avoid upgrade rocksdb

* Update CHANGELOG.md

Signed-off-by: yihuang <[email protected]>

* align lint

https://github.com/cosmos/cosmos-sdk/blob/7e391959b9aebf055294b24b7f392346709dae64/.golangci.yml#L12

* deps

* lint

* lint

* fix windows

---------

Signed-off-by: yihuang <[email protected]>
Co-authored-by: mmsqe <[email protected]>
  • Loading branch information
yihuang and mmsqe authored Feb 6, 2025
1 parent c6658f1 commit b8e814c
Show file tree
Hide file tree
Showing 22 changed files with 569 additions and 441 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- uses: actions/checkout@v4
with:
submodules: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v4
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- name: install runsim
run: |
export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
Expand All @@ -204,7 +204,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v4
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -253,7 +253,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v4
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v4
if: github.event_name == 'issue_comment'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildwin.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@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- name: Normal check out code
uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.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@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- uses: actions/checkout@v4
with:
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: '^1.22.0'
- uses: actions/checkout@v4
with:
submodules: true
Expand All @@ -28,7 +28,7 @@ jobs:
- 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.51
version: v1.60
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: steps.changed-files.outputs.any_changed == 'true'
5 changes: 0 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
linters:
enable:
- bodyclose
- depguard
- dogsled
- dupl
- exportloopref
Expand All @@ -13,7 +12,6 @@ linters:
- misspell
- nakedret
- prealloc
- revive
- stylecheck
- unconvert

Expand All @@ -25,9 +23,6 @@ linters-settings:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Changelog

## UNRELEASED
*Feb 6, 2025*

## v4.2.11

### Bug Fixes

- [#1099](https://github.com/crypto-org-chain/chain-main/pull/1099) Avoid negative coin amount error when query supply liquid of non BaseCoinUnit.
- [#1103](https://github.com/crypto-org-chain/chain-main/pull/1103) Update cometbft to v0.34.x.

*Dec 18, 2024*

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ func (app *ChainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) a
case app.haltHeight > 0 && uint64(req.Header.Height) > app.haltHeight:
halt = true

case app.haltTime > 0 && req.Header.Time.Unix() > int64(app.haltTime):
case app.haltTime > 0 && uint64(req.Header.Time.Unix()) > app.haltTime:
halt = true
}

Expand Down
29 changes: 22 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
lib,
stdenv,
buildGoApplication,
writeShellScript,
buildPackages,
coverage ? false, # https://tip.golang.org/doc/go1.20#cover
gomod2nix,
rocksdb ? null,
network ? "mainnet", # mainnet|testnet
rev ? "dirty",
Expand Down Expand Up @@ -35,7 +38,8 @@ let
in
buildGoApplication rec {
pname = "chain-maind";
version = "4.2.10";
version = "4.2.11";
go = buildPackages.go_1_23;
src = lib.cleanSourceWith {
name = "src";
src = lib.sourceByRegex ./. src_regexes;
Expand All @@ -45,13 +49,14 @@ buildGoApplication rec {
buildFlags = lib.optionalString coverage "-cover";
buildInputs = lib.lists.optional (rocksdb != null) rocksdb;
CGO_ENABLED = "1";
CGO_LDFLAGS =
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
"-lrocksdb -pthread -lstdc++ -ldl";
"-lrocksdb -pthread -lstdc++ -ldl"
);
tags =
[
"cgo"
Expand All @@ -73,14 +78,24 @@ buildGoApplication rec {
-X github.com/cosmos/cosmos-sdk/version.Commit=${rev}
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${concatStringsSep "," tags}
'';
postFixup = lib.optionalString stdenv.isDarwin ''
${stdenv.cc.targetPrefix}install_name_tool -change "@rpath/librocksdb.8.dylib" "${rocksdb}/lib/librocksdb.dylib" $out/bin/chain-maind
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/chain-maind
'';
passthru = {
# update script use the same golang version as the project
updateScript =
let
helper = gomod2nix.override { inherit go; };
in
writeShellScript "${pname}-updater" ''
exec ${helper}/bin/gomod2nix
'';
};

doCheck = false;
meta = with lib; {
description = "Official implementation of the Crypto.org blockchain protocol";
homepage = "https://crypto.org/";
description = "Official implementation of the Cronos.org blockchain protocol";
homepage = "https://cronos.org/";
license = licenses.asl20;
mainProgram = "chain-maind" + stdenv.hostPlatform.extensions.executable;
platforms = platforms.all;
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils";
inputs.flake-utils.follows = "flake-utils";
};
};

Expand Down
Loading

0 comments on commit b8e814c

Please sign in to comment.