Commit Graph

1628 Commits

Author SHA1 Message Date
sesheffield
3c4d91a443
chore(linter): enable gosec on golangci linter and reformat config file (#1983)
add in gosec to the golangci.yml config file and reorder the linters-settings to be in alphabetical order
2024-08-07 12:24:27 -04:00
Nick DeLuca
774e2efce8
chore(lint): Update local make lint to match CI (#1991)
* chore(lint): Update local make lint to match CI

This updates the `make lint` behavior to match the command being
run in CI.

In addition, we refactor the make lint command to use docker in order to
to ease cross platform install, use a local build cache that integrates
with make clean, use the same version file, and encapsulate the logic in
its own make include.

We also remove the old lint logic as to not introduce a duplicate target
and avoid confusion from a difference in behavior.

While solutions like act for running github actions locally work, it is
not as straightfoward, is slower, and uses the local git repository
instead of a clone (though I am not sure how the checkout step works
within act).

* fix(lint): Use shared timeout with .golangci.yml

Instead of using a local and different timeout in the lint makefile
target we can rely on golangci to load this configuration from
.golangci.yml instead and share this setting with CI.

* fix(lint): Fix golangci-lint cache mount path

This uses the correct cache dir default of ~/.cache enabling use
of cache between lint calls.

* fix(lint): Fix lint caching

This includes a couple fixes - 1) It adds support for full caching of go
mod and go build, speeding up the lint process quite a bit.  And 2) does
not mix lint cache with make clean files -- the docker container creates
root owned files that cause make clean to error and we choose not to
require make clean to run with higher permissions.  The cache must be
deleted manually.
2024-08-05 10:13:17 -07:00
Nick DeLuca
272f82ec99
chore(lint): Enable localmodule for import linter (#1989)
We use three sections through-out the codebase -- standard, default, and
localmodule.  This change updates the linter to enforce this pattern as
files are added or modified.
2024-08-02 12:08:38 -07:00
Nick DeLuca
e198eeb3b4
fix(e2e): Use docker compose V2 for kvtool and Makefile (#1990)
* chore(Makefile): Migrate to docker compose v2

Use V2 `docker compose` instead of V1 `docker-compose`

* chore(kvtool): Update to latest master commit
2024-08-02 10:45:57 -07:00
drklee3
bbfaa54ddf
chore(deps): Bump cometbft to v0.37.9-kava.1 (#1988)
This resolves ASA-2024-008. Patched in 0.37.7 but that version has a breaking change which was reverted in 0.37.8.

The replace for golang.org/x/exp prevents breaking change in slices package causing compile error with gogoproto
2024-08-02 09:27:28 -07:00
dependabot[bot]
4e66a56208
chore(deps-dev): bump undici from 5.22.1 to 5.28.4 in /contracts (#1925)
Bumps [undici](https://github.com/nodejs/undici) from 5.22.1 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.22.1...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 17:24:20 -07:00
dependabot[bot]
9c629ad113
chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /contracts (#1941)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 17:17:25 -07:00
sesheffield
b0d737d354
chore(linter): update Golang linter configuration (#1977)
* update golinter + add go sec

* add golangci.yml
Co-authored-by: @faddat jacobgadikian@gmail.com

* update

* update

* fix release version

* remove sec, update from pr comments, cleanup golangci.yml to not break on master

* remove @faddat, not valid codeowner

* remove unnecessary make command

* remove incorrectly named golangci.yml file

* add --new-from-rev

* use master instead of main

* remove extra echo

* set the exports properly

* add setup go to work with act

* add some docs to golangci linter

* test new-from-rev

* enable more linters, but app.go back

* verify issues-exit-code being gone

* put it back

* enable more linters

* remove exclusions
2024-07-31 16:23:44 -04:00
dependabot[bot]
a8df31b31a
chore(deps): bump github.com/btcsuite/btcd from 0.23.4 to 0.24.0 (#1900)
* chore(deps): bump github.com/btcsuite/btcd from 0.23.4 to 0.24.0

Bumps [github.com/btcsuite/btcd](https://github.com/btcsuite/btcd) from 0.23.4 to 0.24.0.
- [Release notes](https://github.com/btcsuite/btcd/releases)
- [Changelog](https://github.com/btcsuite/btcd/blob/master/CHANGES)
- [Commits](https://github.com/btcsuite/btcd/compare/v0.23.4...v0.24.0)

---
updated-dependencies:
- dependency-name: github.com/btcsuite/btcd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: bump github.com/btcsuite/btcd in e2e-ibc

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: drklee3 <derrick@dlee.dev>
2024-07-31 12:52:55 -07:00
dependabot[bot]
6243944db6
chore(deps): bump github.com/hashicorp/go-getter from 1.7.1 to 1.7.5 (#1953)
* chore(deps): bump github.com/hashicorp/go-getter from 1.7.1 to 1.7.5

Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.1 to 1.7.5.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.1...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: bump github.com/hashicorp/go-getter from 1.7.1 to 1.7.5 in e2e-ibc

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: drklee3 <derrick@dlee.dev>
2024-07-31 10:27:46 -07:00
sesheffield
7f339d20ca
fix(insolvency) kava lend insolvency check bug implementation (#1982)
* add additional tests that attempt to borrow funds from the insolvent market(should fail), and attempt to borrow funds from the not insolvent market (it will fail, but shouldn't). The not insolvent market should continue to processs borrows

* remove unused code

* make tests less specific for string contains

* add new get total reserves for denoms functionality

* start utilizing GetTotalReservesForDenoms in ValidateBorrow

* update tests for Borrow to not fail when borrowing from an insolvent market

* use get total reseves in GetTotalReservesForDenoms for reusability

* refactor GetTotalReservesForDenoms to GetTotalReservesByCoinDenoms for more clarity

* change the structure for new and old tests and add more verbosity for other tests

* remove print

* remove unneeded code

* add paren

* adjust structure again after initial PR

* remove duplicate test case with invalid test name, and update to use error contains in places where it was validating if true for strings contains

* no need for keeper method
2024-07-30 13:08:48 -04:00
sesheffield
916ec6d30c
test(insolvency): add tests for Kava lend insolvency check (#1981)
* add additional tests that attempt to borrow funds from the insolvent market(should fail), and attempt to borrow funds from the not insolvent market (it will fail, but shouldn't). The not insolvent market should continue to processs borrows

* remove unused code

* make tests less specific for string contains

* change the structure for new and old tests and add more verbosity for other tests

* remove print

* remove unneeded code

* add paren

* remove duplicate test case with invalid test name, and update to use error contains in places where it was validating if true for strings contains

---------

Co-authored-by: Sam Sheffield <sam.sheffield@kavalabs.io>
2024-07-29 20:51:08 -04:00
Nick DeLuca
b4c04656ab
docs(x/precisebank): Add spec for logic (#1969) 2024-07-29 09:42:17 -07:00
drklee3
837e57ec2e
docs(x/evmutil): Remove akava and evmbankkeeper from spec (#1968) 2024-07-26 14:01:53 -07:00
drklee3
5f802fcfbd
feat(x/precisebank): Emit coin_spent and coin_received events (#1978) 2024-07-26 13:05:49 -07:00
riyueguang
f229afce1a
chore: fix some comments (#1980)
Signed-off-by: riyueguang <rustruby@outlook.com>
2024-07-26 12:38:06 -07:00
drklee3
608f70b20a
feat: Add gRPC query for remainder and account fractional balance (#1971) 2024-07-25 13:36:36 -07:00
Evgeniy Scherbina
74f76d125c
Upgrade opendb (#1972) 2024-07-19 15:44:34 -04:00
drklee3
3853e276a6
feat(x/precisebank): Add query service with TotalFractionalBalances (#1970)
Add query service to precisebank, mostly for e2e test purposes in #1966
Also fix client grpc codec
2024-07-19 10:24:23 -07:00
Evgeniy Scherbina
7aef2f09e9
Upgrade ethermint and opendb (#1965) 2024-07-15 17:45:49 -04:00
Evgeniy Scherbina
58d7c89f8e
Replace opendb package from kava with generic opendb repo (#1959)
* Upgrade ethermint

* Remove opendb package from kava and add custom dbOpener function

* Open metadata.db with custom opendb function
2024-07-11 09:23:31 -04:00
drklee3
d2d661276e
feat: Use x/precisebank for x/evm keeper (#1960)
Replace x/evmutil EvmBankKeeper usage for x/evm
2024-07-10 14:20:12 -07:00
drklee3
9de9de671e
feat(x/precisebank): Display 0 reserve balance to module consumers (#1958)
Module reserve represents fractional balances, so it should be hidden to consumers to not have a misleading total balance that doubles the fractional balances. This modifies GetBalance() and SpendableCoin() to always return zero coins when fetching the reserve address balance for fractional amounts.
2024-07-10 11:14:17 -07:00
drklee3
ce6aac3a72
refactor(x/precisebank): Replace FractionalAmount wrapper with func (#1961)
Removal of unnecessary wrapper type, along with using conversionFactor-1 instead of maxFractionalAmount
2024-07-09 15:33:31 -07:00
drklee3
23ce7d8169
feat(x/precisebank): Return full balances in GetBalance(), add SpendableCoin method (#1957)
Change GetBalance() to return full balances instead of spendable to align behavior with x/bank. Add SpendableCoin() method with support of akava for use in x/evm.
2024-06-28 18:06:48 -07:00
drklee3
60a8073574
feat(x/precisebank): Emit events for send/mint/burn (#1955)
Emits the **total** akava amount for both ukava and akava send/mint/burns. If both akava,ukava are sent (not possible via x/evm nor cosmos messages but still an edge case), then the sum is emitted. No other denoms are emitted by x/precisebank as they will be emitted by the underlying x/bank
2024-06-27 19:40:17 -07:00
Robert Pirtle
2d07988994
e2e-ibc: add ERC20 convert to coin & IBC test (#1950)
* generate erc20 golang interface

* write interchain test that deploys ERC20

* enable deployed erc20 as a conversion pair

* convert erc20 to sdk coin!

* refactor: move RandomMnemonic() to util

* erc20 -> cosmos coin -> ibc e2e test

* add NewEvmSignerFromMnemonic to util

* ci: update ibc-test cache dependency list

* fix ci dependencies
2024-06-24 14:55:40 -07:00
Paul Downing
6a9eda8634
bump deploy version for internal-testnet (#1952) 2024-06-24 11:33:37 -06:00
Paul Downing
4788c064bf
ci: add native wbtc to internal-testnet evm params proposal (#1951)
* add native wbtc to internal-testnet evm params proposal

* Update seed-internal-testnet.sh

remove leading whitespace
2024-06-24 11:12:18 -06:00
drklee3
1743cf5275
fix(x/precisebank): Ensure exact reserve balance on integer carry when minting (#1932)
Fix reserve minting an extra coin when the recipient module both carries fractional over to integer balance AND remainder is insufficient. Adjusts fractional carry to simply send from reserve, instead of doing an additional mint. Add invariant to ensure reserve matches exactly with fractional balances + remainder, failing on both insufficient and excess funds.
2024-06-20 15:20:13 -07:00
rustco
9aef8e4971
chore: fix mismatched method comments (#1949)
Signed-off-by: rustco <ruster@111.com>
2024-06-20 15:09:21 -07:00
drklee3
38230d35e3
feat(x/precisebank): Implement BurnCoins (#1934)
Implement & test BurnCoins method
2024-06-20 15:02:23 -07:00
Paul Downing
af5eea690b
update internal-testnet verison to latest commit (#1948) 2024-06-18 13:57:22 -06:00
Paul Downing
1c1db357f5
update internal testnet wbtc contract config (#1947) 2024-06-18 13:33:33 -06:00
drklee3
409841c79c
feat(x/precisebank): Implement SendCoins (#1923)
Implements methods SendCoins, SendCoinsFromModuleToAccount, SendCoinsFromAccountToModule
2024-06-17 10:53:41 -07:00
Robert Pirtle
4c3f6533a0 ci: bump internal testnet version 2024-06-14 14:04:38 -07:00
Robert Pirtle
e1bd6ffa2f
ci: prefer checkout action to manual pull (#1945)
for internal testnet deployment, record the desired deployment version
as an action variable that can be used by the checkout action instead of
using manual pull & checkout commands
2024-06-14 13:15:45 -07:00
Paul Downing
5b0e7c8c58
bump internal testnet version (#1944) 2024-06-13 18:58:59 -06:00
Paul Downing
8d85c1ae1e
Update genesis.json (#1943)
* Update genesis.json

* align native wbtc naming conventions

* fitx testnet native wbtc naming in genesis

* alphabetically order denoms for internal-testnet genesis
2024-06-13 17:54:39 -06:00
todaymoon
80f2370d68
chore: make function comments match function names (#1935)
Signed-off-by: todaymoon <csgcgl@foxmail.com>
2024-06-13 12:35:22 -07:00
Paul Downing
16233d6031
Update KAVA.VERSION internal-testnet (#1942) 2024-06-12 14:54:31 -06:00
Nick DeLuca
828f17897e
use step output directly instead of fetching more than once (#1940)
Fix issue in finding ref
2024-06-12 12:45:29 -07:00
Paul Downing
a79d852d1c
Update KAVA.VERSION on internal-testnet (#1938)
- use most recent commit to deploy to internal-testnet
2024-06-12 12:24:02 -06:00
Paul Downing
0306bec0ae
bump internal-testnet VERSION and genesis file for wbtc config (#1937)
* bump internal-testnet VERSION and genesis file for wbtc config

* Fix EOF on validate genesis by add missing modules; Fix validation by fixing gov params; update total escrow to default

* bump version for latest genesis

---------

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2024-06-12 10:43:15 -06:00
Paul Downing
5c51530b8e
add new native wbtc contract and seeds to internal-testnet (#1933)
## What Changes
- add a native `wbtc` contract to internal-testnet for testing
- seed the dev wallet and some e2e test wallets with funds for this new contract
2024-06-07 13:26:24 -06:00
Robert Pirtle
21dc0e21b3
ci: don't lint on release tag push (#1930)
the release tag CI is run when semantic versioned tags are pushed.
it is presumed that the commit and/or PR to the release branch being
tagged has already passed the lints.

this gets around Github Actions CI running check-proto-breaking-remote
which compares the pushed commit against _master_ (not the previous release)
2024-06-04 13:02:13 -07:00
zoupingshi
8d07d9cb3b
chore: fix some function names (#1929)
Signed-off-by: zoupingshi <hellocatty@tom.com>
2024-05-31 07:15:15 -07:00
Robert Pirtle
e7cc89a642
deps: use cosmos-sdk v0.47.10-iavl-v1-kava.1 (#1926)
previously, v0.47.10-kava.2 used iavl v1, but this version will be
retracted because that branch & tag should only be used for iavl v0.

this sdk version is the same as v0.47.10-kava.2, but also includes a bug
fix to the initial iavl version used when adding new modules
see https://github.com/Kava-Labs/cosmos-sdk/pull/545
2024-05-28 16:03:47 -07:00
Robert Pirtle
2e8c7ce337
feat(cli): add iavlviewer command (#1922)
* port iavlviewer to kava v0.26.x to debug app hash

* add hash subcommand to iavlviewer

additionally, use better error handling

* update changelog

* separate iavlviewer command into subcommands

---------

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2024-05-28 11:00:28 -07:00
drklee3
110adcab2c
feat(x/precisebank): Implement MintCoins (#1920)
Implement MintCoins method that matches x/bank MintCoins validation behavior
2024-05-24 12:03:09 -07:00