白名单商店 (Whitelisted Store)
To ensure that there is no race condition in writing to stores, each order matching goroutine will operate on a whitelisted store where it can only write to whitelisted prefixes. Right now the whitelist only contains the wasm
store of the contract itself, as well as DEX module's internal states specific to that contract. In other words, if a contract sends out state-mutating messages to other modules (e.g. bank) or other contracts' execute
endpoint during order matching (i.e. in the response of one of its sudo
endpoints), its order matching process will fail.
为了确保写入存储没有竞争条件,每个订单匹配Go协程(goroutine)将在白名单存储上运行,它只能写入白名单前缀。目前,白名单仅包含合约本身的wasm
存储,以及特定于该合约的 DEX 模块的内部状态。换句话说,如果合约在订单匹配期间(即在其sudo
端点之一的响应中)向其他模块(例如银行)或其他合约的execute
端点发送状态变化消息,则其订单匹配过程将失败。
Note that it's okay for a contract to send out order placement/cancellation messages to other contracts during order matching, since those messages are handled by the DEX module.
请注意,在订单匹配期间,合约可以向其他合约发送下单/取消信息,因为这些消息由 DEX 模块处理。
最后更新于