QuipNetwork / QuipNetwork/quip-validator
quantum-compute-mempool: claim_reward pays frozen ranking, not current OrderSolutions; runtime VM is NoOpVm
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.6k
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Title: quantum-compute-mempool: claim_reward pays frozen ranking, not current OrderSolutions; runtime VM is NoOpVm
Summary
Submitted spins are re-scored with energy_of_solution_indexed at submit time, so a solver cannot invent an energy number on first submit.
Two gaps:
-
Bait-and-switch.
OrderSolutionsis replaced on everysubmit_solution. Ranking (OrderFrontRunner/OrderTopSolvers) is monotonically improved and is not recomputed from storage at claim. A solver can submit a strong solution, wait until rivals cannot beat the deadline, then overwriteOrderSolutionswith garbage.claim_rewardstill pays the old energy. -
NoOp VM. Job specs may carry
validation_program/transform_program. Production runtime wirestype VM = NoOpVm: transform is identity,validate_resultalwaysOk(()). Those hashes are never executed.MinerTypeis self-asserted;register_solverhas no deposit.
Impact
A registered solver can collect a proposer's full reward for a score that no longer matches the stored artefact. Overlay (2) is an acknowledged v0 shim. Overlay (1) is a logic bug even with NoOpVm.
Toy: pot 100, SingleBest. Attacker submits energy -1000, becomes front-runner. Near expiry, resubmits junk. Leaderboard still says -1000. claim_reward pays 100. Stored solutions no longer match the paid energy.
Suggested fix
- On resubmit, either forbid overwrite or re-rank from the new energy (including demotion).
- At
claim_reward, re-scoreOrderSolutionsand pay that, or freeze the winning payload in a separate map at first ranking. - Wire a real
QuantumVmthat runs the referenced programs, or drop the program fields until then. - Treat
MinerTypeas untrusted for Bid mode.
Files
quip-validator/pallets/quantum-compute-mempool/src/lib.rs(OrderSolutionsoverwrite,claim_reward)quip-validator/pallets/quantum-compute-mempool/src/xqvm.rs(NoOpVm)quip-validator/runtime/src/configs/mod.rs(type VM = NoOpVm)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in quip-validator/pallets/quantum-compute-mempool/src/lib.rs by tracing OrderSolutions updates through submit_solution and claim_reward. Then inspect xqvm.rs and runtime/src/configs/mod.rs to confirm how NoOpVm is wired. Done means the paid reward matches the winning stored artefact and the validation-program behavior is explicitly addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100