Commit graph

3 commits

Author SHA256 Message Date
015e521ae2 feat(consensus): slashing, ValidatorState, scheduler auto-tx, NodeApprove/Reject execution 2026-04-24 14:14:55 +03:00
2c6db93043 feat(vm): implement NodeSubmit, VoteRegister, VoteCast, StakeOp execution 2026-04-24 11:30:05 +03:00
265097375a feat(nu-node): single-validator block production loop
- nu-vm/engine.rs: execute_block runs all txs in a block against StateDb;
  TokenTransfer fully applied, other variants return "not implemented" receipt
- StateAccessor trait: set_balance/inc_nonce now take &self (RocksDB interior mutability)
- src/block_loop.rs: tokio task that produces a block each slot (6s) in dev mode;
  drains mempool, executes txs, removes successful ones, persists block to RocksDB
- StateDb wrapped in Arc<Mutex> — block loop holds write lock per block, RPC holds
  read lock for nu_getAccount
- main.rs: spawns block_loop when --dev --validator flags are set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 10:54:48 +03:00