Commit 47f246a
fix(ledger): parse genesis staking pool vrf/owners/metadata fields (#1859)
PoolRegistrationCertificate.UnmarshalJSON read only the on-chain/API field
names (vrfKeyHash, poolOwners, poolMetadata, operator), but Shelley genesis
staking.pools uses vrf, owners, metadata, and publicKey for the same values. As
a result a pool declared in genesis parsed with an all-zeros VRF key hash (and
dropped owners and metadata). A zero VRF key hash breaks consensus header
VRF-key validation: the pool's blocks are rejected because their real VRF key
does not match the zero registered value.
Accept both name sets, preferring the on-chain/API name when both are present.
Assert the parsed VRF key hash in the InitialPools/PoolById tests, which
previously only checked cost, so the field-name mismatch went unnoticed.
Signed-off-by: Chris Guiney <chris@guiney.net>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9adf670 commit 47f246a
2 files changed
Lines changed: 61 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
528 | 538 | | |
529 | 539 | | |
530 | 540 | | |
| |||
533 | 543 | | |
534 | 544 | | |
535 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
536 | 565 | | |
537 | 566 | | |
538 | 567 | | |
| |||
545 | 574 | | |
546 | 575 | | |
547 | 576 | | |
548 | | - | |
| 577 | + | |
549 | 578 | | |
550 | 579 | | |
551 | 580 | | |
| |||
585 | 614 | | |
586 | 615 | | |
587 | 616 | | |
588 | | - | |
589 | | - | |
| 617 | + | |
| 618 | + | |
590 | 619 | | |
591 | 620 | | |
592 | 621 | | |
593 | 622 | | |
594 | 623 | | |
595 | 624 | | |
596 | 625 | | |
597 | | - | |
598 | | - | |
| 626 | + | |
| 627 | + | |
599 | 628 | | |
600 | 629 | | |
601 | 630 | | |
602 | 631 | | |
603 | 632 | | |
604 | 633 | | |
605 | 634 | | |
606 | | - | |
607 | | - | |
608 | | - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
609 | 638 | | |
610 | 639 | | |
611 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
323 | 335 | | |
324 | 336 | | |
325 | 337 | | |
| |||
369 | 381 | | |
370 | 382 | | |
371 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
372 | 396 | | |
373 | 397 | | |
374 | 398 | | |
| |||
0 commit comments