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

Problem: no genesis app hash integrity check #30

Closed
tomtau opened this issue Sep 8, 2020 · 6 comments
Closed

Problem: no genesis app hash integrity check #30

tomtau opened this issue Sep 8, 2020 · 6 comments
Assignees

Comments

@tomtau
Copy link
Contributor

tomtau commented Sep 8, 2020

currently app hash is left empty in genesis; and it's unchecked whether the genesis state matches whatever it ends up with.

there are some related issues in Cosmos SDK e.g. cosmos/cosmos-sdk#7020

@leejw51crypto leejw51crypto self-assigned this Sep 10, 2020
@leejw51crypto
Copy link
Contributor

started

@leejw51crypto
Copy link
Contributor

leejw51crypto commented Sep 12, 2020

in app.go)

func (app *NewApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
 fmt.Println("****************************************************")
 ret := app.BaseApp.InitChain(req)
 var appHash []byte
 if !app.LastCommitID().IsZero() {
 appHash = app.LastCommitID().Hash
 return ret
 } else {
 // $ echo -n '' | sha256sum
 // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
 emptyHash := sha256.Sum256([]byte{})
 appHash = emptyHash[:]
 }
 return abci.ResponseInitChain{
 ConsensusParams: ret.ConsensusParams,
 Validators: ret.Validators,
 AppHash: appHash,
 }

this override basicapp's InitChain, return apphash of genesis block
but it need high version of comos-sdk, and tendermint

i'll check with stargate

@leejw51crypto
Copy link
Contributor

until, cosmos-sdk, tendermint is updated to latest,
i'll do other task

@leejw51crypto
Copy link
Contributor

because master is updated, i'll merge this code

@leejw51crypto
Copy link
Contributor

done, will submir pr

@tomtau
Copy link
Contributor Author

tomtau commented Sep 15, 2020

as discussed in the PR:

  1. app hash field will be removed from genesis: https://github.com/tendermint/tendermint/issues/5238 (so not much value of making an effort of testing it now)
  2. cosmos sdk doesn't dump "the app state" in app state, but puts transactions etc. there that need to be applied, i.e. app state still needs to be computed (so one would need to run the initchain also in genesis.json preparation to compute the app hash, which may be a bit redundant: https://github.com/tendermint/tendermint/issues/5238#issuecomment-673403036 )

@tomtau tomtau closed this as completed Sep 15, 2020
damoncro pushed a commit to damoncro/chain-main that referenced this issue Oct 25, 2021
* Test gravity bridge in integration test

Closes: crypto-org-chain#5

- use orchestrator that supports ethermint
- setup gravity bridged network in integration test
- test bidirectional transfer between ethereum and cronos native tokens

* update orchestrator

* fix environment setup

* cache nix build

* pure nix-shell have issue with ssl certificates

* don't capture stdout

* fixup! Test gravity bridge in integration test

* increase timeout

* orchestrator default hd-path is good

* fixup! increase timeout

* output geth logs

* upload runing data as artifacts for debugging purpose

* integration test

* output full command

* fix tar

* move python config files to integration_tests

* remove temporary scripts

* update pystarport

* cleanup
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

No branches or pull requests

2 participants