Crate zksync_basic_types

Source
Expand description

The declaration of the most primitive types used in ZKsync network.

Most of them are just re-exported from the web3 crate.

Re-exports§

pub use ethabi;

Modules§

basic_fri_types
Basic types for FRI prover.
bytecode
Bytecode-related types and utils.
commitment
network
The network where the ZKsync resides.
protocol_version
prover_dal
Types exposed by the prover DAL for general-purpose use.
pubdata_da
Types related to data availability.
secrets
serde_wrappers
Generic serde helpers.
settlement
tee_types
url
vm
Basic VM types that shared widely enough to not put them in the multivm crate.
web3
Selected Web3 types copied from the web3 crate.

Macros§

try_stoppable
Shortcuts both error variants in a Result<_, OrStopped>.

Structs§

AccountTreeId
Account place in the global state tree is uniquely identified by its address. Binary this type is represented by 160 bit big-endian representation of account address.
Bloom
Bloom hash type with 256 bytes (2048 bits) size.
H64
H128
Fixed-size uninterpreted hash type with 16 bytes (128 bits) size.
H160
Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
H256
Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
H512
Fixed-size uninterpreted hash type with 64 bytes (512 bits) size.
H520
L1BatchId
Unique identifier of the L1 batch for provers.
L1BatchNumber
ZKsync L1 batch sequential index.
L1BlockNumber
Ethereum network block sequential index.
L1ChainId
ChainId in the Ethereum network.
L2BlockNumber
ZKsync network block sequential index.
L2ChainId
ChainId in the ZKsync network.
Nonce
ZKsync account nonce.
PriorityOpId
Unique identifier of the priority operation in the ZKsync network.
SLChainId
ChainId of a settlement layer.
StopGuard
Guard allowing to stop blocking operations when dropped.
StopToken
Cloneable token corresponding to a StopGuard. Can be used to check whether the guard is dropped.
U64
Little-endian large integer type Unsigned 64-bit integer.
U128
Little-endian large integer type 128-bit unsigned integer.
U256
Little-endian large integer type 256-bit unsigned integer.

Enums§

BloomInput
OrStopped
Represents an error in a stoppable task: either an internal / fatal error, or a task getting stopped after receiving a stop request.

Traits§

StopContext
Extension trait for Result<_, OrStopped> similar to anyhow::Context.

Functions§

address_to_h256
address_to_u256
ceil_div_u256
Computes ceil(a / b).
h256_to_address
Converts H256 value into an Address.
h256_to_u256
parse_h160
Parses H160 from a slice of bytes.
parse_h256
Parses H256 from a slice of bytes.
parse_h256_opt
Parses H256 from an optional slice of bytes.
u256_to_address
Converts U256 value into an Address.
u256_to_h256

Type Aliases§

Address