🔁 Refresh channel accounts section - #2703
Open
JFWooten4 wants to merge 30 commits into
Open
Conversation
Co-authored-by: Codex <noreply@openai.com>
Contributor
There was a problem hiding this comment.
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
StellarSdkis not defined by the destructuring import. Use the importedOperationsymbol 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.Builderandnew PaymentOperation.Builder(...)APIs, so it cannot compile with Java SDK 4.x. Migrate it toTransactionBuilderandPaymentOperation.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 thiswhileloop 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,
IncrementSequenceNummay 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"
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>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
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.
from #723