Skip to main content

Crate ethexe_common

Crate ethexe_common 

Source
Expand description

§ethexe-common

Shared vocabulary crate for the ethexe execution layer: block model, on-chain events, validator commitments, injected transactions, storage trait abstractions, and protocol constants. It defines shapes and trait interfaces only — the concrete storage backends live in ethexe-db. Being no_std-compatible, it links into both the WASM runtime (ethexe-runtime) and the native node binary.

§Role in the stack

This crate depends on no other ethexe workspace member (it sits on gear-core, gprimitives, and gsigner) and nearly every other ethexe crate depends on it, making it a foundational leaf. For example, ethexe-consensus exchanges consensus::BatchCommitmentValidationRequest / consensus::BatchCommitmentValidationReply messages defined here, and ethexe-db provides backends for the db storage traits declared here.

§Public API

  • consensus — Validation request/reply messages and timeline helpers for the batch commitment protocol.
  • db*StorageRO / *StorageRW trait abstractions and block-metadata types.
  • events — On-chain event model: BlockEvent (Mirror/Router variants) and WVaraEvent.
  • gear — Protocol commitments (gear::BatchCommitment and siblings) and gear::StateTransition.
  • injected — Injected transactions, promises, and receipts for inbound cross-chain messaging.
  • malachite — Sequencer block-payload shape (malachite::Transactions, Transaction).
  • network — Validator network messages (ValidatorMessage and signed/verified variants).
  • ecdsa — secp256k1 re-exports from gsigner.
  • [mock] — Test helpers and proptest fixtures (feature mock).

Flattened crate-root re-exports include HashOf, MaybeHashOf, BlockHeader, SimpleBlockData, BlockData, ValidatorsVec, EmptyValidatorsError, and the gsigner crypto surface (Address, Digest, PublicKey, Signature, SignedData, ToDigest, VerifiedData, …).

Crate-root constants include the per-MB soft execution limits (OUTGOING_MESSAGES_SOFT_LIMIT, OUTGOING_MESSAGES_BYTES_SOFT_LIMIT, CALL_REPLY_SOFT_LIMIT, PROGRAM_MODIFICATIONS_SOFT_LIMIT, MAX_TOUCHED_PROGRAMS_PER_MB) and DEFAULT_BLOCK_GAS_LIMIT.

§Key types

§Invariants

Re-exports§

pub use gear_core;
pub use gprimitives;
pub use k256;
pub use sha3;

Modules§

consensus
db
Common db types and traits.
ecdsa
events
gear
This is supposed to be an exact copy of Gear.sol library.
injected
malachite
Application-level block shape produced by the Malachite sequencer and consumed by the ethexe executor.
network

Structs§

Address
Ethereum address type.
BlockData
BlockHeader
CodeAndId
CodeAndIdUnchecked
CodeBlobInfo
ContractSignature
A recoverable ECDSA signature for a contract-specific digest format (ERC-191).
Digest
Common digest type for the gsigner ecosystem. Presently, it is represented as 32-byte Keccak256 hash. The ToDigest trait is implemented for various types to facilitate hashing and signing.
EmptyValidatorsError
FromActorIdError
HashOf
MaybeHashOf
PrivateKey
secp256k1 private key (ECDSA) backed by sp_core::ecdsa::Pair.
ProtocolTimelines
GearExe network timelines configuration. Parameters fetched the Router contract. This struct stores in the database, because of using in the multiple places.
PublicKey
secp256k1 public key backed by sp_core::ecdsa::Public (compressed form).
Signature
A recoverable ECDSA signature.
SignedData
A signed data structure that contains the data and its signature.
SignedMessage
A signed according to EIP-191 message,that contains the data and its signature. Always valid after construction.
SimpleBlockData
StateHashWithQueueSize
ValidatorsVec
ValidatorsVec is a wrapper over non-empty vector of Address. It is needed because NonEmpty does not implement Encode and Decode.
VerifiedData
A signature verified data structure with the data and recovered public key.

Enums§

PromiseEmissionMode
The PromiseEmissionMode configures the promise emission mode for the ethexe node
PromisePolicy
PromisePolicy tells processor whether should it emits promises or not.

Constants§

CALL_REPLY_SOFT_LIMIT
DEFAULT_BLOCK_GAS_LIMIT
Default block gas limit for the node.
DEFAULT_COMMITMENT_DELAY_LIMIT
Default commitment_delay_limit (in Ethereum blocks). Coordinator-local knob: how many EBs a BatchCommitment stays valid past its target block. Not a protocol constant — every coordinator picks its own value.
MAX_TOUCHED_PROGRAMS_PER_MB
Maximum number of touched programs per MB.
OUTGOING_MESSAGES_BYTES_SOFT_LIMIT
OUTGOING_MESSAGES_SOFT_LIMIT
PROGRAM_MODIFICATIONS_SOFT_LIMIT

Traits§

ToDigest
Trait for hashing types into a Digest using Keccak256.

Functions§

decode_to_array
Decodes hexed string to a byte array.
setup_block_in_db
u64_into_uint48_be_bytes_lossy
Converts u64 to a 48-bit unsigned integer, represented as a byte array in big-endian order.

Type Aliases§

ProgramStates
Rfm
RemoveFromMailbox key; (msgs sources program (mailbox and queue provider), destination user id)
Schedule
Scheduler; (block height, scheduled task)
ScheduledTask
NOTE: generic keys differs to Vara and have been chosen dependent on storage organization of ethexe.
Sd
SendDispatch key; (msgs destinations program (stash and queue provider), message id)
Sum
SendUserMessage key; (msgs sources program (mailbox and stash provider))