Connect
Cover: One question, one producer: the shared-quantity register

One question, one producer: the shared-quantity register

How do you stop two parts of a protocol from silently disagreeing about the same number?

Every quantity used in two places gets the question each consumer asks and a single producer, or a named test that ties the copies. How the register works, and how to count it.

Known formally as One question, one producer in the BlazePhoenix whitepaper.

BlazePhoenix Engineering · article updated 2026-11-16 · site dataset through 2026-11-19 · 7 min · written from the deployed bytecode

By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.

Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص

English — Write the number down once, with the question it answers: every quantity that more than one place produces or consumes goes into a register that names its question and what binds the copies, either a single producer or a named test that asserts the producers agree. This prevents the defect a router is most exposed to, two components answering one question in two frames, such as a preview and a delivery.

Português — Escreva o número uma só vez, com a pergunta a que responde: toda a quantidade que mais de um sítio produz ou consome entra num registo que indica a pergunta e o que liga as cópias, seja um único produtor, seja um teste nomeado que afirma que os produtores concordam. Isto evita o defeito a que um router está mais exposto, dois componentes a responder à mesma pergunta em dois enquadramentos, como uma pré-visualização e uma entrega.

Español — Escribe el número una sola vez, con la pregunta a la que responde: toda cantidad que más de un lugar produce o consume entra en un registro que nombra la pregunta y lo que une las copias, ya sea un único productor o una prueba con nombre que afirma que los productores coinciden. Así se evita el defecto al que más expuesto está un router: dos componentes que responden a la misma pregunta en dos marcos, como una vista previa y una entrega.

Français — Écrivez le nombre une seule fois, avec la question à laquelle il répond : toute quantité que plus d'un endroit produit ou consomme entre dans un registre qui nomme la question et ce qui lie les copies, soit un producteur unique, soit un test nommé qui affirme que les producteurs concordent. Cela évite le défaut auquel un routeur est le plus exposé : deux composants qui répondent à la même question dans deux cadres, comme un aperçu et une livraison.

Deutsch — Schreiben Sie die Zahl nur einmal auf, zusammen mit der Frage, die sie beantwortet: Jede Größe, die an mehr als einer Stelle erzeugt oder verbraucht wird, kommt in ein Register, das die Frage nennt und was die Kopien bindet, entweder ein einziger Produzent oder ein benannter Test, der behauptet, dass die Produzenten übereinstimmen. Das verhindert den Fehler, dem ein Router am stärksten ausgesetzt ist: zwei Komponenten, die dieselbe Frage in zwei Rahmen beantworten, etwa eine Vorschau und eine Lieferung.

Русский — Записывайте число один раз вместе с вопросом, на который оно отвечает: каждая величина, которую производят или потребляют в нескольких местах, попадает в реестр, где названы вопрос и то, что связывает копии: либо единственный производитель, либо именованный тест, утверждающий, что производители согласны. Так предотвращается дефект, которому роутер подвержен больше всего: два компонента отвечают на один вопрос в двух разных рамках, например предпросмотр и доставка.

Türkçe — Sayıyı yanıtladığı soruyla birlikte yalnızca bir kez yazın: birden fazla yerin ürettiği veya tükettiği her nicelik, soruyu ve kopyaları neyin bağladığını (tek bir üretici ya da üreticilerin uyuştuğunu öne süren adlandırılmış bir test) belirten bir kayda girer. Bu, bir router'ın en çok maruz kaldığı kusuru önler: önizleme ile teslimat gibi iki bileşenin aynı soruyu iki ayrı çerçevede yanıtlaması.

العربية — اكتب الرقم مرة واحدة مع السؤال الذي يجيب عنه: كل كمية ينتجها أو يستهلكها أكثر من موضع تدخل في سجل يسمّي السؤال ويحدد ما يربط النسخ، إما منتج واحد وإما اختبار مسمّى يؤكد اتفاق المنتجين. وهذا يمنع العيب الذي يتعرض له الـ router أكثر من غيره: مكوّنان يجيبان عن السؤال نفسه في إطارين مختلفين، مثل المعاينة والتسليم.

हिन्दी — संख्या को केवल एक बार लिखें, उस सवाल के साथ जिसका वह जवाब देती है: जिस मात्रा को एक से ज़्यादा जगहें बनाती या उपयोग करती हैं, वह एक रजिस्टर में जाती है जो सवाल और प्रतियों को जोड़ने वाली चीज़ बताता है, यानी एक अकेला प्रोड्यूसर या एक नामित टेस्ट जो दावा करता है कि प्रोड्यूसर सहमत हैं। इससे वह दोष रुकता है जिसका router को सबसे ज़्यादा ख़तरा है: दो घटक एक ही सवाल का जवाब दो अलग फ़्रेम में देते हैं, जैसे प्रीव्यू और डिलीवरी।

日本語 — 数値は、それが答える問いとともに一度だけ書く。複数の場所が生成または消費するすべての量は、その問いと、コピーを結びつけるもの(単一のプロデューサー、またはプロデューサーが一致することを主張する名前付きテスト)を記すレジスタに入る。これにより、router が最もさらされやすい欠陥、つまりプレビューと実際の受け渡しのように、二つのコンポーネントが同じ問いに二つの異なるフレームで答えてしまう事態を防げる。

中文 — 数字只写一次,并附上它回答的问题:凡是被不止一处生成或使用的量,都要登记到一份登记册中,写明问题以及把各份副本绑在一起的方式,要么是唯一的生产者,要么是一个断言各生产者一致的具名测试。这样可以避免 router 最容易遭遇的缺陷:两个组件在两个不同的框架下回答同一个问题,例如预览与实际交付。

한국어 — 숫자는 그것이 답하는 질문과 함께 한 번만 적습니다. 둘 이상의 곳에서 생성하거나 소비하는 모든 수량은 질문과 사본을 묶는 방식을 명시하는 등록부에 들어가며, 그 방식은 단일 생산자이거나 생산자들이 일치함을 단언하는 이름 있는 테스트입니다. 이렇게 하면 router가 가장 취약한 결함, 곧 미리보기와 실제 전달처럼 두 구성 요소가 같은 질문에 서로 다른 틀에서 답하는 상황을 막을 수 있습니다.

Bahasa Indonesia — Tulis angka itu sekali saja, bersama pertanyaan yang dijawabnya: setiap besaran yang dihasilkan atau digunakan di lebih dari satu tempat masuk ke sebuah register yang menyebut pertanyaannya dan apa yang mengikat salinannya, yaitu satu produsen tunggal atau tes bernama yang menegaskan bahwa para produsen sepakat. Ini mencegah cacat yang paling rentan menimpa router: dua komponen menjawab satu pertanyaan dalam dua kerangka, seperti pratinjau dan pengiriman.

বাংলা — সংখ্যাটি একবারই লিখুন, যে প্রশ্নের উত্তর সেটি দেয় তার সঙ্গে: যে পরিমাণ একাধিক জায়গায় তৈরি বা ব্যবহৃত হয়, তা একটি রেজিস্টারে যায়, যেখানে প্রশ্নটি এবং কপিগুলোকে কী বেঁধে রাখে তা লেখা থাকে, হয় একক প্রোডিউসার, নয়তো একটি নামযুক্ত টেস্ট যা দাবি করে প্রোডিউসাররা একমত। এতে সেই ত্রুটি ঠেকানো যায় যার ঝুঁকি router-এর সবচেয়ে বেশি: দুটি উপাদান একই প্রশ্নের উত্তর দুটি ভিন্ন কাঠামোতে দেয়, যেমন প্রিভিউ আর ডেলিভারি।

Filipino — Isulat nang isang beses lang ang numero, kasama ang tanong na sinasagot nito: ang bawat dami na ginagawa o ginagamit sa higit sa isang lugar ay napupunta sa isang register na pinapangalanan ang tanong at kung ano ang nagbibigkis sa mga kopya, alinman sa iisang producer o sa isang may-pangalang test na nagpapatunay na nagkakasundo ang mga producer. Pinipigilan nito ang depektong pinakamadalas tamaan ang isang router: dalawang component na sumasagot sa iisang tanong sa dalawang magkaibang frame, tulad ng preview at delivery.

The short answer

Write the number down once, with the question it answers. Every quantity that more than one place produces or consumes goes into a register. The register states the question, and says what binds the copies: either one producer with a CI check that forbids a second, or a named test that asserts the producers agree and states what it pins. A CI check then fails the build when a row's test does not actually reach the quantity the row claims to tie.

The failure this prevents

The defect class a router is most exposed to is not a missing check. It is two components answering one question in two frames: a planner and an executor, a preview and a delivery, a quote and a fill. Each answer can be individually right while the pair still disagree, and nothing in either component looks wrong on its own.

The project states the rule in its contributor guide as rule 3, "One question, one producer" (AGENTS.md, lines 20 and 21), and in docs/AUDIT_METHOD.md, section 4, "One question, one answer" (lines 63 to 72).

What a row looks like

The public form of the register is Appendix D of the whitepaper: each quantity, the question it answers, and its producer. A few rows, as published:

QuantityThe question it answersProducer
LEG_FLOOR_BPSHow much may a single leg legitimately lose?Core
hop commitment (the sum of leg inputs)How much does this hop commit to trade?Router, one function
effV2Fee and quoteV3FeeWhat fee does this pool actually charge?Core only
Router balance after settlementWhat may the Router still hold when a swap ends?Every payout of the Router's execute path
PROTOCOL_FEE_BPSHow much does the protocol take?One constant, read by the Router and by the Quoter

Source: Whitepaper 2.4, Appendix D (SHARED_QUANTITIES.md in the DEX repository at 969bcc6)

The two ways to bind a quantity

Single producer: the quantity is derived in one place and imported everywhere else, with a CI guard forbidding a second copy. Nothing can disagree because there is one answer.

Named agreement test: the producers stay, and a named test asserts they agree and states what it pins. The agreement tests are ordinary invariants, which is what makes them checkable. invariant_encodeAgreesWithPreview and invariant_accountingNeverDrifts tie the Quoter's preview to the encoded plan; invariant_Sq_BothSolversAnswerTheSameBytes ties the two solver paths to one answer.

The register grades each row from SINGLE (one producer, nothing to disagree) to PINNED (a named test ties the copies). Only the grading method is published in prose; read each row's status in the repository at the commit you are checking, because a status describes the day it was written.

The totals

The count is taken over the rows of the register at those commits, so it moves when the register does. Check the commit before you compare numbers.

RegisterRowsSectionsCommit
DEX (SHARED_QUANTITIES.md)131Floors and fees; Registry state; Identity and keys; Transient state; Measurement harness969bcc6
Staking (SHARED_QUANTITIES.md)37Rates and utilisation; Curves; Accounting and identityc0366cf

Source: Project facts sheet 2026-11-16; whitepaper 2.4, section 15.10

The boundary, so the rule is not over-applied

Single production is for primitives: a quantity every consumer needs derived from the source. The predicates that decide acceptance keep their redundancy on purpose, because a refusal that two independent checks can each make is stronger than a refusal one check makes. That is the subject of the article on the morphism and the invariant.

Check it yourself

  1. Check out Blaze-Phoenix-Dex at 969bcc6 and open SHARED_QUANTITIES.md. The rule is stated at line 3 and in lines 23 to 25.
  2. Count the rows of the register tables and compare with 131. The five section headings sit at lines 47, 151, 173, 228 and 237.
  3. Run bash .github/scripts/shared-quantities.sh to check that the register agrees with the source tree.
  4. Pick one row and find the test it names. Open it and read which quantity it pins.
  5. Repeat in Blaze-Phoenix-Staking at c0366cf, where the register has 37 rows.

Do not trust this page — reproduce it

Every claim above is checkable against the chain. Start here:

In a clean checkout of Blaze-Phoenix-Dex at 969bcc6: sed -n 1,30p SHARED_QUANTITIES.md (the rule); grep -n -i "Floors and fees|Registry state|Identity and keys|Transient state|Measurement harness" SHARED_QUANTITIES.md (the five sections); bash .github/scripts/shared-quantities.sh (the register agrees with the tree). Same at Blaze-Phoenix-Staking c0366cf for the 37-row register. Whitepaper 2.4: section 2.5 and Appendix D.
Cite this article

Licensed CC BY-NC-ND 4.0: quote and cite it with attribution and a link. Commercial use and derivative versions need written permission from BlazePhoenix; translations are made by BlazePhoenix. Copy a ready-made citation:

BlazePhoenix (2026). One question, one producer: the shared-quantity register. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/one-question-one-producer/
@misc{blazephoenix_one_question_one_producer,
  title  = {One question, one producer: the shared-quantity register},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/learn/one-question-one-producer/},
  note   = {Accessed: reproduce the claim with the command above}
}

Writing an answer, a wiki entry or a paper? The claim above is reproducible against the chain before you quote it — which is the only sound basis for citing a technical source at all.

Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF).

Related engineering

Next in Architecture · 3 / 20
A morphism is not an invariant: unify the read, never the gate ›Collapsing venue diversity into one pricing morphism shrinks the code, but it does not remove verification. Where the unification stops, and why a coincidence is pinned, not merged.7 min

Questions, a partnership or a bug to report? Contact us or email contact@blazephoenix.xyz

Go to APP