pub struct BigBang {
pub block_state: PredicateAddress,
pub contract_registry: PredicateAddress,
pub program_registry: PredicateAddress,
pub solution_set: SolutionSet,
}Expand description
Describes how to construct the big-bang (aka “genesis”) block.
Fields§
§block_state: PredicateAddressThe address of the contract used to track block state.
This contract includes special keys for the block number and block timestamp. E.g.
[0]is the key for the block number, which is aWord.[1]is the key for the block timestamp, which is aWordfor seconds sinceUNIX_EPOCH.
contract_registry: PredicateAddressThe address of the contract used to register contracts and their associated predicates.
There are two primary regions of storage for the contract registry. The layout can be thought of as the following.
storage {
contracts: (b256 => Contract),
predicates: (b256 => Predicate),
}contractshave key prefix[0]predicateshave key prefix[1]
§Contracts
Contract entries contain the salt and the addresses of its predicates. E.g.
[0, <contract-ca>, 0]is the key to the “salt”, ab256.[0, <contract-ca>, <predicate-ca>]is a key whose non-empty value specifies that the predicate with the given address is associated with the contract.
§Predicates
Predicate entries contain their length in bytes as a Word and their fully byte-encoded
form within a int[] with padding in the final word if necessary. E.g.
[1, <predicate-ca>]to get the length bytes asWordfollowed by the fully encoded word-padded data asint[].
program_registry: PredicateAddressThe address of the contract used to register programs.
storage {
programs: (b256 => Program),
}§Programs
Program entries contain their length in bytes as a Word and their bytecode within a
int[] with padding in the final word if necessary. E.g.
[0, <program-ca>]to get the bytecode length asWordfollowed by the bytecode asint[].
solution_set: SolutionSetThe SolutionSet used to initialize arbitrary state for the big bang block.
The primary purpose is setting the initial block state and registering the big bang contracts.
If constructing a custom BigBang configuration, care must be taken to ensure that this
SolutionSet does actually register the aforementioned contracts correctly.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BigBang
impl<'de> Deserialize<'de> for BigBang
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Ord for BigBang
impl Ord for BigBang
Source§impl PartialOrd for BigBang
impl PartialOrd for BigBang
impl Eq for BigBang
impl StructuralPartialEq for BigBang
Auto Trait Implementations§
impl Freeze for BigBang
impl RefUnwindSafe for BigBang
impl Send for BigBang
impl Sync for BigBang
impl Unpin for BigBang
impl UnwindSafe for BigBang
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.