pchain-runtime

Crates.iopchain-runtime
lib.rspchain-runtime
version0.4.3
sourcesrc
created_at2024-04-26 11:38:34.594293
updated_at2024-04-26 11:38:34.594293
descriptionparallelchain-runtime: ParallelChain Mainnet Runtime for state transition in ParallelChain Mainnet
homepage
repositoryhttps://github.com/parallelchain-io/pchain-runtime
max_upload_size
id1221336
size737,017
ParallelChain Lab (parallelchainlab)

documentation

README

ParallelChain Runtime

ParallelChain Runtime is a State Transition Function to transit from an input state of the blockchain to next state. It is also the sole system component to handle Smart Contract that is primarily built from Rust code by using ParallelChain F Smart Contract Development Kit (SDK).

f(WS, BD, TX) -> (WS', R)

WS = World state represented by set of key-value pairs
BD = Blockchain Data
TX = Transaction, which is essentially a sequence of Commands
R = Receipt, which is a sequence of Command Receipts correspondingly.

Compatibility

The current version of this library (pchain-runtime v0.4.x) implements the Transition V1 function as specified in v0.4 of the ParallelChain Protocol.

Repository Structure

Major modules of this repository are organized as following:

Execution:

  • transition: Entry point of state transition function.
  • execution: Implementation of execution process.
  • wasmer: Implementation of components to use wasmer as Smart Contract Execution Runtime.
  • contract: Implementation of components related Smart Contract, such as instantiation, host/guess function interface, etc.

Types and Data Model:

  • types: General data types used in Runtime.
  • read_write_set: Implementation of data read-write operations to World State.

Constants:

  • formulas: General constants and equations used in Runtime.
  • gas: Specific to gas calculation functions and constants.

Further reading

High level description on implementation of pchain-runtime can refer to ParallelChain Protocol.

Data types related to blockchain that are frequently used can be found on the crate ParallelChain Types.

Blockchain State model (World State) can refer to the crate ParallelChain World State.

The mentioned Smart Contract Development Kit can refer to the crate ParallelChain Smart Contract SDK.

Opening an issue

Open an issue in GitHub if you:

  1. Have a feature request / feature idea,
  2. Have any questions (particularly software related questions),
  3. Think you may have discovered a bug.

Please try to label your issues appropriately.

Commit count: 66

cargo fmt