In the past, I could dedupe on the tx part of the Value map. Now that the type is moving out of the TX it isn’t as easy. Of course, I can inject it…or in the case of icrc1 and icrc2 put both the type and the op in the block.
I’ve received a lot of feedback during the weekend (thanks!). I’m going to discard the motion proposal I was writing and make some adjustments to the ICRC-3 draft based on that feedback. SpecificallyL
fix typos
Change the name of the field type to something that is not a keyword in most languages, e.g. btype (we have phash so…)
Explain what happens if both btype and tx.op are defined (btype has priority)
Explain what the endpoint icrc2_supported_block_types returns in the default (ICRC-1 and ICRC-2) case when the Ledger doesn’t support btype yet. There are two options: a) the Ledger returns nothing or b) the Ledger returns 1burn, 1mint, 2xfer and 2approve even if the btypes are not set yet in the blocks. I think b) is better because it allows to compose the default behavior with other standards.
I’ve pushed a new version of the draft and replaced type with btype. You can find the preview here. Once again I’ll wait a couple of days for comments.
If both are specified then tx.op should be ignored and btype should be used.
Can we be specific about what ‘ignored’ here means? Is it ignored when calculating the hash? Or just when calculating the state of a canister from Genesis?
I’d prefer letting it be included in the hash calc if present as including it makes deduplication much easier and removing it when calculating hashes would likely be an expensive operation.
Hmmm…this is confusing to me. And a bit complex from a library perspective. Ideally, an ICRC1 library should exist without having to have any information about what ICRC2 is. The ICRC2 library is like an add-on.
Is there any reason why icrc1_transfer can’t use 1xfer and icrc2_transfer_from use 2xfer? Theoretically, we shouldn’t have a 1xfer with a spender right?
Should they be defined as different blocks with separate schemas?
If my ICRC1 library has to know if it is in ICRC2 mode it kind of creates a circular dependency.
Good point, I’ll change the draft. By the way, today’s working group is going to be again about ICRC-3 and the latest updates. If you are interested in the standard then join us!
Rosetta is not dependent on ICRC-3 and it’s using the interface for fetching blocks that the existing canisters provide (get_blocks to be specific). This allowed us to develop Rosetta without having to wait for the standard to be voted.
Rosetta is currently feature complete and we just did the security review. The team is now addressing the findings and then we can release it.
The plan is to eventually move Rosetta to use ICRC-3 to fetch the blocks but that doesn’t block the release of Rosetta.
Does anyone have any thoughts on how one should write a motoko float into an ICRC3 transaction log?
Is there a quick and dirty function to get the components of a float so it can all be put back together again? If so we can do a map of those components.
The options I’m seeing are outputting text with #exact, but I’m not sure how to put the bbs back in the box with that.
Can we not get the sign, exp, and Mantissa exposed to motoko? Can Prim do it?