Infrastructure736 words4 min decode

Neo VM v3.11.2 ships dynamic opcode pricing groundwork for Huyao fork

Neo VM v3.11.2 adds RunStats metering for dynamic opcode pricing ahead of the Huyao fork, aligns reference counting with NeoGo, and fixes SETITEM, locale and memory bugs.

NeoVM v3.11.2 lays groundwork for Huyao dynamic opcode pricing
WitnessNeoVM v3.11.2 lays groundwork for Huyao dynamic opcode pricingBoskampi / pixabay

Outputs

  1. neo-vm v3.11.2 adds RunStats (PR #571), the measurement layer for dynamic opcode pricing tied to the Huyao hard fork.

  2. The Neo Council deferred a 100x execution fee reduction in April until dynamic pricing was in place.

  3. NeoGo merged its own dynamic opcode pricing on Sept. 25 (PR #4087) but has not tagged a release.

  4. Huyao has no activation height on MainNet or TestNet and no release date has been set for Neo core v3.11.0.

  5. The release fixes a SETITEM Buffer bug for values -128 to -1, a locale-dependent minus-sign determinism issue, and a Buffer memory leak.

Neo core developers have released neo-vm v3.11.2, the virtual machine update that installs the measurement machinery for dynamic opcode pricing on the Neo blockchain — the precondition the Neo Council set in April when it deferred a planned 100x reduction in execution fees.

The pricing model was originally tied to the Gorgon hard fork, which activated on MainNet on Aug. 1. The C# pricing code was merged only on Sept. 17, after that activation, so it now takes effect exclusively with Huyao, the next scheduled protocol upgrade. Until Huyao activates, every opcode keeps its current fixed price.

What does RunStats actually measure?

The release adds RunStats, a structure that records what an instruction did as it executes (PR #571). Only opcodes with input-dependent prices, such as PACKMAP, populate it. It carries four values:

  • the type of item the opcode operated on;
  • the number of elements, bytes or slots involved;
  • the net change in the VM's reference count;
  • the number of items cloned.

Under the current model, each opcode costs the same regardless of workload. Under the new model, an instruction's price scales with the work performed — packing a large map costs more than packing a small one. Neo SPCC has stated the design goal plainly: make standard transactions cheaper and malicious ones more expensive.

Architecturally, the split is clean. The VM only collects the figures and hands them to the node after each instruction. The pricing formulas live in the Neo core library (PR #4536) and will replace the fixed price table once Huyao is enabled. Neo SPCC's Tural Devrishev wrote the RunStats change, described in the pull request as a partial port of NeoGo's implementation. NeoGo merged its own dynamic opcode pricing on Sept. 25 (PR #4087) but has not shipped it in a tagged release.

Cross-client determinism work

The VM counts live items on its stacks to enforce maximum stack size, and every Neo node implementation must reach identical results — any divergence between the C# VM and NeoGo's VM can split consensus between the two clients. Several opcodes, including INITSLOT, PACKMAP, UNPACK and SETITEM, previously removed items from the count and immediately re-added them when moving items between the stack and slots, arrays or maps. They now skip that step (PR #575). Storing an item into a slot also follows NeoGo's approach (PR #598).

The update ports NeoGo's remaining reference-counter tests, completing work begun in neo-vm v3.10.0, which switched the C# VM to NeoGo's lighter counter model following NeoGo's own optimizations in March. During review of PR #598, Neo SPCC's Roman Khimov noted the change requires no hard fork because it only affects transactions that fail regardless.

Three further fixes target determinism and hygiene. SETITEM now correctly stores negative values between -128 and -1 into a Buffer (PR #606); a faulty conversion previously failed these transactions even though the values passed the range check, and the C# node retains the old behavior until Huyao activates (PR #4800). Error messages that contracts can catch are now formatted identically across locales (PR #612) — previously, .NET wrote negative numbers with a different minus character on Swedish and Norwegian locales, meaning the same script could produce different bytes on different nodes. Neo core developer Shargon listed that fix among the last security patches ahead of the next core release. The VM also fixes a memory leak in which Buffers borrowed from a shared pool and almost never returned it (PR #603), and tightens jump-target checks during script validation (PR #605).

What changes for developers?

Projects extending the VM face breaking API changes. Opcode handlers and the PostExecuteInstruction method now take a RunStats parameter; custom JumpTable entries and ExecutionEngine subclasses must be updated; and the Buffer constructor no longer accepts a zeroInitialize argument.

The release has no effect on MainNet or TestNet by itself. The latest Neo core release, v3.10.2, still uses neo-vm v3.10.1, and the core library's development branch has not yet adopted v3.11.2. According to the Neo core v3.11.0 release checklist, that version focuses on finalizing Huyao — including dynamic VM instruction prices and a new TemporaryStorage native contract. No release date has been set, and Huyao has no activation height on either network, leaving the 100x fee reduction in the Council's queue with no fixed clock.

via cryptonews.net (Source)

More from Nathan Brooks

Nathan Brooks

Show full bio

Market editor covering money, funding and market shifts around crypto and web3 industry at Mempool Brief.

1,753 articles