docs: CONTRIBUTING guide section on adding invoice options (#703) - #733
Merged
Kingsman-99 merged 1 commit intoAug 30, 2026
Merged
Conversation
|
@christy-dev4 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add "Adding Invoice Options" section to CONTRIBUTING.md
Summary
Closes #703
This PR adds a new "Adding Invoice Options" section to
CONTRIBUTING.mdthat documents, for new contributors, exactly how to extend the invoice option
surface without breaking Soroban's
#[contracttype]field limits or theon-chain storage layout.
The section was written after reading the actual storage types
(
InvoiceOptions,InvoiceOptions2,InvoiceCore,InvoiceExt,InvoiceExt2,InvoiceExt3incontracts/split/src/types.rs) and themigration framework (
contracts/split/src/migrations.rs), so the guidancematches the code rather than guesses at it.
Acceptance Criteria mapping
CONTRIBUTING.md## Adding a new invoice option fieldsection#[contracttype]constraint and theInvoiceOptions/InvoiceOptions2split#[contracttype]constraint" subsectionInvoiceCore/InvoiceExt/InvoiceExt2storage split and when to use eachMigrationRequiredwarningWhat the new section covers
#[contracttype]structs cap at 40 fields;InvoiceOptionssits at/near that ceiling andInvoiceOptions2is theoverflow bucket. New optional fields go to
InvoiceOptionsonly when it hasroom, otherwise to
InvoiceOptions2. Order/offsets are part of the on-chainXDR layout, so existing fields must never be reordered or deleted to make room.
InvoiceCore(hot-path always-presentfacts),
InvoiceExt(default home for optional behavior),InvoiceExt2(dispute/auction/oracle/overflow extension state), and
InvoiceExt3(newestbucket), with a rule of thumb that optional fields belong in the
Extstructs, not
InvoiceCore.→ wire the copy in
create_invoice+ default constructors → thread throughreads/updates → update
STORAGE_KEY_REGISTRY.mdif a new key is introduced →bump
CURRENT_SCHEMA_VERSIONand add amigration_vN→ tests → docs.mint_receiptsoption added toInvoiceOptions2, mirrored intoInvoiceExt2, copied at creation, defaulted,and covered by a migration + tests.
Testing
This is a documentation-only change; no contract code is modified, so
cargo testbehavior is unchanged. I verified the file renders correctly andthe new anchors/links point at real paths in the repo.
cargo fmt --check # docs-only; no Rust changesNotes for reviewers
InvoiceExt3even though issue Add CONTRIBUTING guide section on how to add new invoice options #703only named
InvoiceCore/InvoiceExt/InvoiceExt2, because the fileactually defines
InvoiceExt3(types.rs:1475) and contributors will hit itin practice.
is called out prominently because a missed schema bump makes every entry point
panic with
MigrationRequiredon already-deployed contracts.closes #703