You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The consensus connection is driven by a consensus protocol and is responsible
14
+
The `Consensus Connection` is driven by a consensus protocol and is responsible
16
15
for block execution.
17
-
18
-
The mempool connection is for validating new transactions, before they're
16
+
The `Mempool Connection` is for validating new transactions, before they're
19
17
shared or included in a block.
20
-
21
-
The info connection is for initialization and for queries from the user.
22
-
23
-
The snapshot connection is for serving and restoring [state sync snapshots](apps.md#state-sync).
18
+
The `Info Connection` is for initialization and for queries from the user.
24
19
25
20
Additionally, there is a `Flush` method that is called on every connection,
26
21
and an `Echo` method that is just for debugging.
@@ -156,22 +151,6 @@ The result is an updated application state.
156
151
Cryptographic commitments to the results of DeliverTx, EndBlock, and
157
152
Commit are included in the header of the next block.
158
153
159
-
## State Sync
160
-
161
-
State sync allows new nodes to rapidly bootstrap by discovering, fetching, and applying
162
-
state machine snapshots instead of replaying historical blocks. For more details, see the
163
-
[state sync section](apps.md#state-sync).
164
-
165
-
When a new node is discovering snapshots in the P2P network, existing nodes will call
166
-
`ListSnapshots` on the application to retrieve any local state snapshots. The new node will
167
-
offer these snapshots to its local application via `OfferSnapshot`.
168
-
169
-
Once the application accepts a snapshot and begins restoring it, Tendermint will fetch snapshot
170
-
chunks from existing nodes via `LoadSnapshotChunk` and apply them sequentially to the local
171
-
application with `ApplySnapshotChunk`. When all chunks have been applied, the application
172
-
`AppHash` is retrieved via an `Info` query and compared to the blockchain's `AppHash` verified
173
-
via light client.
174
-
175
154
## Messages
176
155
177
156
### Echo
@@ -409,83 +388,6 @@ via light client.
409
388
other purposes, e.g. auditing, replay of non-persisted heights, light client
410
389
verification, and so on.
411
390
412
-
### ListSnapshots
413
-
414
-
-**Response**:
415
-
-`Snapshots ([]Snapshot)`: List of local state snapshots.
416
-
-**Usage**:
417
-
- Used during state sync to discover available snapshots on peers.
418
-
- See `Snapshot` data type for details.
419
-
420
-
### LoadSnapshotChunk
421
-
422
-
-**Request**:
423
-
-`Height (uint64)`: The height of the snapshot the chunks belongs to.
424
-
-`Format (uint32)`: The application-specific format of the snapshot the chunk belongs to.
425
-
-`Chunk (uint32)`: The chunk index, starting from `0` for the initial chunk.
426
-
-**Response**:
427
-
-`Chunk ([]byte)`: The binary chunk contents, in an arbitray format. Chunk messages cannot be
428
-
larger than 16 MB _including metadata_, so 10 MB is a good starting point.
429
-
-**Usage**:
430
-
- Used during state sync to retrieve snapshot chunks from peers.
431
-
432
-
### OfferSnapshot
433
-
434
-
-**Request**:
435
-
-`Snapshot (Snapshot)`: The snapshot offered for restoration.
436
-
-`AppHash ([]byte)`: The light client-verified app hash for this height, from the blockchain.
437
-
-**Response**:
438
-
-`Result (Result)`: The result of the snapshot offer.
439
-
-`accept`: Snapshot is accepted, start applying chunks.
440
-
-`abort`: Abort snapshot restoration, and don't try any other snapshots.
441
-
-`reject`: Reject this specific snapshot, try others.
442
-
-`reject_format`: Reject all snapshots with this `format`, try others.
443
-
-`reject_senders`: Reject all snapshots from all senders of this snapshot, try others.
444
-
-**Usage**:
445
-
-`OfferSnapshot` is called when bootstrapping a node using state sync. The application may
446
-
accept or reject snapshots as appropriate. Upon accepting, Tendermint will retrieve and
447
-
apply snapshot chunks via `ApplySnapshotChunk`. The application may also choose to reject a
448
-
snapshot in the chunk response, in which case it should be prepared to accept further
449
-
`OfferSnapshot` calls.
450
-
- Only `AppHash` can be trusted, as it has been verified by the light client. Any other data
451
-
can be spoofed by adversaries, so applications should employ additional verification schemes
452
-
to avoid denial-of-service attacks. The verified `AppHash` is automatically checked against
453
-
the restored application at the end of snapshot restoration.
454
-
- For more information, see the `Snapshot` data type or the [state sync section](apps.md#state-sync).
455
-
456
-
### ApplySnapshotChunk
457
-
458
-
-**Request**:
459
-
-`Index (uint32)`: The chunk index, starting from `0`. Tendermint applies chunks sequentially.
460
-
-`Chunk ([]byte)`: The binary chunk contents, as returned by `LoadSnapshotChunk`.
461
-
-`Sender (string)`: The P2P ID of the node who sent this chunk.
462
-
-**Response**:
463
-
-`Result (Result)`: The result of applying this chunk.
464
-
-`accept`: The chunk was accepted.
465
-
-`abort`: Abort snapshot restoration, and don't try any other snapshots.
466
-
-`retry`: Reapply this chunk, combine with `RefetchChunks` and `RejectSenders` as appropriate.
467
-
-`retry_snapshot`: Restart this snapshot from `OfferSnapshot`, reusing chunks unless
468
-
instructed otherwise.
469
-
-`reject_snapshot`: Reject this snapshot, try a different one.
470
-
-`RefetchChunks ([]uint32)`: Refetch and reapply the given chunks, regardless of `Result`. Only
471
-
the listed chunks will be refetched, and reapplied in sequential order.
472
-
-`RejectSenders ([]string)`: Reject the given P2P senders, regardless of `Result`. Any chunks
473
-
already applied will not be refetched unless explicitly requested, but queued chunks from these senders will be discarded, and new chunks or other snapshots rejected.
474
-
-**Usage**:
475
-
- The application can choose to refetch chunks and/or ban P2P peers as appropriate. Tendermint
476
-
will not do this unless instructed by the application.
477
-
- The application may want to verify each chunk, e.g. by attaching chunk hashes in
478
-
`Snapshot.Metadata` and/or incrementally verifying contents against `AppHash`.
479
-
- When all chunks have been accepted, Tendermint will make an ABCI `Info` call to verify that
480
-
`LastBlockAppHash` and `LastBlockHeight` matches the expected values, and record the
481
-
`AppVersion` in the node state. It then switches to fast sync or consensus and joins the
482
-
network.
483
-
- If Tendermint is unable to retrieve the next chunk after some time (e.g. because no suitable
484
-
peers are available), it will reject the snapshot and try a different one via `OfferSnapshot`.
485
-
The application should be prepared to reset and accept it or abort as appropriate.
486
-
487
-
###
488
-
489
391
## Data Types
490
392
491
393
### Header
@@ -638,22 +540,3 @@ via light client.
638
540
-`Type (string)`: Type of Merkle proof and how it's encoded.
639
541
-`Key ([]byte)`: Key in the Merkle tree that this proof is for.
640
542
-`Data ([]byte)`: Encoded Merkle proof for the key.
641
-
642
-
### Snapshot
643
-
644
-
-**Fields**:
645
-
-`Height (uint64)`: The height at which the snapshot was taken (after commit).
646
-
-`Format (uint32)`: An application-specific snapshot format, allowing applications to version
647
-
their snapshot data format and make backwards-incompatible changes. Tendermint does not
648
-
interpret this.
649
-
-`Chunks (uint32)`: The number of chunks in the snapshot. Must be at least 1 (even if empty).
650
-
-`Hash (bytes)`: An arbitrary snapshot hash. Must be equal only for identical snapshots across
651
-
nodes. Tendermint does not interpret the hash, it only compares them.
652
-
-`Metadata (bytes)`: Arbitrary application metadata, for example chunk hashes or other
653
-
verification data.
654
-
655
-
-**Usage**:
656
-
- Used for state sync snapshots, see [separate section](apps.md#state-sync) for details.
657
-
- A snapshot is considered identical across nodes only if _all_ fields are equal (including
658
-
`Metadata`). Chunks may be retrieved from all nodes that have the same snapshot.
659
-
- When sent across the network, a snapshot message can be at most 4 MB.
0 commit comments