chain-v1.0.0 — Stateless Execution (Hyperpaper Full Compliance)
Release v0.3.0 — Stateless Execution (Hyperpaper Full Compliance)
Changelog
Critical Bug Fixes
- FFI return code (compositor_verify): Rust FFI returns 1=valid, 0=invalid, -1=error. Previous code checked
result != 0which rejected all valid Groth16 proofs. Fixed to proper 3-way switch. - Double gas deduction in nanochain EVM:
executeAccountTxdeducted gas before callingApplyMessage, which also deducts gas internally. Sender was charged 2x. Fixed by lettingApplyMessagehandle all gas accounting.
Phase 1 — Wire Existing Components
- 1.1 BeaconProofVerifier wired into
FinalizeBeaconBlock(fail-closed proof verification) - 1.2 DAPBeaconIntegration wired from consensus into beacon chain (DA-enforced finalization)
- 1.3 Fullnode block execution on sync —
executeBlockTransactionsafterInsertBlockbuilds state trie for RPC queries (eth_getBalance,eth_call,eth_getTransactionReceipt) - 1.4 State root verification — computed root compared against header root
Phase 2 — Stateless Execution (Core Innovation)
- 2.1 Per-tx Verkle witness fields on
ProofCarryingTx(TxStateWitness,StateDiff) - 2.2 Stateless fast path —
verifyAndApplyStateDiffskips EVM when witness is valid - 2.3 Block-level StateWitness generation — proposer generates Verkle multiproof after execution
- 2.4 Non-proposer O(1) validation —
ValidateBlockStatelessverifies aggregated proof + witness
Phase 3 — Full O(1) Verification
- 3.1 Beacon O(1) finalization — single Groth16
CompositionProofpairing check per beacon block - 3.2 Fullnode O(1) sync path — witness-based verification replaces full EVM re-execution
- 3.3 Light client P2P messages —
GetStateWitness,GetShardProof,GetCompositionProofwith real data handlers
Nanochain Engine Architecture
- NanochainEngine interface bridges
ParallelBlockProducer→sharding.Nanochain - Full pipeline: EVM execution → proof verification → SnarkPack aggregation → witness generation → DA certification → beacon submission
- Real
sharding.Nanochaininstances created fromserver.gowith chainConfig, VerkleDB, ProofFabric EnableNanochains=truefor ALL memory tiers (was >= 16 CPU cores only)EnableDA=trueinDefaultConfig(was false)
Full EVM in Nanochains
executeAccountTxEVMusesgethcore.ApplyMessagefor contract creation and calls- Init code properly executed to produce runtime bytecode (was storing init code directly)
- Gas accounting, EIP-2929 access lists, snapshot/revert
Patricia-to-Verkle Migration
SupportsMigration()returnstrue(Verkle-native import path)MigrateAccount()acceptsMigrationAccount(nonce/balance/code/storage) and inserts into Verkle tree
Compositor Structural Fallback
compositor_nocgo.gonow performs SHA-256 binary Merkle tree composition and structural verification (was returningErrCompositorNotReady)IsReady()returnstrue— graceful degradation without CGO
RPC API
hyperspace_sendProofCarryingTransaction— submit PCTs with proofs, witnesses, and state diffshyperspace_getStateWitness— query account state for Merkle witness construction
Dockerfile
- Updated for CGO build:
CGO_ENABLED=1,-tags compositor,jolt_prover - Rust .so libraries copied into runtime image
- Enables real Groth16/Jolt proof generation and verification
E2E Integration Tests (5 tests, all passing)
TestE2E_TransactionLifecycle— tx → pool → build → execute → witnessTestE2E_ProofCarryingTransaction— PCT → proof verification → aggregation → receiptsTestE2E_StatelessValidation— O(1) block validation via StatelessValidatorTestE2E_NanochainEngineInterface— ProduceAndSubmitBlock, SubmitTransaction, QueueLengthTestE2E_TxStateWitnessRLP— roundtrip encoding with witnesses and state diffs
Files Changed (22 files)
| File | Change |
|---|---|
beacon/beacon_chain.go |
Wire proof verification + O(1) composition + light client proof serving |
cmd/server.go |
Nanochain engine creation, chainConfig wiring, beacon provider |
core/types/proof_carrying_tx.go |
TxStateWitness, StateDiff, RLP V2, Len() |
consensus/narwhaltusk/nanochain_coordinator.go |
NanochainEngine interface, SubmitProofCarryingTx |
consensus/narwhaltusk/types.go |
EnableDA=true, EnableNanochains=true all tiers |
jsonrpc/hyperspace_endpoint.go |
PCT submission + state witness RPC endpoints |
network/encoding.go |
Light client message encoding/decoding |
network/protocol.go |
Light client P2P message types |
network/sync.go |
Fullnode execution, light client handlers, BeaconBlockProvider |
prooffabric/compositor_cgo.go |
Fix FFI return code, add mutex to verify |
prooffabric/compositor_nocgo.go |
Structural fallback (SHA-256 Merkle tree) |
sharding/nanochain.go |
Full EVM, stateless fast path, witness gen, NanochainEngine impl |
sharding/stateless_validator.go |
O(1) ValidateBlockStateless, proof aggregator |