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

R4R: upgrade cosmos to 0.25 & tendermint to v0.25.1-rc0 #215

Merged
merged 34 commits into from
Nov 5, 2018

Conversation

rickyyangz
Copy link
Contributor

@rickyyangz rickyyangz commented Oct 26, 2018

Closes: #118
Closes: #59

Description

Upgrade cosmos and tendermint.
We switch to our own cosmos-sdk repo https://github.com/BiJie/bnc-cosmos-sdk which is forked from the official repo.
Both the new cosmos-sdk repo and BinanceChain will reference to same version of tendermint which is
v0.25.1-rc0 currently.

Rationale

Too many files copied from the original cosmos-sdk since we have lot of customized features.
If not forking, more and more files need copy which would make the future upgrade harder and harder.

Example

Changes

Notable changes:

  • move most copied files back to our forked cosmos-sdk repo (except AnteHandler)
  • AccountMapper -> AccountKeeper
  • NewCoin -> NewInt64Coin
  • implement Route() & GetInvolvedAddresses for each msg
  • remove stdfee & gas
  • CoreContext split into CLIContext & TxBuilder
  • add our own Init & testnet cmd
  • add a new store to save the mapping of validators' two addresses.

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • integration tests passed (make integration_test)
  • manual transaction test passed (cli invoke)

Already reviewed by

@ackratos @guagualvcha

Related issues

Gopkg.toml Outdated
@@ -57,6 +57,10 @@
branch = "master"
name = "github.com/deathowl/go-metrics-prometheus"

[prune]
go-tests = true
unused-packages = true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dup

@rickyyangz rickyyangz changed the title [TEMP] Upgrade to cosmos 0.25 (use their develop branch for now) upgrade cosmos to 0.25 & tendermint to v0.25.1-rc0 Nov 2, 2018
@rickyyangz rickyyangz changed the title upgrade cosmos to 0.25 & tendermint to v0.25.1-rc0 R4R: upgrade cosmos to 0.25 & tendermint to v0.25.1-rc0 Nov 2, 2018
@@ -59,3 +56,13 @@
[[constraint]]
branch = "master"
name = "github.com/deathowl/go-metrics-prometheus"

[[override]]
name = "golang.org/x/crypto"
Copy link
Contributor

Choose a reason for hiding this comment

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

comments why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me confirm...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cosmos-sdk overrides this version of crypto. so to use this version, we have to override here.

app/app.go Outdated
app.MountStoresIAVL(
common.MainStoreKey,
common.AccountStoreKey,
common.ValStoreKey,
Copy link
Contributor

Choose a reason for hiding this comment

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

It is hard to tell what ValStore is about. could we change to a clearer name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ValAddrStore ?

Copy link
Contributor

Choose a reason for hiding this comment

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

better.

@@ -83,43 +53,22 @@ func NewAnteHandler(am auth.AccountMapper, orderMsgType string) sdk.AnteHandler
// collect signer accounts
// TODO: abort if there is more than one signer?
var signerAccs = make([]auth.Account, len(signerAddrs))
Copy link
Contributor

Choose a reason for hiding this comment

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

this part is new change made by Luke, missed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

his change is a workaround. so here we have used a more reasonable solution to fix the sequence issue.

checkInvalidTx(t, anteHandler, ctx, txn, sdk.CodeInvalidPubKey)
}

func TestAnteHandlerGoodOrderID(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong drop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the new solution, we do not check orderId in ante handler. So dropped it.

@darren-liu
Copy link
Contributor

not much big change is required. Please try to solve the conflict and merge in next week. thanks!

@rickyyangz rickyyangz merged commit a29fc85 into master Nov 5, 2018
@notatestuser notatestuser deleted the upgrade0.25temp branch February 12, 2019 07:14
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.

4 participants