diff --git a/docs/bench-log.md b/docs/bench-log.md index 6990a2a8..3bb87466 100644 --- a/docs/bench-log.md +++ b/docs/bench-log.md @@ -1373,5 +1373,6 @@ Proving v0 activated at DAA 84,100 (manifest `consensus.override`, every node re | Paid shards by 10:53 UTC (Mac node `igneum_getProvingStatus`) | 3 shards, 3.370437410 IGN in total, pool balance 68,601.72 IGN | | Pool at that moment | 4 entries: 3 pending, 1 failed verification, 0 verified-and-waiting | | Non-empty shards | not yet: the exporter's post-root assertion fires on blocks with content (58,584 to 58,984 on 5 October); investigation open | +| The assertion, explained (12:30 UTC, branch prover-match) | Not block content. Every block it fired on is empty (PC 2's export logs: 58,752 to 58,843 hit the assertion; 58,584 to 58,740 hit the backslash path of 6d51e53), one reward plus the pool credit, no transactions, no payouts. PC 2's exporter was a stale build: the panic names shard.rs:175, the line before commit 1251f0a moved the assert to 179, and that core's planner gave an empty segment the pre-root as its post-root while the statement applied the rewards (left = the node's root after the rewards, right = the root before them, as the log shows for 58,752). The core at master reproduces 58,927 and 59,192 with the node's roots, and the same shape (59,507: one reward to the same miner) was proven and paid after the 10:49 and 10:52 UTC rebuilds on PC 2. Branch prover-match: fixture `block-58927-empty-reward.json`, `export/tests/fixtures.rs` (every fixture reproduces; an empty segment ends at the root after the rewards), and a source stamp on the first line of the exporter and the host so a stale binary names itself. The guest is untouched: built in one directory, master and the branch give byte-identical loadable segments for the shard program and the aggregator (shard program id 0x1ec8b941 at master in that directory). Noted on the way: the same sources built in three directories on this Mac gave two different guest ELFs (text segment c173b3de in the main checkout and in a fresh worktree, 830f7433 in the branch's worktree, shard program id 0x366e2aca there), so the program id is not yet a pure function of the sources on a native build; SP1's docker build is the reproducible path and is not in use. Open item. | Commands: `curl -X POST http://127.0.0.1:26800 -d '{"jsonrpc":"2.0","id":1,"method":"igneum_getProvingStatus","params":[]}'` on the Mac; `node tools/logs.mjs` for PC 2's prover lines (`prover: block N shard 0 assigned to win-1ccfe586-1-1: export, cut, prove (CUDA), sign, submit`). diff --git a/proving/fixtures/block-58927-empty-reward.json b/proving/fixtures/block-58927-empty-reward.json new file mode 100644 index 00000000..f3cd3388 --- /dev/null +++ b/proving/fixtures/block-58927-empty-reward.json @@ -0,0 +1,1170 @@ +{ + "format": "igneum-prove-fixture-v1", + "source": "devnet, 5 October 2026: igneum_exportSegments 0x0..0xe738 from the Mac node (fork 2b6d23ef), block 58927, the shape PC 2's stale exporter failed on (one blue block, reward to 0x4d7c0d6f, pool credit, no transactions, no payouts)", + "block": { + "chain_id": 4463, + "env": { + "number": 58927, + "hash": "0x272a99725fa79fdc631d1ff4b1978a26ad49fb5cf226b558561a35579c836996", + "parent_hash": "0x12b8bcc3ef4273246806645111a958f4d87fca265f217cf5a9a79135373c495a", + "timestamp": 1791196794, + "miner": "0x4d7c0d6f3ad5466691649e98ebb59cd5b5194687", + "prevrandao": "0x680f1c3326fa4b2c6565d856820bb16044a70dacf44266b0bb5de80f18b7b11f", + "base_fee_exec": 1000000000, + "base_fee_proving": 1000000000 + }, + "block_hashes": [ + [ + 58671, + "0xcd41c53bc03066cebf88c7ace437e472ab04ecb9e6fc6df1d4d2a4251d81a19c" + ], + [ + 58672, + "0x88a903bcaa3a910d940350218cbba10419f07a8d481e13122fecdd9039aef064" + ], + [ + 58673, + "0x14562af16b786d07f294ad5c1dc7a2b4883b092563762a08583dbac4d4706108" + ], + [ + 58674, + "0x1ef706ef4c1f2ee3e6c226ad7f6e1008df9b2f652aecd482e3516f3dad579b6f" + ], + [ + 58675, + "0xa4209691ef6c20124531d3e9fbc9a1b75abcb1b9f0b0459969a7b7193698b590" + ], + [ + 58676, + "0x8c4b889ee2b9fb8cf6b0b759967b60d5d040233b22fe6b2e2a45f549aa4f0a9b" + ], + [ + 58677, + "0xf5d99e19a1cb31a7643f33ac310b3dabe75067970d1865e266c1329463d1afaf" + ], + [ + 58678, + "0x1c70ddd6ac741380d58d44dee4deaf6e08884c7a9c356f43cecc9f368421a491" + ], + [ + 58679, + "0x7def818020e165a76cae7579242a1ac043e0e2f2e91e7e767973b9fae3045cd8" + ], + [ + 58680, + "0x30e14ffef803c1a06365498df676fad3dfb318bdb2aba80bf8a7a5aa606b8f30" + ], + [ + 58681, + "0xc6a5264a14825cf4985cad30ecbfa6a9f7476fa0b7de556e6e08105c556486ed" + ], + [ + 58682, + "0xe5324766a21b8197156d35cacf3b54ef949034482983e47e05ad01481f531f9e" + ], + [ + 58683, + "0xa1fc625101510acf4ff9408440cf8aa136f7775698b660d1c2d57d38b96fbbe3" + ], + [ + 58684, + "0x59fe3ccb2ad66c80cf50fa24865797debcb4c930c923faeb1a0bba233ac32465" + ], + [ + 58685, + "0x8c50be29749832a69fbc51201b07454879ec325370867789f0fd2b366a52b393" + ], + [ + 58686, + "0x454f2b37ba45f52029695a75f81799b511db29a32649bbd18964ab203331b043" + ], + [ + 58687, + "0xd7f085561a2cb45d0cbd4f1aa92068cd1da5cedba7653ede81e17e228ec04210" + ], + [ + 58688, + "0x00b320e4275fe273448c7c18648fdc4de33cc9283fe1388da73d7b65db3d6b73" + ], + [ + 58689, + "0x3a75a26927c92a013d86db0e2104e5b8930cd5706bcf054cbe04e2a048012a0c" + ], + [ + 58690, + "0xccfa82e68f1e704c6e9ffc17c6c1c33268d0f533b4cdacedc79d72f2cb991d68" + ], + [ + 58691, + "0xf5bb00c1ebbc1fb689c40e6cabd0072d132bd77c55eab35f48d12d2477d0254a" + ], + [ + 58692, + "0xbe8e149a9b1f38e5ff32cd3a6a3480f7dfaa0468fe8e75f94c36f90239d43098" + ], + [ + 58693, + "0xb0883108753ce7784feb2107433e3565c5ae532bc530181b63825b0d6c2d1c0a" + ], + [ + 58694, + "0xa66262237ab0db8d27ba7bd5080137308cb5708ba777be6da630c79abb6d43ea" + ], + [ + 58695, + "0xdc8cf4e10849a704108132939a2232a98f3c8887d4e3b1c7ff9763e756c174f2" + ], + [ + 58696, + "0x5ad7197735a4d053a6afd20f15539a2c989f0144b32c1d79f10c37a5f6c3a73a" + ], + [ + 58697, + "0x4ea63f5348e474ad4fafac3c0f25802e77d983cdcff651dbafd783cbbb1769d0" + ], + [ + 58698, + "0xc59b4ac40f8628d1e3091050c431fdba29b4b9cd64295ed6429ffa9886a60863" + ], + [ + 58699, + "0x30426885c3fdfdea449d73b894679116db62eaa53718e02bc3557b1cb9b629de" + ], + [ + 58700, + "0x7dad86cfb43471d72c9c46b0ad80a7563ce7bd21f8e56f742741e5552a23935b" + ], + [ + 58701, + "0x2c7643b53740754ed80fe48a2ed09824d8b69d33e887d5492809c246a6e36a7d" + ], + [ + 58702, + "0x9e374eb4846bf9d1188e7210cca717bba5d2763570cf0180ec06d11240f409ad" + ], + [ + 58703, + "0xdcb2492d9f0d70ba7b50e7ab07a33781a74625ff39a4548d89fcbf15aca69c67" + ], + [ + 58704, + "0x9f1472d0f8c85ba8f613d11c18c4c3fabcc410bd5b67f9630117791a8da4f664" + ], + [ + 58705, + "0xc64a70a90afa85b7285d643305a13677138cb113cf48a1e69a54c2ba64576508" + ], + [ + 58706, + "0xdfaddbafcb2bf4864e0e917f4b450259f81e577456c4189bc5c1fb256419f2d1" + ], + [ + 58707, + "0x7096660e8a448ab0fbe9ee164133e18cc9bc219106f286c58e11cfb661b1ad34" + ], + [ + 58708, + "0xf33a9e84ba7345039cc3cb209129cd775e98fc8cd2a2c056db56274fb18b620c" + ], + [ + 58709, + "0x9700e357bcf8131995d0db2ef70c06f006ce0c8bc01f512a2a64c226845caf14" + ], + [ + 58710, + "0x7dd7d472065400141791df9d439e889409b1d386af188d236c0c90953a1fb5e8" + ], + [ + 58711, + "0xce60abf5b369d03b81d4a531bba89d3fe1d69eaf3cc876cb4bb7b356b7ed233e" + ], + [ + 58712, + "0x612982078bb9676c131a83fe714b02de5933f7f6cc3a76f657f08af8c7e5e0b1" + ], + [ + 58713, + "0x0bb97cf8ca95bc5fb26981f2c29083fea096e217849465138d518cbb1ab070d2" + ], + [ + 58714, + "0xe2379cb45c263b7d79617b1256e6d858d9052fcb1773f0a57ff0eacb8b99a638" + ], + [ + 58715, + "0x42ca296b0404185bfd9415ff933c25946b961c07a0e04027c7cadac666e892e0" + ], + [ + 58716, + "0xb7051ee43cd83bf147cf182a514f34b3711250c662249d835ca39ae9356fecee" + ], + [ + 58717, + "0xc4d86468464ca538f5710b168da3610a0530e0aeab71a359aea4a2e131d5d122" + ], + [ + 58718, + "0x7ce26460e61509d2b328e21b36d6fca370682d7a82ead845d515cc1401dfce93" + ], + [ + 58719, + "0x3d3a4f991189df93cff5ff73691796f14985dcbb6d7b5eaead7841339df12122" + ], + [ + 58720, + "0xdb39dab0b568ff6054f417765845418e837f5ed7aa22a10a334c3d315c7c29f1" + ], + [ + 58721, + "0x6a564fb34ca1c1e96d26c3a584dee471dbbd937cb735952a392bec8ee47d6b2d" + ], + [ + 58722, + "0x9bf07c2efd50354b345b36b97ff9f15fc7490afea8b820539fd3160dc6013563" + ], + [ + 58723, + "0x4f85b6e34ed53337687489dfc08a2b18b6298d1aea76b88dd8105bb56b3ba8bc" + ], + [ + 58724, + "0x8c54314926008bf9cba825dc9096df6d1be06c2084046e0fd0a3fb9eb97eec40" + ], + [ + 58725, + "0x87638cb0eff96a6bd90846a03fce926e589e747c4f6d4aeca49b862cc6ee1f8c" + ], + [ + 58726, + "0x696f4876e83fab6affbbfe046bf06993564fcb6b3ab6858f54dac3a38ae54c4a" + ], + [ + 58727, + "0xdcf2a06b7395946ae65a50c341317980bd21a3efd6097123612cc11718ee381d" + ], + [ + 58728, + "0x75cb99e47cd719cdf074a02f1027b105b6848f4d54286d735e3863faebb162d3" + ], + [ + 58729, + "0x4563539132b9135ff028922b1b8ec29c23169c06040fcf6471c41006ef0ecea0" + ], + [ + 58730, + "0x8d0a90994dcd85c7a08dcd5012b3637a3b26aa674516de13173c69c14ea1385a" + ], + [ + 58731, + "0xef0e47823ee8d7d461dbb36424412e5cd057bacccdb37a4762a518fa1ba95761" + ], + [ + 58732, + "0x4adbdfd646029ef8ccd44075a80f192723dc1e16e802b439474e5fb2ac8e8755" + ], + [ + 58733, + "0xcc63a83d7984475627f4ce183b68a8cd148a83eaa75b6638cfbfd866d7defa3a" + ], + [ + 58734, + "0x922244cf954d131f30d0df7467e2b5c2c9f0b1fb774c1c58db624a07603ffe9f" + ], + [ + 58735, + "0xb39e4732ce61de69598edc23ce6910d2100670ea449d32fa85b20325fca3a27c" + ], + [ + 58736, + "0xb83939dac97037442378695901f3a4db220277b524e0f609066876f0292ea00d" + ], + [ + 58737, + "0x163171b0437eab6b132bda2ce8e07087397723c851977e9869f738f3e1cf3457" + ], + [ + 58738, + "0x4640a3f1af79fd5b68d00addd03935bf09600bb5002493a259bf979d120a9bdb" + ], + [ + 58739, + "0xf2874928ac3c847520935d19ab8fcfd635d52fc370e5f56b390ebff5c781aebb" + ], + [ + 58740, + "0xc89b6ced3ad55c73d557fa8625e5c69dbc65918892149ca112c5dcc1ef8d9fa5" + ], + [ + 58741, + "0xe3d110404f1d4dac13c4668fbf428e3dad069bdb6a38f22a2ac26db8b6600307" + ], + [ + 58742, + "0xf478391cffe4a7cc956ea6b6d28bf032b82f2e9c14329d4e7733b37a4c211cdd" + ], + [ + 58743, + "0x2e587291f584eec14c9e180500afe4e33e04e5f34e8a642b012bc24352b061ee" + ], + [ + 58744, + "0x8b9cecf8adc3486de10313dcfa6fda7dc47c41bdbcf6fb71dd923316ad9117cf" + ], + [ + 58745, + "0x4a32019a8f6c44ae8c2051bfe3641cd6523a85e5ac322046ace4f3a454e02eee" + ], + [ + 58746, + "0x6930a8261e2a8b0502ee842804b4bbb544f74ece76df2159bd3492508c900604" + ], + [ + 58747, + "0x60ab2fcc33b6f26b0f91b2780fb50f4d14ce1481a4debbf94469203d1076b32a" + ], + [ + 58748, + "0xd71bebf1902b778103354fe36795d8279a85d08c9def7c5fa575ebe9035d0f39" + ], + [ + 58749, + "0x7af1c73e5e53d3e1d9591f804262c60c0fc42999a54c5f61e7b101ac90ec0dea" + ], + [ + 58750, + "0x8a874a69cc4942ba83085322ff191bafa0bba750e3e1b457ba9969a540fee1dc" + ], + [ + 58751, + "0x926b4b896afaebf78d614bc80ce0b45eeadfc00723a6fc1f4925e22d7830785e" + ], + [ + 58752, + "0xf9091d9a98dca96a0b12457ed72ab4385ab1803755b0ae84655149c4e9bb8b3a" + ], + [ + 58753, + "0x1ffd12dc3590622c7755330773a2b43e6f7d9b10b54490d83f8cc41323eb741d" + ], + [ + 58754, + "0x3195a6e99799c813998164c111e7782893c54a6b24faf7e91b91555363c970a7" + ], + [ + 58755, + "0x27ed8b240eb86d9928a2fe9dd5c00ccdc2a5bf0e077858f336a8c417d719380f" + ], + [ + 58756, + "0xab76ac4d637ffc757f336432ebca39d3f2d71e2569e9b4afec246fba09e36683" + ], + [ + 58757, + "0x25c88656aede332959be513491a472dfe1dcce012d123562bc87510f002fa594" + ], + [ + 58758, + "0x73969578e294781fa4a37fd12a22828a66923d86c1a24f1a7a68618e1d3010fa" + ], + [ + 58759, + "0xbc2bb7e6f05505a2243b4052972386c49d0b97ea1d37d80c8aba1d9e35811d68" + ], + [ + 58760, + "0x194d7fcf0a02deb9b5b534af79207dab18e5bd7b3c4f6b0da551650b4702c591" + ], + [ + 58761, + "0xeda3903162f0cca5410be4c6e76bba506d18cd9d9cecd4b95ed957967751000a" + ], + [ + 58762, + "0xd423006d464486b1fe1b037d9865ea15e95c934b560028d50105acd08500d8e4" + ], + [ + 58763, + "0xbab760a6a6954f6e36f04967886070b3f7120d9d9819d12e1198b788358bd5c3" + ], + [ + 58764, + "0x0054b03577bafd27d2dc5cd45fc4759a0155dff7cffbc628dc4df555e77c770f" + ], + [ + 58765, + "0x9dd0bea7978c91f4d6f7dd9e9ccf20f93b80f04140095a57f5fec0b8f2600e84" + ], + [ + 58766, + "0xe0457b26eaf0956f22f8fdaa3c9aa3a64a86b94a67906e1e479c74816059c110" + ], + [ + 58767, + "0x80a06961bdd89e86dc7912c95ec8d4f888ba70ed07df8ea7acdb5489f673c3d4" + ], + [ + 58768, + "0x634f1d6d29f5793f65ee41372cfdbd630eeff8a4a9f4289358fd5507052d1c00" + ], + [ + 58769, + "0x0ca5fca0e32b861ee10596e62666b84df397c33744c76de56c9c5c7f2ac83784" + ], + [ + 58770, + "0xba95e6ac361779187c1ca3e63f2538df446edae02e3040be2690eaf4fe374fba" + ], + [ + 58771, + "0x4d34196ba507daecfe266449f022f1ec338901451b90f4f8222c26b389c768ea" + ], + [ + 58772, + "0x1e92d01ced40bda58c6966577e0ef534f067a55294c2a48aa7fcace81b66e7fd" + ], + [ + 58773, + "0x24f63ea8e6b7a9f07b4a8031332fcfc49a665a3d6d3d920492bf5eaa5727a14a" + ], + [ + 58774, + "0xfaf47fcba4aef78e1313e13547df1035c441deacb79eea5da92c48574c4f7a98" + ], + [ + 58775, + "0x7b55f1e7759fee61a44126a26ed96b669c44ad9ff46eee197fd1999d13552367" + ], + [ + 58776, + "0xae837ad2881fc611ed8a10f23a42fde5b167e2c5b416f805eae97b26f9b34a6d" + ], + [ + 58777, + "0xb36e3bf0a1edabceae1a0e82d91c8889d2425f7dbc225bd03e662b09c10faf44" + ], + [ + 58778, + "0x29ede4d06a5b0b1b599d9e1ab5dcd39ff90fa7253567bb01e3d1ee258f7122f8" + ], + [ + 58779, + "0x58365c0ecfaebbf4d4fef2b4865ce35111863c8cb42a7bf11873d70aeb6ce6d0" + ], + [ + 58780, + "0x2a75f5ce047de22e05875962b02013e356781e82065a4db1f4baade21fc76a45" + ], + [ + 58781, + "0xd39e5d5356dcbb5dee8668e91edc4ba8f8107281c749074aa57728b0040368d7" + ], + [ + 58782, + "0x221f3cdc6acd57d5b36e51ede50cc472281f81d17c1eeeacdc229402bcab4ecb" + ], + [ + 58783, + "0xce3d4ee34bcda7fd726dc2d19908d86c69e40698c57af7d9792b3ed059c2a40e" + ], + [ + 58784, + "0x8834b150581e6bae10964e8ed7acc484518ef3c6c32750cd1dcde8b1b97b2ba4" + ], + [ + 58785, + "0x2fddac016e5e5c3e229d5194d69cd757ace656d7be33a1cbc5c3accb55b7c127" + ], + [ + 58786, + "0x52bdc455c640ae829ae86cc3e237980f4306d1e230a2a1736f8278193999e97b" + ], + [ + 58787, + "0xe523f257425afa97b0b27271dcf426bb96c74bd8d6b2933706c5e557ded64e92" + ], + [ + 58788, + "0xadaf88f52a071ca51d8b88f6adc908214d5c9eac7556e291a38f38751e7bdd3a" + ], + [ + 58789, + "0x67a3e5bc8efceb28bf1694f3f00afc5157c05e737461c79d51c13107b8440227" + ], + [ + 58790, + "0x34efc3dbfe7914e23ada1bbd99b10b9c666c4f6fbbaa7c108aeaace742ad74e5" + ], + [ + 58791, + "0x402d229ca0045f562ec14881719c535583b38fa0ca2f6e4cd9ba513efd38cd0a" + ], + [ + 58792, + "0xe4280c852b0b631ac89e526195e7690087853042924322aaaa63c05075efb3fa" + ], + [ + 58793, + "0x7ca4ec443e8df2365d65d4da4d96fee738f6d2b7abed2696708bc98a46270209" + ], + [ + 58794, + "0x68e528643ad5a022bb98080bf1ef59cc756b1e5d7eadc3a547ec8d25820e8b37" + ], + [ + 58795, + "0x0a8b1cb7547f80d2d508570368e6b5b6fff76e68b48e6a8d5ff3e551deba9794" + ], + [ + 58796, + "0xaed0b82e28042e847214ddc23b8cb87ac5757b8ebc3f783d111a3a3199ad9a10" + ], + [ + 58797, + "0x7ad8787c93bba040ecd0bbdea4c0d67d89ad2ad3c38a35c0efdc81049c43f69e" + ], + [ + 58798, + "0x9294f2d6671b847b766720ef18a1603f2e4e6fe89909077da660edcb6719b2b9" + ], + [ + 58799, + "0xba3f0a10b43cf49e23282ee611d625ed2c4e3501445d29ddf1b3169491f52df3" + ], + [ + 58800, + "0x2bb4a811351e2fd08c002fe7cc37f9cb12ecb9702c90d2a8798e7d77e6d79e5c" + ], + [ + 58801, + "0xbd9c54061452d041522190b3df84228b5d2aab971b8aba78f3d29ba559e0177e" + ], + [ + 58802, + "0x10ab5a2b0885ed89cb3bd4659b5beec124695d308e25fcc47c39077c74c1983d" + ], + [ + 58803, + "0x3e86655e01ab5f5211c82ca0a3eb3fbfe8aa32e597cda4341b65d0dd01d61a56" + ], + [ + 58804, + "0x21ab0b39be46c44d1dd5d82436a12e31295838ca4f3cd81d9859520be5c14612" + ], + [ + 58805, + "0x4b74fb32da14e0e7478c48083e393d0de4f4203ba064953cddc136ac88fbd697" + ], + [ + 58806, + "0xb70ecbfd7e35c3ae9fbee74851fa0bd5c5b9035c05c6274ee6b6e116c7c1434b" + ], + [ + 58807, + "0x18ce0daf6f6d1012f7e938a10c168a2af553744cdaedd6b8f18a083467ecb1ba" + ], + [ + 58808, + "0x0551a68d86aee2b295a225d7eeb08efc40ccc3f9ff17d026abc5b85bbfa99009" + ], + [ + 58809, + "0xb87f70822399ee5cb54bf0bc00b45bbd27f26dfaae2b3378a42d058bc23d8b1e" + ], + [ + 58810, + "0x8dbeaacc1ca18a50d0e48047d800c53b46bb0018bc938e3316d28dca068ec07a" + ], + [ + 58811, + "0xa665c6831c83944e364f7c82b678e710b685755dc31a616f13b33f740bd93671" + ], + [ + 58812, + "0x8df016d3e69a767a6c905565282461893c98aff239d2e6a6681de258b4d29f3c" + ], + [ + 58813, + "0x0dd8b22d4849b96f6e6a76f7ce6b4886e016738174a4b3b8e7da1a735a889428" + ], + [ + 58814, + "0xe7c1c84246cf0478537a81d08bb96716be6852403437ca9188b02264cd4eeee4" + ], + [ + 58815, + "0xd78e535e8dc3f180df6374d8cbc2da8ce0a60b7683d25e07061ee79f5f564307" + ], + [ + 58816, + "0x9ac6d13c335592ba890ca198276349fe0780cdd5e6bd3e7ac39361ef06a728f2" + ], + [ + 58817, + "0x8f1c796beb1e7fb9271fe2bb200c0df89c5d01a3e348ca73072039f1496ff5d6" + ], + [ + 58818, + "0xe5d2c9eb9532e0feb6ec1ebe18805d480591c097cc6a7f6ddf4ecdbf2a39ed47" + ], + [ + 58819, + "0x381afacb540408a8ed7a42cc8e83050a9fa58fdf40c337569b3650fb2774fc64" + ], + [ + 58820, + "0x8706e4c2ed9c5b0152c82bb9e9e16ed9e4efda53bed929e791cf40053eee3f48" + ], + [ + 58821, + "0xf59f11fccfb25bcc5334db94feae83352d904ee8d2e736283c5e32fb22ea407d" + ], + [ + 58822, + "0x34b1bfad0320f724852a81a91990aa30318150161aa7ccc6d3dae0dc40356cfe" + ], + [ + 58823, + "0x192640288551e0d091adb03f7be739e117e76ba19502f146c19b3e89e5b5a4f1" + ], + [ + 58824, + "0x85ea922122a1f38623ffa60bd97f68234e3b469bb2174f6c383a9fc3f6a9b575" + ], + [ + 58825, + "0xe502b2eed18da168b64024e4adf851c26b051a8e581bfee88eb174ec0d9cafa8" + ], + [ + 58826, + "0x461f720f50e18662237646a08707ea7b6c9aa9569e8340c2eab31abc537c2430" + ], + [ + 58827, + "0x5b1c1eba48f5c9bfef0d6511bfd055830b1de33bdfc659ff7e9947e8bcb6b6bb" + ], + [ + 58828, + "0xb41e2ae9d91f9fd36cdbb4362950ce15c446f72255e8b8784783e7e975b5ae1c" + ], + [ + 58829, + "0x15a54d0f1387e24351973abb8cfd946110e416823018d2b43990d0764db6b2d2" + ], + [ + 58830, + "0x2214974622a1f5cd07793c465522eef0f902390139a87d0c88566ff3229382d3" + ], + [ + 58831, + "0x8ab20db439eeec491734be0c881f90bc37a083097f493b485f1221d7aa1a8360" + ], + [ + 58832, + "0x7cab9ddbfa8e3bd02d3792b64446b4c8cdb9d1039598f116e1924d7b93a512d5" + ], + [ + 58833, + "0xe4af21da8f64ea5a3b419728c03dadefdd5232ccaef33843058d3a85e02ec85c" + ], + [ + 58834, + "0x7e566526bcead7fe24f39553d0ab277bfdaf3a4dd862d3f2e0529667a870f244" + ], + [ + 58835, + "0xad68e68794f29f3d478ac410c98e5835c28b5bbbc776c67ad26f40a21d685596" + ], + [ + 58836, + "0x3bbdfc20d22c99f6c5b92c314ab9f66ae1a35ef1877804b2c4453c68a8ba827a" + ], + [ + 58837, + "0xe069cbc54858134a604aea07f014bbb5b0f74be07e53656db9891c16a8723668" + ], + [ + 58838, + "0xfd61ab089b306267cf4e5aead3638c74f25f0802ace189c905e9f7a996098360" + ], + [ + 58839, + "0x03d86b3a1654a89b83843d933f9b02da2976bc2b4c3f8a5a794b305d82e740f3" + ], + [ + 58840, + "0x6be72c3daae9c224809eb93d8563494ea689ff0e6d55a643238fcee07fa2b868" + ], + [ + 58841, + "0x9920930dfcc16f7951ea47e7d2efbf60ab77f18135523857fd07722946295aed" + ], + [ + 58842, + "0x435fd46d16462635cbb1ebbd76bf5fadc7c67922a3ddd19b31cef26d95db5b1e" + ], + [ + 58843, + "0x7cf6de5977a69e8e7c1714102a2098b0ea18ea1beb5dca5fce696bc629229036" + ], + [ + 58844, + "0xd5035ce712a88035f213707c47158368db7c7c4c4357bfd4cbc45b051d9dbcfb" + ], + [ + 58845, + "0x136aced7cbbbd0f65602abe6de62dbd6be6a6d0c06d9acc758d2ac40cb65a0ab" + ], + [ + 58846, + "0xc0a7a54a12aa262da77705be2c79f65dde09b3e9c01193035b8df032b17fd32b" + ], + [ + 58847, + "0x2e898d5aaaeb6d74d7fe7c8d39e07381cd3f5a6f1f77460ce4c822ecf648ab38" + ], + [ + 58848, + "0x173bbb9ef11eaf9b3138325ec3dece195f1433816cbe75b4e1b3f47953301208" + ], + [ + 58849, + "0x22f97e3787c9a329e4ff67b722f94587cd19786aa872104962bf0ac092701ff0" + ], + [ + 58850, + "0xebf786bda59d616f823ad68e0bf9e81912e28a66c06da1544e40e6d18d18ed2d" + ], + [ + 58851, + "0xe013aea52220b719fe39139a275c169da4acf713f281bf00c8e0650a04311e73" + ], + [ + 58852, + "0x9142e578e76ded0b966ab7afb75f332fd8e65f7f985cc40c7c313c7eaf1abd2e" + ], + [ + 58853, + "0x0dfee55c1626bde02beabff99c0eed9a1aef7b508778a225199220526af697ea" + ], + [ + 58854, + "0x91dc6e93198aac8d281797f33359c3b6588f523610e68bb3ea840c25e74ab3bb" + ], + [ + 58855, + "0x462e31e1385e1b34b1426be597f4559eae770240fb3a382b64708e7cd8e32798" + ], + [ + 58856, + "0x0cdabe89e64aa4816118f85cdef65fbef45227398c8c00af988d188c0d4542a9" + ], + [ + 58857, + "0x4ee25f6b6b742014cb108865eef37d1e03c54ad5958673e4072e20a4f6bbfd1a" + ], + [ + 58858, + "0x9f6d69e2949cd000a67ce7585769ac93e80b70f11079cb076df4e1d176897f1d" + ], + [ + 58859, + "0xf93f68c08e0d2699d044722d62ff15d8ba23bc56eba84d732fd1eaf7d8d131ce" + ], + [ + 58860, + "0xa137b1bb1f0c25a24c9a0d7a4590c2163077cc88434350a60ae715e859d0ba82" + ], + [ + 58861, + "0x893506d3c8f9d4121780311c60c16b130b2f11111cc5b73191ca5ec32a2fc276" + ], + [ + 58862, + "0xf51da9fbe2c990fd54bc03c0dd289b8f302835e975a7a25e9473355a66d8c2bd" + ], + [ + 58863, + "0xf865a779c2f69bfe7e0cf6311752ee317dffa2f8530af4597390c542b64d2797" + ], + [ + 58864, + "0xbbe9af24fbb36a997433d3946387d7b837b087020410f346d8d6b08d450a578b" + ], + [ + 58865, + "0x4ba00f48b1c5771e398494825d5c9e59e6bab97a993a649dea72a57f23d82331" + ], + [ + 58866, + "0xbf6ff4ab0e4cde5e854a45dc756236b107c9fa73e01c221945c8db75347c4adf" + ], + [ + 58867, + "0xbd46873918d1fab21cfa9fe8a48f28d0ed0bc6c56ea51467241691781ba62a2a" + ], + [ + 58868, + "0xb58581e36dfafcda5de5f45015473feea66b968257f9b25bdc2eee3b77d72425" + ], + [ + 58869, + "0xfa773d3801166e4480340fa733b52d3d150b8f945ea10fd30a2f2dd001ea1553" + ], + [ + 58870, + "0x14a7a13f5a9f40b47a2ea87b4cf0747cf7e1d7947b727584ab62bfff5a71c2ce" + ], + [ + 58871, + "0x64992babc7bd09ef3f54c2f3a587a437d5e0a8b580c69be6fefdb4432715a42a" + ], + [ + 58872, + "0xe7c615e920950c9ff6c985537c907b4f5d0ad3514d8595ec43a89413b435a1eb" + ], + [ + 58873, + "0x4a13feb4a626f7f004e22268ce50e6a5ca82f7ef241054c68ae7a70c47eda880" + ], + [ + 58874, + "0xf1638884b9242ef4a6c22eddb2ec8cb48595dbd0d340489378ee644f4912dee3" + ], + [ + 58875, + "0x5fd70ba7e9c70d22b3df6b9c6d38ed576253c72b48274e1ab9b6b358fbb57430" + ], + [ + 58876, + "0x55cf759752c6224a4f6c0cf7c996359525bc5999b25df9a900b609277212baef" + ], + [ + 58877, + "0x9641bef8e413319322f096bc19bf59f0098aea977e5d6a3fe8797f32feb80d4e" + ], + [ + 58878, + "0x0c5c075956bb7aa8a65ba06c222ca1a2aae60a861d31f5af3f5259586813b97a" + ], + [ + 58879, + "0xa0afee50142396d11357548c6a2fa7aa3e04880160f7267fab4f57515dd36ee0" + ], + [ + 58880, + "0x5f0d88bc04f467b5fedfad48bd4ef1273162f8148b16a69a888b850927700ea2" + ], + [ + 58881, + "0xdca19be87b712cfaef24493377f606e0aeeb9cb98cdd522e1c6922ecc323a203" + ], + [ + 58882, + "0x4f22a3968ba00946a5d153612a0c8e77b02490c80ada2d364c49a6e65432c803" + ], + [ + 58883, + "0x82e7855942fe38886ab30955ecb2022e45f854502920023014275e8251b51342" + ], + [ + 58884, + "0xb1633cb8d92e91a3be58cde6254c595c9cd3054aadbb299212dac28ba8aa3c7a" + ], + [ + 58885, + "0xce7e377505f933ba306ee1ac85177bdce917f72923f3312c7b365a9cee347e86" + ], + [ + 58886, + "0x56d87936a4c4a7c48ce585ef81d4b212d86eeb9b3ed03e695f5e4fd9cdf0963c" + ], + [ + 58887, + "0xe0828420334fae3651ada3c608c19738da08301eaa33bdf59f7b9bcfc8c1fbb0" + ], + [ + 58888, + "0xb7d89cba155a6fc83e751897a432b25de7652cee68f275b536d2f65f202d43c4" + ], + [ + 58889, + "0x0d11db04dc7a920b68b47ef6a64b88c05c7a7a7e6289a0303503d2b3e374e781" + ], + [ + 58890, + "0xb9b21bb9c58515476073c51d08d538ed27d1581c2fe67217fe18d2733b5ea856" + ], + [ + 58891, + "0x66ad211f38a29bcd1b9f635ccc9b9549d04800cb989027cab0318d06e5cf8578" + ], + [ + 58892, + "0xf92603398e570038322f31ffb56e06d2920b2a75714c68468a84a51989cea6af" + ], + [ + 58893, + "0xb4c5d0c6e3cc10272ece267a011960899e508dc650c90511af59620b97a0dbad" + ], + [ + 58894, + "0xf737facdd4c05e051f0fc42a10cf62067c1bcd49656dae38b8b8959690293577" + ], + [ + 58895, + "0x573141b9857ffb9f1ac08c6c67f9f8455bef8cdac90415abb445ffcc69744783" + ], + [ + 58896, + "0xd82f14ae4624d3011b0b5a13ea0bdd8837b33320b154f5773b306aad8bf5440d" + ], + [ + 58897, + "0xbb0199cc63519680b7534a30ae089b3cc5bfb8f08b6f9f05a8a9843a3d741e08" + ], + [ + 58898, + "0x7cd7fea155873bb47853496d8a0ae43d17b141c52653dfbb02d0c997b9cbb076" + ], + [ + 58899, + "0x04bd95e8b3956dfe8f9f3aa698f4c135eb1e5532609a44a9961dd8c05b95bd4e" + ], + [ + 58900, + "0xd978d740504b2a7c317488132a90a939d51782ce3d90fb144ca82db67078ac3a" + ], + [ + 58901, + "0x15259b7eb80ee3e35fe6984e620acde6a579fffe00e296920a672b90eead1b25" + ], + [ + 58902, + "0x81f7d5660af749246ec9748e4722b5f7f422ef98f65e53c0fc2c906458947196" + ], + [ + 58903, + "0xc75e6cb17f19def96fa255c90714ce745f1104adebf361e7c24f5713cbe4b052" + ], + [ + 58904, + "0xb36436b26a48fb283e34081fc7078992f2252ac8f76484c2a49ee0cbd04b516c" + ], + [ + 58905, + "0xc5c326d0dc3d177d452c17821f4a958269b1c54c385e7a486ee9bfa432cd45d7" + ], + [ + 58906, + "0x610266d199eb92c1a9174f68bb7b8e0699e0e9139db00ae0be93ea61ddb43c43" + ], + [ + 58907, + "0xfac6548364615865f059e7db6bbe26e76c38caeddee77bb95cd5c8b6dbfff3b9" + ], + [ + 58908, + "0xe625a98abff5a0fe46d059c047bd6aaa8eb35d618e848d588a5d2daed77c5a1d" + ], + [ + 58909, + "0xb44a385a474b7d2154de61d8eb0dbc448c852c1a817cb06e6f6e73d037c05555" + ], + [ + 58910, + "0x877da7d69baa45fef85f3df3cec3107f5d9e20de23a605490154c3d63f5d3d75" + ], + [ + 58911, + "0x84e0974222ccbc8848faa068aa39ac78c50a23ef7c44300ab7f3111137d5e3a8" + ], + [ + 58912, + "0x711d6c758da0bda11cbcd025ea667be5e8316228d32687e1ded4b1a3faf244ec" + ], + [ + 58913, + "0x659059085b41c84616b322158cf3296517d7e461ad0869f83882429e8109b9ec" + ], + [ + 58914, + "0xb3c2a18ddd1b2b98e431b84312bd6466193e9294696fa963213be1f221ebc3bd" + ], + [ + 58915, + "0x8e380dd4bc22b45fbaeb98c3dd0d51778aa68f5cc4f8f5d556deb72bd0ed99a9" + ], + [ + 58916, + "0xd3783b337c88228fba09f0b84beeab4e72197e5cf4fda5da661fa2334ff1e423" + ], + [ + 58917, + "0x9a47666ecb78ba3e84ecb703ac5fa2817665c3294eff57c6f5a078d6e8332e8d" + ], + [ + 58918, + "0xb2e9059bd693bb63ac904434add656ead20f70e13c538832fc4ee51493b9f518" + ], + [ + 58919, + "0x1a45a3dcddecf09c1be9f54e2e0767ab7c9d57d83169bfd5bc1f781f4802a138" + ], + [ + 58920, + "0xbfe3e50c2f5ea9da9ddaf9d23178458963f143e8994b2243de8a4de2b7a15250" + ], + [ + 58921, + "0x3be988c2ba76616ce911a2f7e2658d3a3a6b6c2c9e99b7b6aedca3321bf85787" + ], + [ + 58922, + "0xcbbe2100985abed7147c29002ec22d551288bcfc0d7964f908c433d2061eabbe" + ], + [ + 58923, + "0xaf4d859845eecd1bd258eb56344029e4222c15b39b24ff8e1470e4ba5a481808" + ], + [ + 58924, + "0x25a14c0c4d02dcf9664a9b43a8fadbb5fda67fde7deca8f3ac09672641148cc6" + ], + [ + 58925, + "0x613d0b3be8311d354fd0f2ad67c710372bf18d5769674f93adec9fe974d8cc0d" + ], + [ + 58926, + "0x12b8bcc3ef4273246806645111a958f4d87fca265f217cf5a9a79135373c495a" + ] + ], + "rewards": [ + [ + "0x4d7c0d6f3ad5466691649e98ebb59cd5b5194687", + "0x2eb2db8849d65400" + ] + ], + "proving_pool_credit": "0xbacb6e17d729c00", + "payouts": [], + "blocks": [], + "pre_state": [ + { + "address": "0x0000000000000000000000000000000000000210", + "nonce": 1, + "balance": "0x0", + "code": "0x608060405234801561000f575f5ffd5b506004361061003f575f3560e01c8063aa67735414610043578063dea5c2e014610058578063fe7e05d51461009f575b5f5ffd5b6100566100513660046101e0565b6100ca565b005b610083610066366004610211565b6001600160a01b039081165f908152600160205260409020541690565b6040516001600160a01b03909116815260200160405180910390f35b6100836100ad366004610211565b6001600160a01b039081165f908152602081905260409020541690565b336001600160a01b03831614806100f957506001600160a01b038281165f908152600160205260409020541633145b6101635760405162461bcd60e51b815260206004820152603160248201527f446576656c6f70657252656769737472793a206e6f7420746865206163636f75604482015270373a1037b91034ba399031b932b0ba37b960791b606482015260840160405180910390fd5b6001600160a01b038281165f818152602081815260409182902080546001600160a01b031916948616948517905590513381527fa47563c41dab010f91a8ef9dc7ac2bcdfa0ef2af697e575048e71e6eec60dda3910160405180910390a35050565b80356001600160a01b03811681146101db575f5ffd5b919050565b5f5f604083850312156101f1575f5ffd5b6101fa836101c5565b9150610208602084016101c5565b90509250929050565b5f60208284031215610221575f5ffd5b61022a826101c5565b939250505056fea2646970667358221220cbf48f5aa6f911f83b3c2b09adf8c418f5da6fc530c3d5db9d4ba0be24c4bf5864736f6c63430008250033", + "storage": [] + }, + { + "address": "0x0000000000000000000000000000000000000220", + "nonce": 0, + "balance": "0xe6363fbbed43fc41000", + "code": "0x", + "storage": [] + }, + { + "address": "0x1aca71f7872aebc85b4d4a9ad47a09abcc624d65", + "nonce": 0, + "balance": "0x2860cb14365c048800", + "code": "0x", + "storage": [] + }, + { + "address": "0x37b55c8531053a5cef7fe1f19ba67012719773f9", + "nonce": 0, + "balance": "0xbb7c59060f46e2a800", + "code": "0x", + "storage": [] + }, + { + "address": "0x4d7c0d6f3ad5466691649e98ebb59cd5b5194687", + "nonce": 0, + "balance": "0x12c8bbc1555f8d233800", + "code": "0x", + "storage": [] + }, + { + "address": "0x5a5e606bda0fe1b2b4298aadd55cc6ec57ff698a", + "nonce": 0, + "balance": "0x648cba8883ddb562c00", + "code": "0x", + "storage": [] + }, + { + "address": "0xc2faa4a2866422a865c9b3b3cb5988bf4d07f0b4", + "nonce": 0, + "balance": "0xc05b9fc73002b32800", + "code": "0x", + "storage": [] + }, + { + "address": "0xc45d23f49451faad9afadf877feead626ea8d083", + "nonce": 0, + "balance": "0x8d4bd86134bd1f1800", + "code": "0x", + "storage": [] + }, + { + "address": "0xcafc6e743c6848d637ab6283db5ba9fa3023516a", + "nonce": 0, + "balance": "0x14c8d48acb8c0c15b800", + "code": "0x", + "storage": [] + }, + { + "address": "0xdd442fcbb964a3afdc90d49b408e8dd296fa86e8", + "nonce": 0, + "balance": "0x96f9052274f60dc5000", + "code": "0x", + "storage": [] + }, + { + "address": "0xdfaea67368f3e3753397d878f97efe6aa8020c2e", + "nonce": 0, + "balance": "0x121f126ec66aa0f400", + "code": "0x", + "storage": [] + } + ] + }, + "plan": { + "shard_budget": 7500000, + "consensus": true, + "shards": [ + { + "index": 0, + "tx_start": 0, + "tx_end": 0, + "over_budget": false, + "pre_root": "0xea9db302b3b1fe3b859d5fb417408fecefeb06aa43721ed7fdf354975582f2c7", + "post_root": "0x7886b9cfbbbdfe12509affbd4df83cb317e9708eeb627bd49b575cbfa47999c4", + "receipts_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "link_in": "0x38046159e1bf364d16df7645adc5a18f254dd70ffab279ed30785b727b52a3d5", + "link_out": "0x38046159e1bf364d16df7645adc5a18f254dd70ffab279ed30785b727b52a3d5", + "gas_used": 0, + "pgas_used": 0, + "executed": 0, + "skipped": 0, + "witness": [ + 2, + 0, + 2, + 9, + 13561 + ] + } + ] + }, + "expected": { + "pre_state_root": "0xea9db302b3b1fe3b859d5fb417408fecefeb06aa43721ed7fdf354975582f2c7", + "post_state_root": "0x7886b9cfbbbdfe12509affbd4df83cb317e9708eeb627bd49b575cbfa47999c4", + "receipts_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "tx_commitment": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gas_used": 0, + "pgas_used": 0, + "executed": 0, + "skipped": 0, + "node_state_root": "0x7886b9cfbbbdfe12509affbd4df83cb317e9708eeb627bd49b575cbfa47999c4" + } +} \ No newline at end of file diff --git a/proving/igneum-prove/Cargo.lock b/proving/igneum-prove/Cargo.lock index 496f85b2..0f729bb1 100644 --- a/proving/igneum-prove/Cargo.lock +++ b/proving/igneum-prove/Cargo.lock @@ -2796,6 +2796,7 @@ dependencies = [ "hex", "igneum-prove-core", "serde_json", + "sha2 0.10.9", ] [[package]] diff --git a/proving/igneum-prove/export/Cargo.toml b/proving/igneum-prove/export/Cargo.toml index 53a48e51..26722de0 100644 --- a/proving/igneum-prove/export/Cargo.toml +++ b/proving/igneum-prove/export/Cargo.toml @@ -12,3 +12,8 @@ serde_json.workspace = true hex.workspace = true anyhow.workspace = true bincode.workspace = true + +[build-dependencies] +# the source stamp (build.rs); sha2 0.10 is already in the lock through the host +sha2 = "0.10" +hex.workspace = true diff --git a/proving/igneum-prove/export/build.rs b/proving/igneum-prove/export/build.rs new file mode 100644 index 00000000..c3e0d892 --- /dev/null +++ b/proving/igneum-prove/export/build.rs @@ -0,0 +1,30 @@ +//! Stamps the binary with a hash of the sources it was built from (`IGNEUM_PROVE_SOURCES`), printed on the +//! exporter's first line. The stale-build class (5 October 2026: PC 2's exporter carried a core from before +//! commit 1251f0a because cargo judged the copied sources older than its cache) is then visible in the first +//! line of every export log instead of in a line number. Reproduce from a tree with +//! `cat $(ls core/src/*.rs export/src/*.rs | sort) | shasum -a 256 | cut -c1-16` in proving/igneum-prove. + +use sha2::{Digest, Sha256}; +use std::path::Path; + +fn main() { + let root = Path::new(env!("CARGO_MANIFEST_DIR")).join(".."); + let mut files: Vec = Vec::new(); + for dir in ["core/src", "export/src"] { + for entry in std::fs::read_dir(root.join(dir)).expect("source dir") { + let name = entry.expect("entry").file_name().to_string_lossy().into_owned(); + if name.ends_with(".rs") { + files.push(format!("{dir}/{name}")); + } + } + } + files.sort(); + let mut h = Sha256::new(); + for f in &files { + let path = root.join(f); + println!("cargo:rerun-if-changed={}", path.display()); + h.update(std::fs::read(&path).expect("read source")); + } + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rustc-env=IGNEUM_PROVE_SOURCES={}", &hex::encode(h.finalize())[..16]); +} diff --git a/proving/igneum-prove/export/src/main.rs b/proving/igneum-prove/export/src/main.rs index f7f902be..6690879d 100644 --- a/proving/igneum-prove/export/src/main.rs +++ b/proving/igneum-prove/export/src/main.rs @@ -99,6 +99,9 @@ fn main() -> Result<()> { let source = args.iter().position(|a| a == "--source").and_then(|i| args.get(i + 1)).cloned().unwrap_or_else(|| format!("{} (igneum_exportSegments), block {}", args[1], want)); let budget: u64 = args.iter().position(|a| a == "--budget").and_then(|i| args.get(i + 1)).map(|b| b.parse()).transpose()?.unwrap_or(SHARD_PROVING_GAS_BUDGET); + // The sources this binary was built from (export/build.rs), so a stale build names itself in every export log. + println!("igneum-prove-export sources {} (core/src and export/src)", env!("IGNEUM_PROVE_SOURCES")); + let segments = export["segments"].as_array().context("segments")?.clone(); let registry_code = bytes(&export["registryCode"])?; let mut db = IgneumDb::new(); diff --git a/proving/igneum-prove/export/tests/fixtures.rs b/proving/igneum-prove/export/tests/fixtures.rs new file mode 100644 index 00000000..2aef9a42 --- /dev/null +++ b/proving/igneum-prove/export/tests/fixtures.rs @@ -0,0 +1,128 @@ +//! Every fixture in `proving/fixtures` reproduces natively: the whole-block statement gives the node's state +//! root, the plan cuts the same shards, and every shard statement from its witness ends at the plan's post-root. +//! A core whose rules drift from the node's, or whose planner drifts from the statement, fails here before any +//! binary is packaged. +//! +//! `block-58927-empty-reward.json` is the regression for 5 October 2026: PC 2's exporter, a stale build whose +//! core predated commit 1251f0a, failed every empty devnet block with "shard 0 post-root from the witness", +//! left = the node's root after the rewards, right = the root before them. The planner of that core gave an +//! empty segment the pre-root as its post-root (`root_at(end)` with no transactions); the statement, correctly, +//! applied the rewards and the pool credit. The rule (spec 7.7 item 8, design 1.1): an empty segment is one +//! shard whose statement applies the rewards and the payouts, so its post-root is the segment's root after them, +//! never the pre-root. + +use alloy_primitives::{Address, B256}; +use igneum_prove_core::config::PROVING_POOL_ADDRESS; +use igneum_prove_core::executor::load_pre_state; +use igneum_prove_core::shard::{build_shards, shard_statement}; +use igneum_prove_core::Fixture; +use std::path::PathBuf; + +fn fixtures_dir() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../fixtures") +} +// This test lives in the export crate, not in igneum-prove-core, so the core's manifest (part of the guest build) +// stays untouched: the export crate already has serde_json and is never part of the guest build. Checked on +// 5 October 2026: built in one directory, this branch and master give byte-identical guest ELF segments. + +fn load(name: &str) -> Fixture { + let path = fixtures_dir().join(name); + let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("read {}: {e}", path.display())); + let f: Fixture = serde_json::from_str(&text).unwrap_or_else(|e| panic!("parse {}: {e}", path.display())); + assert_eq!(f.format, igneum_prove_core::fixture::FORMAT, "{name}: fixture format"); + f +} + +/// Runs the exporter's own check on one fixture: block statement against the expected values, the cut against +/// the plan, every shard's witness statement against the plan's roots and links. +fn check(name: &str) { + let f = load(name); + let budget = f.plan.shard_budget; + // The exporter builds the plan with the zero address as the prover; the roots do not depend on it. + let (outcome, pre_root, shards) = build_shards(&f.block, budget, Address::ZERO); + let e = &f.expected; + assert_eq!(pre_root, e.pre_state_root, "{name}: pre-state root"); + assert_eq!(outcome.state_root, e.post_state_root, "{name}: post-state root"); + assert_eq!(e.post_state_root, e.node_state_root, "{name}: the exporter's root is the node's"); + assert_eq!(outcome.receipts_root, e.receipts_root, "{name}: receipts root"); + assert_eq!(outcome.tx_commitment, e.tx_commitment, "{name}: tx commitment"); + assert_eq!((outcome.gas_used, outcome.pgas_used), (e.gas_used, e.pgas_used), "{name}: gas and pgas"); + assert_eq!((outcome.executed.len(), outcome.skipped.len()), (e.executed as usize, e.skipped as usize), "{name}: executed and skipped"); + assert_eq!(shards.len(), f.plan.shards.len(), "{name}: shard count"); + for (s, x) in shards.iter().zip(&f.plan.shards) { + let o = &s.output; + let tag = format!("{name} shard {}", x.index); + assert_eq!(s.spec.index, x.index, "{tag}: index"); + assert_eq!((s.spec.tx_start, s.spec.tx_end), (x.tx_start, x.tx_end), "{tag}: range"); + assert_eq!(s.spec.over_budget, x.over_budget, "{tag}: over budget"); + assert_eq!(o.pre_root, x.pre_root, "{tag}: pre-root"); + assert_eq!(o.post_root, x.post_root, "{tag}: post-root"); + assert_eq!(o.receipts_root, x.receipts_root, "{tag}: receipts root"); + assert_eq!((o.link_in, o.link_out), (x.link_in, x.link_out), "{tag}: links"); + assert_eq!((o.gas_used, o.pgas_used), (x.gas_used, x.pgas_used), "{tag}: gas and pgas"); + assert_eq!((o.executed, o.skipped), (x.executed, x.skipped), "{tag}: executed and skipped"); + // The statement recomputed from the shard input alone (what the guest does) is the same statement. + assert_eq!(shard_statement(&s.input), *o, "{tag}: statement from the input"); + } + // The shards chain and end at the block's root. + assert_eq!(shards.first().map(|s| s.output.pre_root), Some(e.pre_state_root), "{name}: first shard starts at the pre-root"); + assert_eq!(shards.last().map(|s| s.output.post_root), Some(e.post_state_root), "{name}: last shard ends at the post-root"); + for w in shards.windows(2) { + assert_eq!(w[0].output.post_root, w[1].output.pre_root, "{name}: shards chain on roots"); + assert_eq!(w[0].output.link_out, w[1].output.link_in, "{name}: shards chain on links"); + } +} + +#[test] +fn every_fixture_reproduces() { + let mut names: Vec = std::fs::read_dir(fixtures_dir()) + .expect("proving/fixtures") + .filter_map(|e| e.ok()) + .map(|e| e.file_name().to_string_lossy().into_owned()) + .filter(|n| n.ends_with(".json")) + .collect(); + names.sort(); + assert!(names.len() >= 7, "fixtures present: {names:?}"); + for n in &names { + check(n); + } +} + +#[test] +fn an_empty_segment_shard_ends_at_the_root_after_the_rewards() { + let name = "block-58927-empty-reward.json"; + let f = load(name); + let b = &f.block; + assert!(b.blocks.iter().all(|x| x.txs.is_empty()), "the block carries no transactions"); + assert_eq!(b.rewards.len(), 1, "one blue block, one reward"); + assert!(b.payouts.is_empty(), "no payouts in this segment"); + assert!(!b.proving_pool_credit.is_zero(), "the pool credit is part of the statement"); + + let (outcome, pre_root, shards) = build_shards(b, f.plan.shard_budget, Address::ZERO); + assert_eq!(shards.len(), 1, "an empty segment is one shard"); + let s = &shards[0]; + assert_eq!((s.spec.tx_start, s.spec.tx_end), (0, 0)); + assert_eq!(s.output.pre_root, pre_root); + assert_ne!(s.output.post_root, pre_root, "the rewards move the root: the post-root is never the pre-root"); + assert_eq!(s.output.post_root, f.expected.node_state_root, "the witness statement ends at the node's root"); + assert_eq!(s.spec.post_root, f.expected.node_state_root, "the plan ends the empty shard at the node's root, not the pre-root"); + assert_eq!(outcome.state_root, f.expected.node_state_root); + + // The rule itself, by hand: rewards to each blue miner, the 20% credit to the pool escrow, then the payouts + // (none here), before any transaction; the root after that is the shard's post-root. + let mut db = load_pre_state(b); + assert_eq!(db.state_root(), pre_root); + for (miner, wei) in &b.rewards { + db.add_balance(*miner, *wei); + } + db.add_balance(PROVING_POOL_ADDRESS, b.proving_pool_credit); + for (to, wei) in &b.payouts { + db.sub_balance(PROVING_POOL_ADDRESS, *wei); + db.add_balance(*to, *wei); + } + assert_eq!(db.state_root(), s.output.post_root, "rewards, pool credit and payouts, nothing else"); + + // The pre-root PC 2 printed on the right of its assertion is what a planner without the fix would return. + let wrong: B256 = pre_root; + assert_ne!(s.spec.post_root, wrong); +} diff --git a/proving/igneum-prove/host/Cargo.toml b/proving/igneum-prove/host/Cargo.toml index 479b6939..f6d0debe 100644 --- a/proving/igneum-prove/host/Cargo.toml +++ b/proving/igneum-prove/host/Cargo.toml @@ -22,6 +22,9 @@ tokio = { version = "1", features = ["rt-multi-thread", "time"] } [build-dependencies] sp1-build.workspace = true +# the source stamp (build.rs) +sha2 = "0.10" +hex.workspace = true [features] default = [] diff --git a/proving/igneum-prove/host/build.rs b/proving/igneum-prove/host/build.rs index ac251831..35b96a4d 100644 --- a/proving/igneum-prove/host/build.rs +++ b/proving/igneum-prove/host/build.rs @@ -1,4 +1,32 @@ +//! Builds the two SP1 guests and stamps the host with a hash of the native sources it was built from +//! (`IGNEUM_PROVE_SOURCES`, printed in the host's first line; the guests have their own identity, the shard +//! program's verifying key). Same purpose and recipe as export/build.rs (the stale-build class of 5 October +//! 2026): `cat $(ls core/src/*.rs host/src/*.rs | sort) | shasum -a 256 | cut -c1-16` in proving/igneum-prove. + +use sha2::{Digest, Sha256}; +use std::path::Path; + fn main() { sp1_build::build_program("../program"); sp1_build::build_program("../aggregator"); + + let root = Path::new(env!("CARGO_MANIFEST_DIR")).join(".."); + let mut files: Vec = Vec::new(); + for dir in ["core/src", "host/src"] { + for entry in std::fs::read_dir(root.join(dir)).expect("source dir") { + let name = entry.expect("entry").file_name().to_string_lossy().into_owned(); + if name.ends_with(".rs") { + files.push(format!("{dir}/{name}")); + } + } + } + files.sort(); + let mut h = Sha256::new(); + for f in &files { + let path = root.join(f); + println!("cargo:rerun-if-changed={}", path.display()); + h.update(std::fs::read(&path).expect("read source")); + } + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rustc-env=IGNEUM_PROVE_SOURCES={}", &hex::encode(h.finalize())[..16]); } diff --git a/proving/igneum-prove/host/src/main.rs b/proving/igneum-prove/host/src/main.rs index 99107fdd..763a7ca6 100644 --- a/proving/igneum-prove/host/src/main.rs +++ b/proving/igneum-prove/host/src/main.rs @@ -82,7 +82,8 @@ fn run() -> Result<()> { let txs: usize = block.blocks.iter().map(|b| b.txs.len()).sum(); let prover_kind = std::env::var("SP1_PROVER").unwrap_or_else(|_| "cpu".into()); println!( - "fixture {path}: chain {} block {} ({}), {txs} transactions in {} including blocks, {} accounts in the pre-state, plan {} shard(s) at S_p = {} pgas{}; SP1_PROVER={prover_kind}; prover payout {prover}; {}", + "igneum-prove-host sources {}: fixture {path}: chain {} block {} ({}), {txs} transactions in {} including blocks, {} accounts in the pre-state, plan {} shard(s) at S_p = {} pgas{}; SP1_PROVER={prover_kind}; prover payout {prover}; {}", + env!("IGNEUM_PROVE_SOURCES"), block.chain_id, block.env.number, block.env.hash,