Skip to content

Commit

Permalink
docs/adr: Update state access ADR to include balance verification (#513)
Browse files Browse the repository at this point in the history
* docs: include verification against AppHash requirement in state access ADR

* docs: add section for availability of StateServ during sync
  • Loading branch information
renaynay authored Apr 6, 2022
1 parent 0bd9d63 commit 00edd1e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/adr/adr-004-state-interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ type StateAccessor interface {
respond to the queries without relaying queries to celestia-core (*to be scoped out and implemented in later
iterations*)

### Verification of Balances
In order to check that the balances returned via the `AccountBalance` query are correct, it is necessary to also request
Merkle proofs from the celestia-app and verify them against the latest head's `AppHash`. In order for the `StateAccessor`
to do this, it would need access to the `header.Store`'s `Head()` method in order to get the latest known header of the
node and check its `AppHash`.

### Availability of `StateService` during sync
The `Syncer` in the `header` package provides one public method, `Finished()`, that indicates whether the syncer has
finished syncing. Introducing the availability of `StateService` would require extending the public API for `Syncer`
with an additional method, `NetworkHead()`, in order to be able to fetch *current* state from the network. The `Syncer`
would then have to be passed to any implementation of `StateService` upon construction and relied on in order to access
the network head even if the syncer is still syncing, as the network head is still verified even during sync.

### 1. Core Implementation of `StateAccessor`: `CoreAccess`

`CoreAccess` will be the direct RPC connection implementation of `StateAccessor`. It will maintain a gRPC connection
Expand Down

0 comments on commit 00edd1e

Please sign in to comment.