From 95acfdead1d57f9f6b4aa1a75a47efa36c0ce425 Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Tue, 11 Aug 2020 16:48:22 +0200 Subject: [PATCH] abci: add ResponseInitChain.app_hash (#140) --- spec/abci/abci.md | 3 +++ spec/core/data_structures.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/abci/abci.md b/spec/abci/abci.md index 781469247..8ce0bf815 100644 --- a/spec/abci/abci.md +++ b/spec/abci/abci.md @@ -243,6 +243,7 @@ via light client. - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters (optional). - `Validators ([]ValidatorUpdate)`: Initial validator set (optional). + - `AppHash ([]byte)`: Initial application hash. - **Usage**: - Called once upon genesis. - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators @@ -252,6 +253,8 @@ via light client. set proposed by tendermint (ie. in the genesis file), or if it wants to use a different one (perhaps computed based on some application specific information in the genesis file). + - The returned `AppHash` must match the hash specified in the genesis file, and will be + recorded in the initial genesis block. ### Query diff --git a/spec/core/data_structures.md b/spec/core/data_structures.md index 583b22cf7..b4f2dd0ce 100644 --- a/spec/core/data_structures.md +++ b/spec/core/data_structures.md @@ -413,7 +413,7 @@ block.AppHash == state.AppHash Arbitrary byte array returned by the application after executing and commiting the previous block. It serves as the basis for validating any merkle proofs that comes from the ABCI application and represents the state of the actual application rather than the state of the blockchain itself. -The first block has `block.Header.AppHash == []byte{}`. +The first block's `block.Header.AppHash` is given by `ResponseInitChain.app_hash`, which must match the app hash specified in the genesis file. ### LastResultsHash