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

WIP: Replace GenesisTx with StdTx #2422

Open
wants to merge 42 commits into
base: develop
from

Conversation

Projects
None yet
5 participants
@alessio
Contributor

alessio commented Sep 29, 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

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 alessio added the wip label Sep 29, 2018

@zmanian

This comment has been minimized.

Show comment
Hide comment
@zmanian

zmanian Sep 29, 2018

Member

Hey would it be possible think about aligning the requirements here with our needs to Starfish for launch?

Some description of the idea of Starfish.

https://gist.github.com/zmanian/88fdd41421d363d11adbcf98d3367a4c

Member

zmanian commented Sep 29, 2018

Hey would it be possible think about aligning the requirements here with our needs to Starfish for launch?

Some description of the idea of Starfish.

https://gist.github.com/zmanian/88fdd41421d363d11adbcf98d3367a4c

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Oct 1, 2018

Codecov Report

Merging #2422 into develop will decrease coverage by 0.65%.
The diff coverage is 9.52%.

@@             Coverage Diff             @@
##           develop    #2422      +/-   ##
===========================================
- Coverage     61.9%   61.25%   -0.66%     
===========================================
  Files          149      122      -27     
  Lines         9530     7519    -2011     
===========================================
- Hits          5900     4606    -1294     
+ Misses        3213     2594     -619     
+ Partials       417      319      -98

codecov bot commented Oct 1, 2018

Codecov Report

Merging #2422 into develop will decrease coverage by 0.65%.
The diff coverage is 9.52%.

@@             Coverage Diff             @@
##           develop    #2422      +/-   ##
===========================================
- Coverage     61.9%   61.25%   -0.66%     
===========================================
  Files          149      122      -27     
  Lines         9530     7519    -2011     
===========================================
- Hits          5900     4606    -1294     
+ Misses        3213     2594     -619     
+ Partials       417      319      -98
@cwgoes

This comment has been minimized.

Show comment
Hide comment
@cwgoes

cwgoes Oct 2, 2018

Contributor

@zaki What will be the process for collecting genesis accounts for the Hub? Will the ICF issue a "suggested" allocation list, which node operators can then combine with their list of genesis transactions locally - or will the ICF collate genesis transactions itself and provide a full genesis file?

Contributor

cwgoes commented Oct 2, 2018

@zaki What will be the process for collecting genesis accounts for the Hub? Will the ICF issue a "suggested" allocation list, which node operators can then combine with their list of genesis transactions locally - or will the ICF collate genesis transactions itself and provide a full genesis file?

@cwgoes

This comment has been minimized.

Show comment
Hide comment
@cwgoes

cwgoes Oct 2, 2018

Contributor

Let's include this in 0.25.

Contributor

cwgoes commented Oct 2, 2018

Let's include this in 0.25.

@cwgoes cwgoes referenced this pull request Oct 2, 2018

Open

SDK 0.25 / Gaia-9000 release checklist #2220

17 of 22 tasks complete
@zmanian

This comment has been minimized.

Show comment
Hide comment
@zmanian

zmanian Oct 3, 2018

Member

It's gonna be more the like here are allocations + genesis txs + tools for reading eth and Bitcoin blockchains.

Member

zmanian commented Oct 3, 2018

It's gonna be more the like here are allocations + genesis txs + tools for reading eth and Bitcoin blockchains.

@jackzampolin

This comment has been minimized.

Show comment
Hide comment
@jackzampolin

jackzampolin Oct 4, 2018

Contributor

Lets make sure we at least have an eye toward starfish requirements while implementing this. Lets sync on this @alessio

Contributor

jackzampolin commented Oct 4, 2018

Lets make sure we at least have an eye toward starfish requirements while implementing this. Lets sync on this @alessio

@zmanian

This comment has been minimized.

Show comment
Hide comment
@zmanian

zmanian Oct 6, 2018

Member

I feel like we can implement Starfish as wrapper around this functionality.

Member

zmanian commented Oct 6, 2018

I feel like we can implement Starfish as wrapper around this functionality.

@jaekwon

This comment has been minimized.

Show comment
Hide comment
@jaekwon

jaekwon Oct 8, 2018

Contributor

Reviewing...

Contributor

jaekwon commented Oct 8, 2018

Reviewing...

@jaekwon jaekwon self-requested a review Oct 8, 2018

@jaekwon jaekwon self-assigned this Oct 8, 2018

alessio added some commits Oct 11, 2018

Add arg to PrintUnsignedStdTx() to actually operate in offline mode
Finalize gaiacli tx create-validator --genesis-format

alessio added some commits Oct 12, 2018

alessio added some commits Oct 14, 2018

WIP
Power: 1,
Name: fmt.Sprintf("validator-%d", i+1),
},
for i:=0 ; i<nValidators; i++ {

This comment has been minimized.

@jaekwon

jaekwon Oct 16, 2018

Contributor

dry w/ above

@jaekwon

jaekwon Oct 16, 2018

Contributor

dry w/ above

@@ -107,7 +107,7 @@ func PrintUnsignedStdTx(txBldr authtxb.TxBuilder, cliCtx context.CLIContext, msg
// SignStdTx appends a signature to a StdTx and returns a copy of a it. If appendSig
// is false, it replaces the signatures already attached with the new signature.
func SignStdTx(txBldr authtxb.TxBuilder, cliCtx context.CLIContext, name string, stdTx auth.StdTx, appendSig bool) (auth.StdTx, error) {
func SignStdTx(txBldr authtxb.TxBuilder, cliCtx context.CLIContext, name string, stdTx auth.StdTx, appendSig bool, offline bool) (auth.StdTx, error) {

This comment has been minimized.

@jaekwon

jaekwon Oct 16, 2018

Contributor

ideally is maybe SignStdTxOptions struct/ptr? But this is maybe fine for now w/ comment & TODO in comments in code... (for me anyways)

@jaekwon

jaekwon Oct 16, 2018

Contributor

ideally is maybe SignStdTxOptions struct/ptr? But this is maybe fine for now w/ comment & TODO in comments in code... (for me anyways)

if len(req.Validators) > 0 {
if len(req.Validators) != len(validators) {
panic(fmt.Errorf("len(RequestInitChain.Validators) != len(validators) (%d != %d) ", len(req.Validators), len(validators)))
}

This comment has been minimized.

@jaekwon

jaekwon Oct 16, 2018

Contributor

TODO sort and equality check...

@jaekwon

jaekwon Oct 16, 2018

Contributor

TODO sort and equality check...

@@ -32,6 +31,7 @@ var (
// State to Unmarshal
type GenesisState struct {
Accounts []GenesisAccount `json:"accounts"`
Txs []json.RawMessage `json:"txs"`

This comment has been minimized.

@jaekwon

jaekwon Oct 16, 2018

Contributor

[]StdTx?

@jaekwon

jaekwon Oct 16, 2018

Contributor

[]StdTx?

This comment has been minimized.

@alessio

alessio Oct 16, 2018

Contributor

Yeah that was the original implementation. I could roll it back, though this is not blocking now

@alessio

alessio Oct 16, 2018

Contributor

Yeah that was the original implementation. I could roll it back, though this is not blocking now

@@ -273,3 +206,73 @@ func GaiaAppGenStateJSON(cdc *codec.Codec, appGenTxs []json.RawMessage) (appStat
appState, err = codec.MarshalJSONIndent(cdc, genesisState)
return
}
// ProcessStdTxs processes and validates application's genesis StdTxs and returns the list of validators,

This comment has been minimized.

@jaekwon

jaekwon Oct 16, 2018

Contributor

s/ProcessStdTxs/CollectGenTxs/g

@jaekwon

jaekwon Oct 16, 2018

Contributor

s/ProcessStdTxs/CollectGenTxs/g

This comment has been minimized.

@alessio

alessio Oct 16, 2018

Contributor

Agreed

@alessio

alessio Oct 16, 2018

Contributor

Agreed

err = errors.New("must provide at least genesis message")
return
}
msg := msgs[0].(stake.MsgCreateValidator)
// create the genesis account, give'm few steaks and a buncha token with there name

This comment has been minimized.

@jaekwon

jaekwon Oct 16, 2018

Contributor

"their name" not "there name"... some elses typo

@jaekwon

jaekwon Oct 16, 2018

Contributor

"their name" not "there name"... some elses typo

alessio added some commits Oct 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment