Home | About John | Resume/CV | References | Writing | Research |
---|
In this article we review the use of light clients and how they can improve trust and costing for bridges.
Following is a walkthough of a funds transfer from Ethereum to a target chain (In this example Near), complete with light client updates, block propogation and proofs to ensure the transaction validity.
From the diagram above you’ll notice that there are many actors involved, below is an overview of the actors and the operations they perform.
TODO
Here is the storage and compuational costs per component.
Component | Data | Storage | Notes |
---|---|---|---|
Ethereum 2 Client | — | — | — |
Prover | not applicable | 0 bytes | |
DAO Contract |
TODO Review the following data structure and elements and move into the table above commenting on any mandatory requirements and structures that can be improved.
pub struct Eth2Client {
/// If set, only light client updates by the trusted signer will be accepted
trusted_signer: Option<AccountId>,
/// Mask determining all paused functions
paused: Mask,
/// Whether the client validates the updates.
/// Should only be set to `false` for debugging, testing, and diagnostic purposes
validate_updates: bool,
/// Whether the client verifies BLS signatures.
verify_bls_signatures: bool,
/// We store the hashes of the blocks for the past `hashes_gc_threshold` headers.
/// Events that happen past this threshold cannot be verified by the client.
/// It is desirable that this number is larger than 7 days' worth of headers, which is roughly
/// 51k Ethereum blocks. So this number should be 51k in production.
hashes_gc_threshold: u64,
/// Network. e.g. mainnet, kiln
network: Network,
/// Hashes of the finalized execution blocks mapped to their numbers. Stores up to `hashes_gc_threshold` entries.
/// Execution block number -> execution block hash
finalized_execution_blocks: LookupMap<u64, H256>,
/// All unfinalized execution blocks' headers hashes mapped to their `HeaderInfo`.
/// Execution block hash -> ExecutionHeaderInfo object
unfinalized_headers: UnorderedMap<H256, ExecutionHeaderInfo>,
/// `AccountId`s mapped to their number of submitted headers.
/// Submitter account -> Num of submitted headers
submitters: LookupMap<AccountId, u32>,
/// Max number of unfinalized blocks allowed to be stored by one submitter account
/// This value should be at least 32 blocks (1 epoch), but the recommended value is 1024 (32 epochs)
max_submitted_blocks_by_account: u32,
// The minimum balance that should be attached to register a new submitter account
min_storage_balance_for_submitter: Balance,
/// Light client state
finalized_beacon_header: ExtendedBeaconBlockHeader,
finalized_execution_header: LazyOption<ExecutionHeaderInfo>,
current_sync_committee: LazyOption<SyncCommittee>,
next_sync_committee: LazyOption<SyncCommittee>,
}
Explorer and Interactive Links