From 11523b13028b72ba6300311fa45298dfc34aa590 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:39:19 +0400 Subject: [PATCH] note: add nondeterministic note to events (#6220) (#6225) ## Description Since events are not hashed into the header they can be non deterministic. Changing an event is not consensus breaking. Will update docs in the spec (cherry picked from commit 884d4d525299e4d43ab881ac19062501c1e09ddf) Co-authored-by: Marko --- proto/tendermint/abci/types.proto | 2 +- types/block.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 2cbcabb29..8e3a90936 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -222,7 +222,7 @@ message ResponseDeliverTx { int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic string codespace = 8; } diff --git a/types/block.go b/types/block.go index 71cbe6f82..c369994b4 100644 --- a/types/block.go +++ b/types/block.go @@ -342,6 +342,7 @@ type Header struct { ConsensusHash tmbytes.HexBytes `json:"consensus_hash"` // consensus params for current block AppHash tmbytes.HexBytes `json:"app_hash"` // state after txs from the previous block // root hash of all results from the txs from the previous block + // see `deterministicResponseDeliverTx` to understand which parts of a tx is hashed into here LastResultsHash tmbytes.HexBytes `json:"last_results_hash"` // consensus info