mirror of
https://github.com/lux-cpp/consensus.git
synced 2026-10-30 18:14:55 +00:00
The vote message had three homes and no shared vector: Go's encoder, this one, and whatever Rust will grow. Drift had already happened and nothing detected it — both sides pass their own tests and reject each other's votes in production. The fix that makes it structurally impossible is a corpus generated FROM Go and loaded by every implementation, which is what luxfi/conformance's README already claims consensus2 carries. scripts/oracle reads the values out of the running Go implementation — the message from chain.CanonicalVoteMessage, the signature from bls.Sign, the floors from config, the committee thresholds from engine/chain — and writes four files. test/conformance_test.cpp re-derives each in C++ and demands byte equality. The harness asserts nothing of its own; if Go's encoder changes, the corpus changes and the harness fails, which is the point. A vector nobody can regenerate is a snapshot of a belief. 163 checks, including the 226-byte message for a fully-populated position, for the canonical-to-transport degrade and for the zero position, and byte-identical BLS signatures for real keys. The signature rows also sign through the reused eth2 POP surface and assert the result differs and that the consensus domain rejects it — the trap that cost the two implementations their interoperability, held in place. The corpus schema is an array of flat objects whose values are strings, numbers or booleans, so the reader is 70 lines and needs no dependency; it rejects anything nested rather than skipping it, and keeps values as literal text so a uint64 near MaxUint64 never goes through a double. -DCONFORMANCE_DIR points it at another checkout when the corpus moves to luxfi/conformance. tier_test covers the second rung the gate grew: Nova ignites where Quasar does not, a Nova cert relabelled Quasar dies on the two-thirds clause, relabelling downward only under-claims, and a single validator holding a stake majority still cannot self-ignite because the signer floor is an independent predicate. The test list is now one list and one loop. It was nine copies of the same four-line block plus a hand-maintained second list for the sanitizer, which had to be edited in two places for every new test. 11/11 green, clean build, zero warnings.
24 lines
2.6 KiB
JSON
24 lines
2.6 KiB
JSON
[
|
|
{
|
|
"message": "4c55582f636861696e2f766f74652f76320000030101c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1000000000000002a0000000104cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca05cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb06e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e50770707070707070707070707070707070707070707070707070707070707070085555555555555555555555555555555555555555555555555555555555555501",
|
|
"name": "vote_sig/0",
|
|
"pk": "8a2e0b6d6266112d59aafa4f546169236a6ef8dc075f66e57bdbd83ab016952b25136bf18d78a21586bd18d5708a917f",
|
|
"sig": "9773e2d7d82913d6aae708aa53c9c0046fd6ef3787cf87db7ef99e0bd98a5ee32a8d1266410fb12eaf8f9c1b91ba1ae6072b289d86df01d8aa583104b2e7134d534edc332fa2c603bf060395cf49f934fa84a98f69199adfa9abab3627dc255d",
|
|
"sk": "01a4a7a6a1a0a3a2adacafaea9a8abaab5b4b7b6b1b0b3b2bdbcbfbeb9b8bbba"
|
|
},
|
|
{
|
|
"message": "4c55582f636861696e2f766f74652f76320000030101c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1000000000000002a0000000104cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca05cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb06e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e50770707070707070707070707070707070707070707070707070707070707070085555555555555555555555555555555555555555555555555555555555555501",
|
|
"name": "vote_sig/1",
|
|
"pk": "b3c2898fb5f2c8b5baf8c234750922178d6978d3142652d4ddd31a9143c311a6f581e74982aaa034df4e5601b69aa2b1",
|
|
"sig": "b4cb9fd42794b5f15e3e9af4e440856e2abd34fb83ab61f1beac4bd2c92646fd2c6de53213430e89c112ca697fc08ec50568a312ac342601c191b5fdcd19231db829516b23aa8db3a47f4728a914d421bae95d564cb42c2de5b7254636dc1d23",
|
|
"sk": "0285848786818083828d8c8f8e89888b8a95949796919093929d9c9f9e99989b"
|
|
},
|
|
{
|
|
"message": "4c55582f636861696e2f766f74652f76320000030101c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1000000000000002a0000000104cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca05cbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb06e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e50770707070707070707070707070707070707070707070707070707070707070085555555555555555555555555555555555555555555555555555555555555501",
|
|
"name": "vote_sig/2",
|
|
"pk": "82c46f086e2d25edb8a2cc7db3b6ce4e1d7195d16c7e2d09780d0a39415cd414b71f138ac1316fc983d90169ee27a351",
|
|
"sig": "a8bfd3776a23d0f820084bab3799be599b273ccf37f64a32983b38aff051d1433932af02c4d1e7500ba027fe840979ed000f9a032aa5ba15bc15b8783de5ad9ce088cc0f7946a057b235320e3414809a0498dfdd43e7a6470dd8ba2db221f382",
|
|
"sk": "039ae5e4e7e6e1e0e3e2edecefeee9e8ebeaf5f4f7f6f1f0f3f2fdfcfffef9f8"
|
|
}
|
|
]
|