Commit a929556
fix(solana): route oversized atomic spawn-and-buy through a lookup table
The atomic spawn-and-buy (`buyRecord` with no `processId`) sends
`[CreateV1, initialize, buy_name]` in one transaction. That fits Solana's
1232-byte limit for a balance/credit-funded buy (~1116 bytes, one signature),
but a multi-source funding plan appends ~3 remaining accounts per source to
`buy_name` (~33 bytes each), pushing the tx over the limit — the RPC rejects it
with "VersionedTransaction too large" (observed 1776 bytes for ~7 sources).
Size-gate the atomic send: estimate the compiled size up front and send inline
when it fits (unchanged, single signature); otherwise route the whole
spawn-and-buy through the existing ephemeral Address Lookup Table path,
compressing every non-signer, non-invoked-program account (the mint stays inline
as a signer). A 20-source plan drops from 1776 to ~735 bytes after compression.
- send.ts: add `MAX_TX_SIZE_BYTES` + `estimateCompiledTxSize`; generalize
`sendWithEphemeralLookupTable` to accept an instruction array + `extraSigners`.
- io-writeable.ts: add `altEligibleAddresses`; size-gate the atomic buy; update
the `prescribe_epoch` caller to the array signature.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWv3xbxumjJa2zPeDPZvJX1 parent febd59c commit a929556
2 files changed
Lines changed: 148 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
443 | 478 | | |
444 | 479 | | |
445 | 480 | | |
| |||
1625 | 1660 | | |
1626 | 1661 | | |
1627 | 1662 | | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
1633 | 1699 | | |
1634 | 1700 | | |
1635 | 1701 | | |
| |||
3902 | 3968 | | |
3903 | 3969 | | |
3904 | 3970 | | |
3905 | | - | |
| 3971 | + | |
3906 | 3972 | | |
3907 | 3973 | | |
3908 | 3974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
610 | 613 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
616 | 674 | | |
617 | 675 | | |
618 | 676 | | |
619 | | - | |
| 677 | + | |
620 | 678 | | |
621 | 679 | | |
622 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
623 | 686 | | |
624 | 687 | | |
625 | 688 | | |
626 | 689 | | |
627 | 690 | | |
628 | | - | |
| 691 | + | |
629 | 692 | | |
630 | 693 | | |
631 | 694 | | |
| 695 | + | |
632 | 696 | | |
633 | 697 | | |
634 | 698 | | |
635 | 699 | | |
636 | | - | |
| 700 | + | |
637 | 701 | | |
638 | 702 | | |
639 | 703 | | |
| 704 | + | |
640 | 705 | | |
641 | 706 | | |
642 | 707 | | |
| |||
683 | 748 | | |
684 | 749 | | |
685 | 750 | | |
686 | | - | |
| 751 | + | |
687 | 752 | | |
688 | 753 | | |
689 | 754 | | |
690 | 755 | | |
691 | | - | |
| 756 | + | |
692 | 757 | | |
693 | 758 | | |
694 | 759 | | |
| 760 | + | |
695 | 761 | | |
696 | 762 | | |
697 | 763 | | |
| |||
0 commit comments