I noticed that at least one production implementation of ICRC-1 ledger (link) ignores the deduplication part of the spec; it only records the created_at_time field in a block.
We should specify how a ledger opts out of the deduplication mechanism. I see at least three options:
- Always return
TooOld or CreatedInFuture if the caller specified created_at_time (effectively setting TX_WINDOW and PERMITTED_DRIFT to zero).
- Reject the call (e.g.,
trap) if the caller specified created_at_time.
- Introduce our first generic error
{ error_code = 1; message = "ICRC-1: deduplication not supported"}.
I prefer the last option with the generic error because it’s the most explicit one. On the other hand, the test suite expects the first option:
|
Err(TransferError::TooOld) => { |
I noticed that at least one production implementation of ICRC-1 ledger (link) ignores the deduplication part of the spec; it only records the
created_at_timefield in a block.We should specify how a ledger opts out of the deduplication mechanism. I see at least three options:
TooOldorCreatedInFutureif the caller specifiedcreated_at_time(effectively settingTX_WINDOWandPERMITTED_DRIFTto zero).trap) if the caller specifiedcreated_at_time.{ error_code = 1; message = "ICRC-1: deduplication not supported"}.I prefer the last option with the generic error because it’s the most explicit one. On the other hand, the test suite expects the first option:
ICRC-1/test/suite/lib.rs
Line 723 in af20f05