# Changelog — nu-node All notable changes to this project will be documented in this file. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) --- ## [Unreleased] ## [0.3.0] — 2026-04-24 ### Added - `nu-vm/executor.rs` — `execute_node_submit`: validates entry fee (25 NUT), creates `StoryNodeState { Pending }` in RocksDB indexed by `temp_id` - `nu-vm/executor.rs` — `execute_vote_register`: validates node is `VotingOpen`, locks 10 NUT stake until vote end - `nu-vm/executor.rs` — `execute_vote_cast`: computes weight as `√(staked) × pon_score`, appends `WeightedVote` to node - `nu-vm/executor.rs` — `execute_stake_op`: stake/unstake with balance and staked field updates - `nu-state/accessor.rs` — `StateAccessor` extended with `get_account/set_account`, `get_node/get_node_by_temp/set_node`, `lock_stake/unlock_stake/add_nft/record_vote` - `nu-rpc/handlers.rs` — `nu_getBlock`: reads `"block:{height}"` from RocksDB, returns serialized `Block` or null - `nu-vm/rewards.rs` — `SHELL_PER_NUT = 1_000`, `NUT_PER_NU = 100`, `NODE_REWARD_NUT = 100` constants; currency hierarchy Shell → NUT → NU ## [0.2.0] — 2026-04-24 ### Added - `nu-vm/engine.rs` — `execute_block`: runs all txs in a block against `StateDb`; `TokenTransfer` fully applied, other variants produce a "not implemented" receipt - `src/block_loop.rs` — tokio task producing one block per slot (6 s) in dev mode; drains mempool, executes txs, removes successful ones, persists block to RocksDB - `--dev --validator` flags in `main.rs` trigger block production loop on startup ### Changed - `StateAccessor` trait: `set_balance` / `inc_nonce` now take `&self` (RocksDB provides interior mutability — no `&mut` required at the Rust level) - `StateDb` wrapped in `Arc>` — block loop holds write lock per block, RPC holds read lock for `nu_getAccount` - `nu-vm` now depends on `nu-block` (was implicit via engine) ## [0.1.0] — 2026-04-24 ### Added - `nu_sendRawTx` — decodes JSON `RawTransaction`, deduplicates by `tx_id`, inserts into mempool; returns `{ tx_id }` on success - `TxPayload` enum in `nu-block/types.rs` — all variants with `priority_hint()` - `TxPriority` derived from `TxPayload` in `nu-mempool` (Critical > High > Normal) - `nu-rpc` axum HTTP server on `POST /rpc` — dispatches JSON-RPC 2.0 requests - `nu_chainInfo` — returns `chain_id` and `node_version` - `nu_getAccount` — reads `AccountState` from RocksDB; returns empty account for unknown addresses (zero balance, nonce 0) - `StateAccessor` trait implemented on `StateDb` — canonical single source of truth for balance and nonce access - `--dev`, `--validator`, `--rpc-addr`, `--db-path`, `--chain-id` CLI flags via clap - Rust workspace scaffold with six crates: `nu-consensus`, `nu-mempool`, `nu-state`, `nu-block`, `nu-rpc`, `nu-vm` - `Dockerfile.dev` — multi-stage Rust build (builder: rust:1.79-slim, runtime: debian:bookworm-slim)