RequantTESTNET
Requant research

Real Requant blocks in the lab

A model can drift from the code it describes. Requant Lab closes that gap for Requant in two ways: the model's difficulty rule is checked against Requant's consensus bit for bit, and a protocol mode replaces the model's blocks with real Requant regtest blocks that every simulated node checks with Requant's own code.

The adapter

  • Requant's consensus at a pinned commit. The adapter builds requant-consensus from requant-network/requant at a9ce4d0 in a separate workspace with its own lock file; the lab's core engine is built without Requant. Moving the pin is a new adapter version and a new run of all its checks.
  • A node is a real chain with its own clock. Each simulated node keeps an upstream Chain. A block reaches it through the full Chain::accept(block, now), where now is the virtual time plus that node's clock skew; no shortcut that skips validation is used.
  • Blocks are built the way the node builds them. A found block is made from the upstream template on the branch it extends, and a real TNet claim is searched with that branch's epoch weights. The nonce search starts at zero, so a run repeats bit for bit.

Who decides what

PartDecided by
When a block is found, by whom, on which parentThe lab's engine: exponential waiting time by power and target, pool work, delays
Delivery, partitions, outages, noise, queues, ancestor requestsThe lab's engine, as in the model
Block contents, claim, target, reward, development fund, epochThe adapter, from the upstream template on the real branch
Accept or reject a block, and whyThe node's real Chain, by its own clock
Which block is the node's tipThe node's real Chain; the engine follows its choice

Coverage

AreaProtocol mode (regtest)Lab model
Difficultyexact: upstream next_target inside Chain::acceptasert-v1 equals upstream on whole seconds; the model counts microseconds
Reward, fund, issuanceexact: reward, fund share, issuance by branchmodeled: a fixed reward, no Requant schedule
Proof of workexact: real TNet claims of the reduced regtest profilemodeled: a probabilistic search
Fork choiceexact: each Chain chooses its own branchmodeled: most work
Timestampsexact: median of past and the +7200 s limit by the node's clockthe block's time is the exact time of the find
Transactions and mempoolexact: real signed transfers with UTXOs, change and fees through each node's upstream Mempoolmodeled: a flow with sizes and fees, no signatures or UTXOs
Peer-to-peer and syncmodeled: by the lab's enginemodeled
Reorganisation policyexact: set_max_reorg and min_chain_worknot modeled
Epochsexact: epoch_seed along its own branch, regtest 16/4not modeled

Checks

  • ASERT, model against upstream. For the test and regtest networks, seven heights from 0 to 4·10⁹ and more than 500 offsets from the schedule (fractions of a period, the network's limit above, a shift of more than 1024 periods below), the model's next target equals Requant's. Anchor: the genesis target; interval 60 s; half-life 7200 s.
  • R01, clocks. A block stamped 7300 s ahead is rejected by both nodes; a node with a correct clock accepts it 100 s later, a node three hours behind only when its clock reaches the stamp. A corrupted claim is rejected.
  • R02, epochs. Branches that split before the anchor of epoch 1 have different epoch-1 seeds and a common epoch-0 seed; after they join, a node moves to the branch with more work.
  • R03, issuance. Each coinbase pays the reward of its own branch's issuance and the fund share by height; after a reorganisation both nodes report the issuance of the new branch.
  • R04, reorganisation limit. The same deep fork is rejected by a synchronized node with a limit of 3 and accepted by a node that has not reached the minimum chain work.

Reference scenarios

  • R01, partition and recovery: the network splits, both sides mine real blocks, and after healing the nodes converge with real rejections and reorganisations.
  • R02, node clocks and the reorganisation limit: a node whose clock runs ahead, and max_reorg per node.
  • R03, transactions: real signed transfers that enter through chosen nodes and pass the nodes' mempools.

They open in the lab's TOML editor and run on the server; the browser does not compute protocol mode.

Calibration

The adapter can measure how fast a machine searches TNet tickets the way a real miner does, so a measured rate can be used as the model's power.

Machine, one coreregtest (n 256, 4 layers), tickets/stest (TNet v1, n 8192, 8 layers), tickets/sA test block at genesis difficulty (2^27 tickets)
AMD Ryzen 7 8745HS20,5301,218about 30.6 h
AMD EPYC 9654, one-core service limit, 2 GiB12,848967about 38.5 h

That is why real claims are searched for regtest only: a block of the full test profile takes more than a day on one CPU core. The rules of test are checked where it is cheap, as with ASERT above. In the protocol mode one real regtest block takes 13-20 ms.

Boundaries

  • The node runtime is not run. In Requant's node, time comes from the operating system and networking and the mempool live in the node's process; in the lab, delivery is the engine's. There is no connection to live peers, wallets or the test network.
  • The pin predates later releases. Rules added after commit a9ce4d0, including node 0.18.0's relative difficulty from testnet height 8020, are not covered until the pin moves.
  • Regtest, not test. Proof-of-work work in protocol mode is the reduced regtest profile; it shows the rules, not mining costs.