Polkadot's JAM
Polkadot Virtual Machine (PVM)
The PVM is based on the RISC-V Instruction Set Architecture (ISA), valued for its simplicity and flexibility. RISC-V offers several benefits:
- Easily transpiled into common hardware formats such as x86, x64, and ARM.
- Strong support from tools like LLVM.
The PVM emphasizes simplicity and security, being sandboxable and providing various execution guarantees. It is deterministic, consensus-sensitive, and friendly to metering, avoiding the complexity found in other VMs.
Advantages over WASM:
- WASM, while optimized for web use, struggles with stack management and continuations.
- RISC-V places the stack in memory, handling continuations naturally without extra complexity.
- PVM achieves excellent execution speeds on conventional hardware (x64 and ARM), offering advantages like free metering compared to WASM.
RISC-V-enabled Continuations:
- Facilitates scalable coding on multi-core platforms like JAM.
- Asynchronous, parallelized architectures are crucial for scalability in hardware, software, blockchain, and consensus algorithms.
SAFROLE
SAFROLE is a simplified block production algorithm derived from SASSAFRAS. It:
- Is minimally opinionated to maximize potential future use cases.
- Aims to follow the Ethereum yellow paper model for wide implementation and expertise dissemination.
SAFROLE Features:
- SNARK-based, offering constant-time block production and near fork-free operation.
- Anonymity ensures the security of block production, preventing spam.
Networking
JAM uses the QUIC protocol, enabling direct connections between validators. This avoids gossip protocols as JAM doesn't handle transactions. Grid-diffusal is used for broader distribution, arranging validators in a grid for efficient package delivery.
Efficient Block Processing
JAM adopts a unique approach by placing the prior state root in the block header, allowing:
- Lightweight computations (5% of the block's workload) to be executed immediately.
- The remaining 95% of computations to be completed afterward.
- More efficient use of block time, improving computation time significantly over traditional setups.
Architectural Differences: JAM vs. Relay Chain
JAM fixes more functionality elements compared to the relay chain, making upgrades challenging but optimizing performance. Key differences include:
- Fixed parameters enable network topology and timing optimizations.
- Flexibility in application-level functionalities like coretime sales, staking, and governance managed within services.
- A non-upgradable chain reduces complexity.
JAM Toaster
A comprehensive test environment designed for large-scale trials and performance assessments of JAM, addressing challenges in understanding network dynamics at scale.
JAM and Substrate
Benchmarks vs. Metering:
- JAM's metered system can often replace frequent benchmarking.
- Benchmarking remains relevant for performance enhancements and tasks requiring extended execution times.
Cross-Chain Message Passing (XCMP)
JAM mandates full XCMP support for efficient data transmission between parachains, overcoming limitations of HRMP.
Accords
Accords are multi-instance smart contracts enabling direct, trustless interactions between parachains, enhancing token transfers and message integrity.
Enhancements and Compatibility in JAM
JAM maintains compatibility with Polkadot 1 parachains while introducing significant enhancements:
- Streamlined benchmarking.
- Multi-instance accords for governing parachain interactions.
- Full XCMP support.
- Agile Coretime targeting for efficient resource allocation.