pub struct ApplySnapshotChunk {
pub index: u32,
pub chunk: Bytes,
pub sender: String,
}
Expand description
Applies a snapshot chunk.
The application can choose to refetch chunks and/or ban P2P peers as appropriate. Tendermint will not do this unless instructed by the application.
The application may want to verify each chunk, e.g., by attaching chunk
hashes in Snapshot::metadata
and/or incrementally verifying contents
against app_hash
.
When all chunks have been accepted, Tendermint will make an ABCI Info
request to verify that last_block_app_hash
and last_block_height
match
the expected values, and record the app_version
in the node state. It then
switches to fast sync or consensus and joins the network.
If Tendermint is unable to retrieve the next chunk after some time (e.g.,
because no suitable peers are available), it will reject the snapshot and try
a different one via OfferSnapshot
. The application should be prepared to
reset and accept it or abort as appropriate.
Fields§
§index: u32
The chunk index, starting from 0
. Tendermint applies chunks sequentially.
chunk: Bytes
The binary chunk contents, as returned by LoadSnapshotChunk
.
sender: String
The P2P ID of the node who sent this chunk.
Trait Implementations§
Source§impl Clone for ApplySnapshotChunk
impl Clone for ApplySnapshotChunk
Source§fn clone(&self) -> ApplySnapshotChunk
fn clone(&self) -> ApplySnapshotChunk
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ApplySnapshotChunk
impl Debug for ApplySnapshotChunk
Source§impl From<ApplySnapshotChunk> for RequestApplySnapshotChunk
impl From<ApplySnapshotChunk> for RequestApplySnapshotChunk
Source§fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self
fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self
Source§impl From<ApplySnapshotChunk> for RequestApplySnapshotChunk
impl From<ApplySnapshotChunk> for RequestApplySnapshotChunk
Source§fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self
fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self
Source§impl From<ApplySnapshotChunk> for RequestApplySnapshotChunk
impl From<ApplySnapshotChunk> for RequestApplySnapshotChunk
Source§fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self
fn from(apply_snapshot_chunk: ApplySnapshotChunk) -> Self
Source§impl PartialEq for ApplySnapshotChunk
impl PartialEq for ApplySnapshotChunk
Source§impl Protobuf<RequestApplySnapshotChunk> for ApplySnapshotChunk
impl Protobuf<RequestApplySnapshotChunk> for ApplySnapshotChunk
§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
§fn encode_vec(self) -> Vec<u8> ⓘ
fn encode_vec(self) -> Vec<u8> ⓘ
Vec<u8>
.§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
(or equivalent).§fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
Vec<u8>
Protobuf-encoded message.§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
or equivalent.Source§impl Protobuf<RequestApplySnapshotChunk> for ApplySnapshotChunk
impl Protobuf<RequestApplySnapshotChunk> for ApplySnapshotChunk
§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
§fn encode_vec(self) -> Vec<u8> ⓘ
fn encode_vec(self) -> Vec<u8> ⓘ
Vec<u8>
.§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
(or equivalent).§fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
Vec<u8>
Protobuf-encoded message.§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
or equivalent.Source§impl Protobuf<RequestApplySnapshotChunk> for ApplySnapshotChunk
impl Protobuf<RequestApplySnapshotChunk> for ApplySnapshotChunk
§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
§fn encode_vec(self) -> Vec<u8> ⓘ
fn encode_vec(self) -> Vec<u8> ⓘ
Vec<u8>
.§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
(or equivalent).§fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
Vec<u8>
Protobuf-encoded message.§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
or equivalent.