Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major upgrade to core (Alliance, IBC-hooks, ICA controller, token factory, cosmos v0.46) #106

Merged
merged 9 commits into from
Mar 28, 2023

Conversation

javiersuweijie
Copy link
Member

@javiersuweijie javiersuweijie commented Mar 8, 2023

Change log

  1. Upgrade cosmos-sdk to use 0.46.x
  2. Updated wasm to use github.com/notional-labs/wasmd v0.30.0-sdk469.4
  3. Updated ibc and packetfowardingmiddleware from v3 to v6
  4. Added ibc-hooks as a custom module
  5. Added the token-factory module
  6. Enabled ica-controller module
  7. Added alliance module

Misc updates

  1. Added scripts to run a ICA host demo
  2. Added testing script for simulating a chain upgrade

Tests performed

  • Code compiles
  • Making sure all lint issues are fixed
  • Chain simulation runs
  • Started a chain with current version of terrad, putting in a software update proposal and switching to the new binary

Integration Tests

  • Build and spinup two chains,
  • Create a relayer between this chains using rly software,
  • Alliance module test bridge token, create an alliance, delegate and validate the custom bank module integration,
  • IbcHooks deploy a cosmwasm contract, instantiate the contract, use an IBC hook to increment the counter and validate the counter has been incremented and the funds have been received,
  • ICA register a controller, send funds to that controller, execute an MsgDelegate with IBC and validate the delegation went thru correctly,
  • TokenFactory create a new denom, mint tokens from that denom, query the balances, burn tokens, do an ibc transfer using the previously created denom and validate the IBC transfer on both chains,
  • Terra Vesting Accounts create and validate a vesting account created on genesis containing the correct balances, deploy a vesting account and validate that the tokens are vesting over 5 iterations with sleep of 3 seconds.

@javiersuweijie javiersuweijie changed the title Upgrade to use cosmos-sdk 0.46 Major upgrade to core (Alliance, IBC-hooks, ICA controller, token factory, cosmos v0.46) Mar 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

❗ No coverage uploaded for pull request base (test@456e8fa). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head bbe26d2 differs from pull request most recent head d0e252f. Consider uploading reports for the commit d0e252f to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             test     #106   +/-   ##
=======================================
  Coverage        ?   70.77%           
=======================================
  Files           ?        5           
  Lines           ?      739           
  Branches        ?        0           
=======================================
  Hits            ?      523           
  Misses          ?      200           
  Partials        ?       16           

@emidev98 emidev98 force-pushed the upgrade/cosmos46 branch 3 times, most recently from 0682490 to 72ee4f4 Compare March 17, 2023 11:13
faddat and others added 2 commits March 20, 2023 10:11
* golangci-lint run ./... --fix

* gofumpt

* cleaner linter config

* remove init.go
* Create banner.png

* Update readme.md

* Delete banner.png

* Create CODE_OF_CONDUCT.md

* Update readme.md
go.mod Outdated
github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect
github.com/cosmos/gogoproto v1.4.4 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/cosmos/ledger-go v0.9.2 // indirect
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update?
#93

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emidev98 looked into it but doesn't seem like it was a simple upgrade. Will need to look further into it. Isn't consensus breaking so we could spend more time and investigate after this major release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be really good to have these libraries upgrade for the next major version. Should we check with @soulmachine in case he has more experience with the Ledger App to upgrade them for the next release?

go.mod Outdated
github.com/cosmos/cosmos-sdk => github.com/terra-money/cosmos-sdk v0.45.12-terra.1
github.com/CosmWasm/wasmd => github.com/notional-labs/wasmd v0.30.0-sdk469.4
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/terra-money/cosmos-sdk v0.46.11-terra.rc.5
github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we running a forked version?

Copy link
Member Author

@javiersuweijie javiersuweijie Mar 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For cosmwasm, there is no release for cosmos-sdk 46. Notional Labs released a version that supports it.
For ics23, they forked and renamed it into the cosmos organization here: github.com/confio/ics23 -> https://github.com/cosmos/ics23
For cosmos-sdk, we need a forked version because we updated how periodic vesting works

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding
github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2

@emidev98 emidev98 mentioned this pull request Mar 21, 2023
@gregnuj gregnuj changed the base branch from main to test March 28, 2023 18:29
@gregnuj
Copy link

gregnuj commented Mar 28, 2023

merging to test, test track pisco, main tracks phoenix

@gregnuj gregnuj merged commit 99ef15d into test Mar 28, 2023
@emidev98 emidev98 deleted the upgrade/cosmos46 branch March 29, 2023 07:07
gregnuj pushed a commit that referenced this pull request Apr 20, 2023
* upgraded to use cosmos-sdk 46

* feat: added token factory

* feat: added ibc wasm hooks

* feat: added healthcheck route

* fix: renamed rest to error

* fix: comsos-sdk/46 imports

* feat: cosmossdk-46 add ICA

* feat: added token factory genesis

* feat: refactored upgrades and added tokenfactory genesis

* refactored terra app configs

* fix: added tokenfactory to app init

* feat: remove icagenesis from InitChainer

* feat: enable ica

* feat: ICA demo and instructions to run the demo

* fix: added test script to test chain upgrade + fixes for stores

* fix: lint issues

* fix: added ibc fee module

* fix: make sure chain upgrade tester runs for the current codebase

* feat: add alliance

* fix: updated github workflows and added go.mod

* fix: moved alliance keeper up

* feat: added alliance and token factory swagger

* feat: added ica host and controller swagger

* chore: update chain upgrade tester

* feat: intechain acc test all in one

* feat: restructure integration tests

* feat: integration tests ibc-hooks

* feat: integration tests with ibc-hooks

* feat: integration tests for alliance

* fix: typos for progoc gen

* feat: integration tests for versting accounts

* feat: waiting for alliance to be instantiated

* feat: integration tests for token factoryg

* feat: spendable balance caclculated by block

* chore: update cosmos sdk

* feat: validate the custom bank module integration

* fix: ci on cosmossdk 46

* fix: tests for vesting accounts

* removed dependency on cometbft-db

* chore: dependencies

* fix: golang version ci

* feat: upgrade ci from v3 to v4

* feat: add cosmwasm_1_1

* tests: added chain simulation

* updated cosmos-sdk

* added simulate into CI

* test: add unit tests for simulation

* fix:Gosec Security Scanner

* test: alliance integration tests params

* fix: swagger gen (#116)

* add release

* reup of release,dockerfile,makefile

* add readme/cc frommain

* fix error in readme

* add multiplatform builds

* remove darwin from  multiplatform builds

* update release build

* update makefile

* uncomment version for binary build

* create rls thru github cli

* set gh_token env variable

* change draft to prerelease

* change darwin to linux for mac build

* change darwin to linux for mac build

* create release then upload artifacts

* add github token to release action

* fix checkout in release job

* calculate rls hashes thru github action

* calculate checksum

* calculate checksum

* calculate checksum

* calculate checksum

* use --repo switch instead cloning

* Major upgrade to core (Alliance, IBC-hooks, ICA controller, token factory, cosmos v0.46) (#106)

* Cleanup (#98)

* golangci-lint run ./... --fix

* gofumpt

* cleaner linter config

* remove init.go

* Update/readme (#110)

* Create banner.png

* Update readme.md

* Delete banner.png

* Create CODE_OF_CONDUCT.md

* Update readme.md

* fix: swagger gen

* Revert "Cleanup (#98)" (#115)

This reverts commit a97277b.

* feat: update swagger gen

---------

Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
Co-authored-by: Evan <87997759+evanorti@users.noreply.github.com>
Co-authored-by: emidev98 <emilian@terra.money>
Co-authored-by: emidev98 <49301655+emidev98@users.noreply.github.com>
Co-authored-by: Greg Junge <greg@terra.money>

* Update markdown files (#123)

* Update readme.md

* Update CHANGELOG.md

* Update RELEASES.md

* Update SECURITY.md

* Update README.md

* Update README.md

* fix: security wasmvm (#122)

* fix: security wasmvm

* add dokerfile updates

* update wasmd

* update ledger-go dep

* chore: increase code version

---------

Co-authored-by: gregnuj <greg@terra.money>

* Release/v2.3 (#127)

* fix: security wasmvm

* add dokerfile updates

* update wasmd

* update ledger-go dep

* Update markdown files (#123) (#124)

* Update readme.md

* Update CHANGELOG.md

* Update RELEASES.md

* Update SECURITY.md

* Update README.md

* Update README.md

Co-authored-by: Evan <87997759+evanorti@users.noreply.github.com>

* Test (#126)

* Update markdown files (#123)

* Update readme.md

* Update CHANGELOG.md

* Update RELEASES.md

* Update SECURITY.md

* Update README.md

* Update README.md

* fix: security wasmvm (#122)

* fix: security wasmvm

* add dokerfile updates

* update wasmd

* update ledger-go dep

* chore: increase code version

---------

Co-authored-by: gregnuj <greg@terra.money>
Co-authored-by: Evan <87997759+evanorti@users.noreply.github.com>
Co-authored-by: emidev98 <emilian@terra.money>

* fix: coverage report

---------

Co-authored-by: javiersuweijie <javier.su.weijie@gmail.com>
Co-authored-by: javier <javiersuweijie@jav-mbp.local>
Co-authored-by: gregnuj <greg@terra.money>
Co-authored-by: Michal Turcan <michal.turcan.za@gmail.com>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
Co-authored-by: Evan <87997759+evanorti@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants