Skip to content

🔁 Refresh channel accounts section - #2703

Open
JFWooten4 wants to merge 37 commits into
stellar:mainfrom
john-stellar:refresh-channel-accounts
Open

JFWooten4 wants to merge 37 commits into
stellar:mainfrom
john-stellar:refresh-channel-accounts

Conversation

@JFWooten4

Copy link
Copy Markdown
Contributor

from #723

⚠️ Relies on images from #2400

Copilot AI review requested due to automatic review settings July 27, 2026 16:05
Co-authored-by: Codex <noreply@openai.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the channel accounts guide with architecture, security, throughput, and multi-SDK implementation guidance.

Changes:

  • Adds diagrams and channel-account concepts.
  • Adds Python, JavaScript, Java, and Go examples.
  • Documents rotation, fees, capacity, and operational considerations.

Recommendation: NEEDS-CHANGES — fix the non-runnable SDK examples, unsafe rotation logic, and inaccurate fee/capacity guidance.

Comments suppressed due to low confidence (8)

docs/build/guides/transactions/channel-accounts.mdx:129

  • StellarSdk is not defined by the destructuring import. Use the imported Operation symbol here as well.
  transaction2.addOperation(StellarSdk.Operation.payment({

docs/build/guides/transactions/channel-accounts.mdx:475

  • This second Java tab also uses the removed Transaction.Builder and new PaymentOperation.Builder(...) APIs, so it cannot compile with Java SDK 4.x. Migrate it to TransactionBuilder and PaymentOperation.builder() before publishing the refreshed guide.
  Transaction.Builder transactionBuilder = new Transaction.Builder(channelAccount, Network.TESTNET)
    .setBaseFee(Transaction.MIN_BASE_FEE);

  for (String recipient : allRecipients.get(i)) {
    transactionBuilder.addOperation(
      new PaymentOperation.Builder(recipient, AssetTypeNative.INSTANCE, "10")
        .setSourceAccount(primaryKeypair.getAccountId())

docs/build/guides/transactions/channel-accounts.mdx:714

  • This JavaScript loop has the same rotation deadlock: once every channel is active, no code marks one available until after this loop exits, which cannot happen while recipients remain. Process and await each wave before assigning another batch.
while (recipientIndex < allRecipients.length) {
  for (const channelData of channelAccountsTracker) {
    if (recipientIndex >= allRecipients.length) break;
    if (channelData.state === "available") {
      channelData.state = "active";

docs/build/guides/transactions/channel-accounts.mdx:878

  • This Go loop also deadlocks after one batch per channel because channel states are reset only in the submission loop below. If recipients remain after every channel becomes active, neither index nor state can change.
	for recipientIndex < len(allRecipients) {
		for _, channelData := range channelAccountsTracker {
			if recipientIndex >= len(allRecipients) {
				break
			}
			if channelData["state"] == "available" {

docs/build/guides/transactions/channel-accounts.mdx:783

  • The Java rotation loop cannot handle more than one batch per channel: after all channels become active, no state is reset until the later submission loop, so this while loop has no way to make progress. Submit and confirm each wave before continuing allocation.
  while (recipientIndex < allRecipients.length) {
    for (ChannelAccount channelData : channelAccountsTracker) {
      if (recipientIndex >= allRecipients.length) break;
      if (channelData.state.equals("available")) {
        channelData.state = "active";

docs/build/guides/transactions/channel-accounts.mdx:759

  • Even after awaiting submission, this unconditional release is unsafe on rejection or an unknown transport outcome: the local account sequence was advanced when the transaction was built, but the network may not have consumed it. Query/reload the channel account and reconcile the transaction before setting it available.
  } finally {
    channelData.state = "available";

docs/build/guides/transactions/channel-accounts.mdx:823

  • This releases the Java channel even when submission failed or its outcome is unknown. Because transaction construction advances the local account sequence, the next build can use a sequence that does not match the network; reconcile/reload the account before making it available.
    } finally {
        txBundle.channelData.state = "available";

docs/build/guides/transactions/channel-accounts.mdx:943

  • This marks the channel available after both success and failure without reconciling its sequence. When submission fails or times out, IncrementSequenceNum may have advanced only the local account, so reusing it can produce a sequence gap. Reload/verify the network account before release on non-confirmed outcomes.
		output.channelData["state"] = "available"

JFWooten4 and others added 26 commits July 27, 2026 12:38
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Refs stellar#2674 in that you can't see the history or independence of this value, relying instead on an asterisk footnote disclaimer in a busy table.
Replace the unsupported exponential fee claim with evidence-based wording. A 200-ledger February 2019 sample showed fees up to 80 times the minimum, while a 6,144-ledger March-June 2023 sample found a 50-times-minimum median for full ledgers and no exponential fit.

Co-authored-by: Codex <noreply@openai.com>
txnbuild.NewTransaction rejects params without built TimeBounds, and TransactionParams has no Network field.
@stellar-doxie

stellar-doxie Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Automated message from the Stellar Triage Bot.

Thanks for this PR. I saw it, but I will not review it unless someone calls me in.

How to reach me:

  • Anyone with write permission can call me in with a /triage comment or the bot:take label.
  • The PR author can send me away with /triage stop.
  • People with write permission can also use the bot:hands-off label.
  • A review request to a maintainer does not call me in. It asks for their judgment.

lindsey-pony Bot and others added 3 commits December 2, 2026 13:23
Preserve the expanded channel-account guide while incorporating upstream fee-selection guidance, additional SDK coverage, and the CodeGroup documentation component migration. Apply configurable illustrative fee bids consistently across the four SDKs without restoring the superseded single-payment examples. Maintain the distinction between transaction and operation sources, independent sequence numbers, and the required signatures.
Use Horizon's p90 charged fee per operation in each account-separation translation and refresh the estimate before each rotation wave. Preserve the minimum-fee sequence-number demonstration and label the first Java and Go code fences.

Co-authored-by: ChatGPT 6.2 <noreply@openai.com>
@mintlify

mintlify Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit cd46f6e.

Approve preview

JFWooten4 and others added 3 commits December 2, 2026 13:32
Convert relative MDX links to extensionless root-relative Mintlify routes, preserving section anchors. Move the six channel-account diagrams into the root assets directory without changing their contents.

Co-authored-by: ChatGPT 6.2 <noreply@openai.com>
Undo only the diagram relocation, retaining the absolute documentation links and original image contents.

Co-authored-by: ChatGPT 6.2 <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@stellar-doxie

stellar-doxie Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🤖 Automated message from Doxie.

Back on this because @JFWooten4 pushed new commits.

Thanks for the Mintlify fixes. Links, callouts, and image paths now look right.

Your fork refuses my push (403). Branch doxie/pr-2703-tab-order holds two fixes, one commit on top of your head cd46f6e:

  • Code tabs in the order JavaScript, Python, Go, then Java, as on the other guides.
  • No Starlight suggestion. Its repo has been archived since 2024.

To take them: git pull https://github.com/stellar/stellar-docs.git doxie/pr-2703-tab-order

One ask: the rotation examples mark a channel available after a failed submit. The build already raised that account's local sequence number, and stellar-core accepts only sequence + 1. So that channel's next transaction fails with tx_bad_seq. The text above the code says to reconcile first. Please make the code reload the account too.

Decision: should this guide grow on Horizon (Horizon snippets in four languages) while the docs call Horizon "nearing end-of-life"? Tracked in stellar/github-triage-bot#32. @kaankacar @ElliotFriend

No live preview was available, so I reviewed from the diff and the sources. Not run: the snippets in all four languages.

A maintainer can build the preview: open the Mintlify Preview (fork) check and click Approve preview.

Needs a decision.

What I checked
  • Head cd46f6e. Diff against main: the page rewrite plus six images under static/assets/channel-accounts/.
  • Links: every root-relative target and anchor exists on main (git grep of the headings).
  • Callouts: blank lines around every component tag match scripts/pad-component-tags.mjs.
  • Prettier: run 46940107941 at 933990e flagged only line 404, which is fixed at cd46f6e. No checks run exists at cd46f6e yet (fork workflows wait for approval), so mint validate and mint broken-links did not run.
  • Images: /static/assets/... matches the files' repo path, so it should serve. MIGRATING.md puts new images in assets/<section>/ (non-blocking). Not confirmed without a preview.
  • Sequence rule: stellar-core v30.0.0 src/transactions/TransactionFrame.cpp:1604 (seqNum + 1 != getSeqNum() without minSeqNum).
  • Starlight: stellar-deprecated/starlight archived=true (GitHub API); docs/learn/glossary.mdx:311 says the same.
  • Mainnet max_tx_set_size is 1000 (horizon.stellar.org ledger 65790017, 2026-12-02).
  • Horizon status: docs/data/apis/index.mdx:30 ("nearing end-of-life").
  • Tab order rule: ElliotFriend on Standardize on the languages of the examples throughout the Guides section #1770 (JavaScript, Python, Go, then Java).
  • Copilot: all 23 threads are resolved.
  • Sweep: no other page mentions Starlight.
  • Checked against stellar-core v30.0.0 (newest). The page pins no SDK version. I did not check the snippets against SDK source.

@stellar-doxie stellar-doxie Bot added the bot:needs-decision Bot needs a maintainer decision (listing, scope, policy) label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:needs-decision Bot needs a maintainer decision (listing, scope, policy)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants