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: Replace GenTx with StdTx #2524

Merged
merged 84 commits into from
Oct 19, 2018

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Oct 17, 2018

Ref #1890

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

CC'ing @jaekwon


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alessio
Copy link
Contributor Author

alessio commented Oct 18, 2018

FTBFS due to:

go install -tags "netgo ledger" -ldflags "-X github.com/cosmos/cosmos-sdk/version.Version=0.24.2-886-g90013838" ./cmd/gaia/cmd/gaiad
# github.com/cosmos/cosmos-sdk/store
store/iavlstore.go:233:14: cannot use p (type []byte) as type *merkle.Proof in assignment
store/rootmultistore.go:303:12: cannot use buildMultiStoreProof(res.Proof, storeName, commitInfo.StoreInfos) (type []byte) as type *merkle.Proof in assignment
store/rootmultistore.go:303:38: cannot use res.Proof (type *merkle.Proof) as type []byte in argument to buildMultiStoreProof
store/rootmultistore.go:390:23: undefined: merkle.Hasher
Makefile:75: recipe for target 'install' failed
make: *** [install] Error 2
Exited with code 2

@codecov
Copy link

codecov bot commented Oct 18, 2018

Codecov Report

Merging #2524 into develop will decrease coverage by 0.03%.
The diff coverage is 43.34%.

@@             Coverage Diff             @@
##           develop    #2524      +/-   ##
===========================================
- Coverage    57.88%   57.84%   -0.04%     
===========================================
  Files          140      141       +1     
  Lines         8119     8192      +73     
===========================================
+ Hits          4700     4739      +39     
- Misses        3122     3149      +27     
- Partials       297      304       +7

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

Thanks @alessio - see comments

client/utils/utils.go Show resolved Hide resolved
cmd/gaia/app/app.go Outdated Show resolved Hide resolved
cmd/gaia/app/app.go Show resolved Hide resolved
cmd/gaia/app/app.go Show resolved Hide resolved

// create the genesis account, give'm few steaks and a buncha token with there name
genaccs[i] = genesisAccountFromGenTx(genTx)
genaccs[i] = genesisAccountFromMsgCreateValidator(msg, freeFermionsAcc)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this part is pretty Gaia-specific (as is needing to update the stake data).

Copy link
Contributor

Choose a reason for hiding this comment

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

But also, this won't actually be in Gaia, since we'll have an account set unrelated to the validator transactions. This needs to move to a special testnet command I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the approach that Gaia will use (separate account set) is likely to be common - and we might want to allow delegation transactions at genesis too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this can be split into a separate PR. Also cc @zmanian - what do we need, if anything, for GoS genesis setup?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can use this for now and just strip the accounts generated here and use the fundraiser distribution instead, copy/paste job.

cmd/gaia/app/genesis.go Show resolved Hide resolved
cmd/gaia/app/genesis.go Show resolved Hide resolved
cmd/gaia/app/genesis.go Show resolved Hide resolved
x/stake/client/cli/tx.go Show resolved Hide resolved
@alessio alessio changed the title Replace GenTx with StdTx R4R: Replace GenTx with StdTx Oct 18, 2018
cmd/gaia/app/app.go Show resolved Hide resolved
cmd/gaia/app/app.go Outdated Show resolved Hide resolved
cmd/gaia/app/genesis.go Outdated Show resolved Hide resolved
@cwgoes
Copy link
Contributor

cwgoes commented Oct 18, 2018

@alessio Looks like the linter & module simulations are failing?

@alessio
Copy link
Contributor Author

alessio commented Oct 18, 2018

@cwgoes integration tests failed too - I'm on it

@alessio
Copy link
Contributor Author

alessio commented Oct 19, 2018

Good to go @cwgoes

client/lcd/lcd_test.go Outdated Show resolved Hide resolved
}

sort.Strings(addresses)
persistentPeers = strings.Join(addresses, ",")
Copy link
Member

Choose a reason for hiding this comment

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

I really don't think we should be using the Memo field of the StdTxs to propogate persistent peer ids.... What if someone wants to put something different in the Memo field?

Also seems to be conflating config stuff with genesis file stuff.

@cwgoes @jaekwon @alessio

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to get rid of it

if err != nil {
return
// skip stakeData validation as genesis is created from txs
if len(genesisState.Txs) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure we want to validate regardless for consistency of the genesisState.* information. For example, this validates parameters as well. And in the future I think we'll want to support loading genesis w/ stake/slashing/etc data as well as genesis txs... such as when recovering from a halted chain, though more changes will be necessary then.

@alessio
Copy link
Contributor Author

alessio commented Oct 19, 2018

I've reintroduced gaiad gentx for users convenience. I'll update docs accordingly ASAP

@alessio alessio requested a review from zramsay as a code owner October 19, 2018 04:24
@alessio alessio force-pushed the alessio/1890-replace-genesistx-with-stdtx-rebased branch from 6b56153 to 256919f Compare October 19, 2018 04:27
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

Tested ACK - thanks @alessio

We could use a little more cleanup on CLI output, but that can happen later.

@cwgoes cwgoes merged commit 593921d into develop Oct 19, 2018
@cwgoes cwgoes deleted the alessio/1890-replace-genesistx-with-stdtx-rebased branch October 19, 2018 18:00
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.

5 participants