...
Verifying StateFullTransaction does not depend on external state, so the VM for verifying transactions is StateLess, and the Layer2 smart contract code on which the transaction execution depends is also included in the ReadSet.
智能合约的依赖
...
Dependency of Smart Contracts
区块链分层后,给智能合约之间的依赖关系带来了难题,Layer2 的合约能否依赖 Layer 1 的合约?这里的依赖包含两层意义,一代码的依赖,二状态的依赖。在 Ethereum 上,合约之间不能在编译期依赖,合约之间的依赖都是通过合约内的动态调用的方式实现的,一和二是同一个问题。这个问题在Ethereum 当前的所有 Layer2 方案中,都未得到很好的解决。再 Stargate 中,由于 Move 的静态依赖的特性,Layer2 可以在编译期直接依赖 Layer1 的合约。当 Layer2 的合约执行时:的合约?这里的依赖包含两方面的意义,一代码的依赖,二状态的依赖。当前的所有分层方案中,跨层的合约依赖问题都没有得到很好的解决,只能通过异步消息的机制互通。
After the blockchain is layered, the dependency relationship between smart contracts brings a difficult challenge: Can Layer2 contracts depend on Layer1 contracts? The dependency here contains two meanings, one is the dependency of code and the other is the dependency of state. In all current layered solutions, the problem of cross-layer contract dependency has not been well solved, and can only be interoperated through the mechanism of asynchronous messages.
在 Stargate 中,基于 Move 的静态依赖的特性,Layer2 可以在编译期直接依赖 Layer1 的合约。当 Layer2 的合约执行时,执行上下文的切换如下图所示:
In Stargate, Layer2 can depend on Layer1's contract directly at compile time due to the static dependency feature of Move. When Layer2's contract executes, the execution context switches as shown in the following figure:
Drawio | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...