class v5: program_id_derivation takes the rung-0 plain form for class v5 as program_id does (the text follows the id); spec 1.4.7.5's id table in the read-back reader's shape (bare 64-hex epoch seed, the era in the Note; the no-era v4 control is the packs test's, not a chain row); 1.4.7.1 names the rung-0 and above-rung-0 forms
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
fd7a1d8a6e
commit
b6ef33f357
2 changed files with 8 additions and 6 deletions
|
|
@ -319,7 +319,7 @@ Implemented (`igneum-pow/src/state.rs`, `memhard.rs`, `generator.rs`, `accept.rs
|
|||
|
||||
#### 1.4.7.1 Load class, generator version and program id
|
||||
|
||||
The load class is `mx8+sh256x27+state` (`V5_CLASS = LoadClass { state: true, ..V4_CLASS }`); with an era seed it reads `mx8-era<8 hex>+sh256x27+state` (section 1.13.1's draw inside it, as class v4's). The generator version is 5. The program id is `FNV-1a-64("igneum-program/" || 5_le32 || seed words as little-endian bytes || attempt_le32)` with NO "sub/" suffix (the suffix of section 1.4.6 is class v4's sub-version mark; class v5 has no sub-versions: a rule change is a new class). The state flag changes the id and the dataset, never the base program or the shadow block: for a seed whose draw the class v5 rules do not move, the class v5 program's instruction list equals the class v4 program's of the same seed and attempt.
|
||||
The load class is `mx8+sh256x27+state` (`V5_CLASS = LoadClass { state: true, ..V4_CLASS }`); with an era seed it reads `mx8-era<8 hex>+sh256x27+state` (section 1.13.1's draw inside it, as class v4's). The generator version is 5. The program id at rung 0 of the ladder is `FNV-1a-64("igneum-program/" || 5_le32 || seed words as little-endian bytes || attempt_le32)` with NO "sub/" suffix (the suffix of section 1.4.6 is class v4's sub-version mark; class v5 has no sub-versions: a rule change is a new class); above rung 0 it is the class-bearing form of section 1.4.6 (`"igneum-program-rw/"` and the class's fields) with the field `"state/"` appended after the shadow's, so two rungs of one seed never share an id. The state flag changes the id and the dataset, never the base program or the shadow block: for a seed whose draw the class v5 rules do not move, the class v5 program's instruction list equals the class v4 program's of the same seed and attempt.
|
||||
|
||||
#### 1.4.7.2 Acceptance under class v5: part (c''')
|
||||
|
||||
|
|
@ -353,13 +353,12 @@ Class v5 is a program-class step like class v4's (section 2's class signal): the
|
|||
|
||||
The acceptance vectors of (c'''): seed 100767 of the f8 label space (epoch bytes the words of `igneum-attack-f8/program/100767`, era bytes of `igneum-attack-f8/era/100767`) is accepted under class v4 at attempt 2 (`9d68e6286fc817d4`, site 6 at 0.9919) and refused under class v5 at attempt 2 by (c''') naming site 6 at 0.991; the class v5 draw lands on attempt 4 (`734fbb8e3e4cd20f`); the genesis draws of both classes read 0.9990 at their minimum site. The day vector of AP-F4-1: chain day 29,337 under class v4 draws a mixer block of cost 203 and class v5 redraws it. The last-resort vector: seed adv3/steer/2 (`igneum-adv-accept-3/steer/2`, Devnet 3's genesis as the era) at attempt 256 fails part (a) at instruction 47 reading r3 under the class v4 rewrite; class v5's last resort passes at attempt 256 (`9b29c9481f6941d4`). The crate's tests hold every row (`tests/packs.rs`, `accept::tests`, `memhard::tests`, `generator::tests`).
|
||||
|
||||
The id table (read back by `igneum-pow/tests/spec_readback.rs`: every row is derived by the crate for that seed and attempt; "generator 5" in the Note selects class v5; the seed is the string, or `epoch <64 hex>` with `era <64 hex>` for a chain-shaped draw):
|
||||
The id table (read back by `igneum-pow/tests/spec_readback.rs`: every row is derived by the crate for that seed and attempt; "generator 5" in the Note selects class v5; the Seed cell is the seed string, or the 64-hex epoch seed bytes of a chain-shaped draw with the era named in the Note):
|
||||
|
||||
| Seed | Attempt | Id | Note |
|
||||
|---|---|---|---|
|
||||
| `igneum-genesis` | 0 | `7c54302b487340a1` | generator 5, class v5, no era (the `v5-genesis` pack) |
|
||||
| `igneum-genesis` | 0 | `a217c7f698880830` | generator 4, class v4 sub-version 3 control (the `v4-genesis` pack) |
|
||||
| epoch `4020cb4382e3fe4b281c817c02582e147d8f851f566ae9172b28912b8e68b925` era the same | 0 | `e5a4ac5978462156` | generator 5, class v5, Devnet 3 epoch 0 (the `v5-dn3-epoch0` pack) |
|
||||
| `igneum-genesis` | 0 | `7c54302b487340a1` | generator 5, class v5, no era (the `v5-genesis` pack; the `v4-genesis` control of the same seed, `a217c7f698880830`, is a no-era pack pinned by the packs test, not a chain row) |
|
||||
| `4020cb4382e3fe4b281c817c02582e147d8f851f566ae9172b28912b8e68b925` | 0 | `e5a4ac5978462156` | generator 5, class v5, era 4020cb4382e3fe4b281c817c02582e147d8f851f566ae9172b28912b8e68b925 (the same bytes), Devnet 3 epoch 0 (the `v5-dn3-epoch0` pack) |
|
||||
|
||||
#### 1.4.7.6 Constants
|
||||
|
||||
|
|
|
|||
|
|
@ -1151,7 +1151,10 @@ impl Program {
|
|||
/// "program_id_derivation"; spec 01 section 1.4.6).
|
||||
pub fn program_id_derivation(&self) -> String {
|
||||
let v4_rung_0 = self.generator == GENERATOR_VERSION_V4 && LoadClass { era: None, ..self.class } == V4_CLASS;
|
||||
if self.class.is_v2() || self.generator == GENERATOR_VERSION_V3 || v4_rung_0 {
|
||||
// class v5 at rung 0 takes the plain form as `program_id` does (the text follows the id; the first form of this
|
||||
// function named the class recipe for the v5 packs whose id was the plain one)
|
||||
let v5_rung_0 = self.generator == GENERATOR_VERSION_V5 && LoadClass { era: None, ..self.class } == V5_CLASS;
|
||||
if self.class.is_v2() || self.generator == GENERATOR_VERSION_V3 || v4_rung_0 || v5_rung_0 {
|
||||
program_id_recipe(self.generator, &self.seed, self.attempt).text()
|
||||
} else {
|
||||
program_id_class_recipe(self.generator, &self.seed, self.attempt, &self.class).text()
|
||||
|
|
|
|||
Loading…
Reference in a new issue