-
Notifications
You must be signed in to change notification settings - Fork 242
Description
Background
Token pools are initialized with two steps:
- The actual pool is initialized on a blockchain smart contract
- The pool details (namespace, name, etc) are announced as a FireFly definition broadcast
The pool creator is responsible for sending 2 only after 1 is confirmed. However, because these steps may or may not occur on the same blockchain, there are multiple possible ways for them to play out.
Scenarios
A) 1 and 2 both arrive and are guaranteed to be in that order for all nodes
This is true for the case where tokens and messages are backed by the same blockchain (such as when using Ethereum with ERC1155). Each node may receive and record the blockchain transaction, then fill in the rest of the pool details after the announcement broadcast.
B) 1 and 2 both arrive, but 2 may arrive before 1
This is possible in cases where tokens and messages are backed by different blockchains. It should be uncommon, but networking conditions (for instance) could cause a particular node to receive 2 quickly while 1 is delayed. There must be a way to save the details from 2 but "rewind" and complete the message processing once 1 is received.
C) Only 2 arrives, and 1 must be looked up on demand
This is envisioned for cases where the "token pool" is a pre-existing set of tokens (could be on mainnet or a pre-existing private chain). In this case, step 1 for the author involves simply passing details about the existing tokens, but there will be no new blockchain transaction to define the pool. Therefore, the other nodes receiving the broadcast in step 2 must also have a way to lookup and verify the pre-existing token pool.