serialization.rs

Overview

This file defines a set of data structures designed to encapsulate serialization-related data for blockchain entities, including accounts, blocks, messages, and transactions. The primary purpose of these structures is to bundle together the core entity data with supplementary metadata such as serialization output (BOC - Bag of Cells), cryptographic proofs, processing statuses, and identifiers. These bundles facilitate consistent handling, transmission, and storage of serialized blockchain objects within the system.


Data Structures

AccountSerializationSet

Represents a serialized account along with associated metadata necessary for blockchain operations and verification.

Fields

Usage Example

let serialized_account = AccountSerializationSet {
    account,
    prev_code_hash: Some(prev_hash),
    boc: account_boc,
    boc1: None,
    proof: Some(proof_data),
    dapp_id: Some(dapp_identifier),
};

BlockSerializationSetFH

Encapsulates a block's serialized data, its identity, and processing status.

Fields

Usage Example

let block_set = BlockSerializationSetFH {
    block,
    id,
    status: BlockProcessingStatus::Processed,
    boc: block_boc,
    file_hash: Some(file_hash),
};

DeletedAccountSerializationSet

Represents metadata for an account that has been deleted from the blockchain state.

Fields

Usage Example

let deleted_account = DeletedAccountSerializationSet {
    account_id,
    prev_code_hash: None,
    workchain_id: -1,
};

MessageSerializationSet

Bundles a message's serialization, identifiers, state, and proof information.

Fields

Usage Example

let message_set = MessageSerializationSet {
    message,
    id,
    block_id: Some(block_id),
    transaction_id: None,
    transaction_now: None,
    status: MessageProcessingStatus::Pending,
    boc: message_boc,
    proof: None,
};

TransactionSerializationSet

Encapsulates serialized transaction data along with its identifiers and processing details.

Fields

Usage Example

let transaction_set = TransactionSerializationSet {
    transaction,
    id,
    status: TransactionProcessingStatus::Confirmed,
    block_id: Some(block_id),
    workchain_id: 0,
    boc: transaction_boc,
    proof: Some(proof_data),
};

Implementation Details


Interaction With Other System Components


Structure Diagram

classDiagram
class AccountSerializationSet {
+account: Account
+prev_code_hash: Option<UInt256>
+boc: Vec<u8>
+boc1: Option<Vec<u8>>
+proof: Option<Vec<u8>>
+dapp_id: Option<UInt256>
}
class BlockSerializationSetFH {
+block: Block
+id: BlockId
+status: BlockProcessingStatus
+boc: Vec<u8>
+file_hash: Option<UInt256>
}
class DeletedAccountSerializationSet {
+account_id: AccountId
+prev_code_hash: Option<UInt256>
+workchain_id: i32
}
class MessageSerializationSet {
+message: Message
+id: MessageId
+block_id: Option<UInt256>
+transaction_id: Option<UInt256>
+transaction_now: Option<u32>
+status: MessageProcessingStatus
+boc: Vec<u8>
+proof: Option<Vec<u8>>
}
class TransactionSerializationSet {
+transaction: Transaction
+id: TransactionId
+status: TransactionProcessingStatus
+block_id: Option<BlockId>
+workchain_id: i32
+boc: Vec<u8>
+proof: Option<Vec<u8>>
}