Skip to content

Commit

Permalink
Merge branch 'main' into fix-chain-id
Browse files Browse the repository at this point in the history
Signed-off-by: yihuang <huang@crypto.com>
  • Loading branch information
yihuang authored Oct 24, 2023
2 parents c6f3fdc + 44d0284 commit 7ff278f
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## UNRELEASED
## [Unreleased]

### Bug Fixes

- [#1215](https://github.com/crypto-org-chain/cronos/pull/1215) Update ethermint to fix of concurrent write in fee history.
- [#1217](https://github.com/crypto-org-chain/cronos/pull/1217) Use the default chain-id behavour in sdk.

*October 17, 2023*
Expand Down
16 changes: 16 additions & 0 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,22 @@
"Params": "TransferParams"
}
}
},
{
"url": "./tmp-swagger-gen/ibc/applications/interchain_accounts/controller/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "InterchainAccountsControllerParams"
}
}
},
{
"url": "./tmp-swagger-gen/ibc/applications/interchain_accounts/host/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "InterchainAccountsHostParams"
}
}
}
]
}
209 changes: 209 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43623,6 +43623,153 @@ paths:
format: byte
tags:
- Query
/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}:
get:
summary: >-
InterchainAccount returns the interchain account address for a given
owner address on a given connection
operationId: InterchainAccount
responses:
'200':
description: A successful response.
schema:
type: object
properties:
address:
type: string
description: >-
QueryInterchainAccountResponse the response type for the
Query/InterchainAccount RPC method.
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: owner
in: path
required: true
type: string
- name: connection_id
in: path
required: true
type: string
tags:
- Query
/ibc/apps/interchain_accounts/controller/v1/params:
get:
summary: Params queries all parameters of the ICA controller submodule.
operationId: InterchainAccountsControllerParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params defines the parameters of the module.
type: object
properties:
controller_enabled:
type: boolean
description: >-
controller_enabled enables or disables the controller
submodule.
description: >-
QueryParamsResponse is the response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
tags:
- Query
/ibc/apps/interchain_accounts/host/v1/params:
get:
summary: Params queries all parameters of the ICA host submodule.
operationId: InterchainAccountsHostParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
description: params defines the parameters of the module.
type: object
properties:
host_enabled:
type: boolean
description: host_enabled enables or disables the host submodule.
allow_messages:
type: array
items:
type: string
description: >-
allow_messages defines a list of sdk message typeURLs
allowed to be executed on a host chain.
description: >-
QueryParamsResponse is the response type for the Query/Params RPC
method.
default:
description: An unexpected error response.
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
tags:
- Query
definitions:
cronos.ContractByDenomResponse:
type: object
Expand Down Expand Up @@ -70915,3 +71062,65 @@ definitions:
description: >-
QueryTotalEscrowForDenomResponse is the response type for
TotalEscrowForDenom RPC method.
ibc.applications.interchain_accounts.controller.v1.Params:
type: object
properties:
controller_enabled:
type: boolean
description: controller_enabled enables or disables the controller submodule.
description: |-
Params defines the set of on-chain interchain accounts parameters.
The following parameters may be used to disable the controller submodule.
ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse:
type: object
properties:
address:
type: string
description: >-
QueryInterchainAccountResponse the response type for the
Query/InterchainAccount RPC method.
ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse:
type: object
properties:
params:
description: params defines the parameters of the module.
type: object
properties:
controller_enabled:
type: boolean
description: controller_enabled enables or disables the controller submodule.
description: QueryParamsResponse is the response type for the Query/Params RPC method.
ibc.applications.interchain_accounts.host.v1.Params:
type: object
properties:
host_enabled:
type: boolean
description: host_enabled enables or disables the host submodule.
allow_messages:
type: array
items:
type: string
description: >-
allow_messages defines a list of sdk message typeURLs allowed to be
executed on a host chain.
description: |-
Params defines the set of on-chain interchain accounts parameters.
The following parameters may be used to disable the host submodule.
ibc.applications.interchain_accounts.host.v1.QueryParamsResponse:
type: object
properties:
params:
description: params defines the parameters of the module.
type: object
properties:
host_enabled:
type: boolean
description: host_enabled enables or disables the host submodule.
allow_messages:
type: array
items:
type: string
description: >-
allow_messages defines a list of sdk message typeURLs allowed to
be executed on a host chain.
description: QueryParamsResponse is the response type for the Query/Params RPC method.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ replace (
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc1
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20231019015135-65c0efeabb62
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 h1:R1
github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63/go.mod h1:rocwIfnS+kA060x64gkSIRvWB9StSppIkJuo5MWzL24=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467 h1:m0/aHPIJAzi2MSP3TXzzbLTFf+koRFQiaYmerRZUtK4=
github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467/go.mod h1:G384omH7cXgm90xXR7xpHvsKG7vdBaDuz4To6GpTHUU=
github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32 h1:A++epzNCr3EY57dnU6UTSDwbCiPD6MjvUKHKSd/PoI8=
github.com/crypto-org-chain/ethermint v0.6.1-0.20230925072753-4062d0cc2a32/go.mod h1:wnJQyK4n0vShhL+YIAUd7XCzUhgZ9fgG6yJ14n7qefo=
github.com/crypto-org-chain/ethermint v0.6.1-0.20231019015135-65c0efeabb62 h1:vkDT9v2ozR3Y0AJsrs+r+bTtgs2Kll0sq3Q/ZwXDDoc=
github.com/crypto-org-chain/ethermint v0.6.1-0.20231019015135-65c0efeabb62/go.mod h1:wnJQyK4n0vShhL+YIAUd7XCzUhgZ9fgG6yJ14n7qefo=
github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e h1:rSTc35OBjjCBx47rHPWBCIHNGPbMnEj8f7fNcK2TjVI=
github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e/go.mod h1:HBaDqlFjlaXJwVQtA7jHejyaA7xwjXI2o6pU/ccP3tE=
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
Expand Down
4 changes: 2 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ schema = 3
hash = "sha256-GgcReGsIIuBE2TabDYqDO9sBGogdVr9RSh4arQzdPnE="
replaced = "github.com/evmos/go-ethereum"
[mod."github.com/evmos/ethermint"]
version = "v0.6.1-0.20230925072753-4062d0cc2a32"
hash = "sha256-8zwdHROHnAVfly2PIaNAfiXfb2fWsTqePaZ58EJtjH4="
version = "v0.6.1-0.20231019015135-65c0efeabb62"
hash = "sha256-0fyozPeRfig2Nalb031GFSpM50jF4qx1qPDDStTubRs="
replaced = "github.com/crypto-org-chain/ethermint"
[mod."github.com/felixge/httpsnoop"]
version = "v1.0.2"
Expand Down
7 changes: 4 additions & 3 deletions memiavl/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const (
DefaultSnapshotInterval = 1000
LockFileName = "LOCK"
DefaultSnapshotWriterLimit = 4
TmpSuffix = "-tmp"
)

var errReadOnly = errors.New("db is read-only")
Expand Down Expand Up @@ -265,7 +266,7 @@ func removeTmpDirs(rootDir string) error {
}

for _, entry := range entries {
if !entry.IsDir() || !strings.HasSuffix(entry.Name(), "-tmp") {
if !entry.IsDir() || !strings.HasSuffix(entry.Name(), TmpSuffix) {
continue
}

Expand Down Expand Up @@ -636,7 +637,7 @@ func (db *DB) RewriteSnapshot() error {
}

snapshotDir := snapshotName(db.lastCommitInfo.Version)
tmpDir := snapshotDir + "-tmp"
tmpDir := snapshotDir + TmpSuffix
path := filepath.Join(db.dir, tmpDir)
if err := db.MultiTree.WriteSnapshot(path, db.snapshotWriterPool); err != nil {
return errors.Join(err, os.RemoveAll(path))
Expand Down Expand Up @@ -978,7 +979,7 @@ func traverseSnapshots(dir string, ascending bool, callback func(int64) (bool, e

// atomicRemoveDir is equavalent to `mv snapshot snapshot-tmp && rm -r snapshot-tmp`
func atomicRemoveDir(path string) error {
tmpPath := path + "-tmp"
tmpPath := path + TmpSuffix
if err := os.Rename(path, tmpPath); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion memiavl/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestRemoveSnapshotDir(t *testing.T) {
defer os.RemoveAll(dbDir)

snapshotDir := filepath.Join(dbDir, snapshotName(0))
tmpDir := snapshotDir + "-tmp"
tmpDir := snapshotDir + TmpSuffix
if err := os.MkdirAll(tmpDir, os.ModePerm); err != nil {
t.Fatalf("Failed to create dummy snapshot directory: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion memiavl/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewMultiTreeImporter(dir string, height uint64) (*MultiTreeImporter, error)
}

func (mti *MultiTreeImporter) tmpDir() string {
return filepath.Join(mti.dir, mti.snapshotDir+"-tmp")
return filepath.Join(mti.dir, mti.snapshotDir+TmpSuffix)
}

func (mti *MultiTreeImporter) Add(item interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion x/cronos/keeper/mock/ibckeeper_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (i IbcKeeperMock) Transfer(goCtx context.Context, msg *types.MsgTransfer) (
}

func (i IbcKeeperMock) GetDenomTrace(ctx sdk.Context, denomTraceHash tmbytes.HexBytes) (types.DenomTrace, bool) {
if denomTraceHash.String() == "6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865" { //nolint:gosec // test only
if denomTraceHash.String() == "6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865" {
return types.DenomTrace{
Path: "transfer/channel-0",
BaseDenom: "basetcro",
Expand Down

0 comments on commit 7ff278f

Please sign in to comment.