docs(ledgers): add Transaction deduplication section#172
Merged
Conversation
Extracted the single-sentence deduplication note from ### Fee handling into a dedicated ### Transaction deduplication section. Covers what the ledger tracks, how to enable it (Motoko and Rust), the Duplicate response and its duplicate_of field, and the TooOld / CreatedInFuture boundary errors. References the existing code examples above rather than adding redundant tabs. Updated the bitcoin.mdx CLI note to link to #transaction-deduplication instead of the broader #transferring-assets-icrc-1 anchor.
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.
Summary
Adds a dedicated
### Transaction deduplicationsection todocs/guides/digital-assets/ledgers.mdx, immediately after### Fee handling.Previously, deduplication was a single sentence at the end of
### Fee handling: "Always setcreated_at_timeto enable deduplication. Without it, two identical transfers submitted within 24 hours both execute." Fee handling and deduplication are separate concerns, and a developer scanning the page for deduplication guidance would not find it there.The new section covers:
(args, created_at_time)pairs and rejects exact duplicates within 24 hours withDuplicate { duplicate_of: block_index }. Theduplicate_offield lets you confirm the original succeeded without re-submitting.sendTokens(Motoko:Nat64.fromNat(Int.abs(Time.now()))) andsend_tokens(Rust:ic_cdk::api::time()) examples already on the page — no redundant code tabs needed.TooOld(timestamp older than 24h, window no longer tracked) andCreatedInFuture { ledger_time }(timestamp ahead of ledger time,ledger_timefield helps diagnose clock drift).nullis acceptable: one-off manual CLI calls where double-submission is not a concern.Also updates the
bitcoin.mdxCLI note to link to#transaction-deduplicationinstead of the broader#transferring-assets-icrc-1anchor.Related
Sync recommendation
Hand-written. Content is derived from the ICRC-1 specification (
created_at_timededuplication semantics) and verified against the existing Motoko/Rust examples in this file.