Skip to content

Commit

Permalink
explainer paragraph for setting the data hash in the app
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed Apr 1, 2022
1 parent c9cb606 commit 40861a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/architecture/ADR-001-ABCI++.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ func (sqwr *squareWriter) writeMalleatedTx(
}
```

Lastly, the data availability header is used to create the `DataHash` in the `Header` in the application instead of in tendermint. This is done by modifying the protobuf version of the block data to retain the cached hash and setting it during `ProcessProposal`. Later, in `ProcessProposal` other fullnodes check that the `DataHash` matches the block data by recomputing it. Previously, this extra check was performed inside the `ValidateBasic` method of `types.Data`, where is was computed each time it was decoded. Not only is this more efficient as it saves significant computational resources and keeps `ValidateBasic` light, it is also much more explicit. This approach does not however dramatically any existing code in tendermint, as the code to compute the hash of the block data remains there. Ideally, we would move all of the code that computes erasure encoding to the app. This approach allows us to keep the intuitiveness of the `Hash` method for `types.Data`, along with not forcing us to change many tests in tendermint, which rely on this functionality.

This comment has been minimized.

Copy link
@liamsi

liamsi Apr 8, 2022

Member

❤️


### ProcessProposal [#214](https://github.com/celestiaorg/celestia-app/pull/214), [#216](https://github.com/celestiaorg/celestia-app/pull/216), and [#224](https://github.com/celestiaorg/celestia-app/pull/224)

During `ProcessProposal`, we
Expand Down

0 comments on commit 40861a8

Please sign in to comment.