Blockchains are decentralized systems that provide trustable execution guarantees. Smart contracts are programs written in specialized programming languages running on blockchains that govern how tokens and cryptocurrency are sent and received. Smart contracts can invoke other smart contracts during the execution of transactions always initiated by external users. Once deployed, smart contracts cannot be modified, so techniques like runtime verification are very appealing for improving their reliability. However, the conventional model of computation of smart contracts is transactional: once operations commit, their effects are permanent and cannot be undone. In this paper, we proposed the concept of future monitors which allows monitors to remain waiting for future transactions to occur before committing or aborting. This is inspired by optimistic rollups, which are modern blockchain implementations that increase efficiency (and reduce cost) by delaying transaction effects. We exploit this delay to propose a model of computation that allows (bounded) future monitors. We show our monitors correct respect of legacy transactions, how they implement future bounded monitors and how they guarantee progress. We illustrate the use of future bounded monitors to implement correctly multi-transaction flash loans.
翻译:区块链是一种去中心化系统,能够提供可信的执行保障。智能合约是用专用编程语言编写的程序,运行在区块链上,管理代币与加密货币的收发。在由外部用户发起的交易执行过程中,智能合约可以调用其他智能合约。一旦部署,智能合约便不可修改,因此运行时验证等技术对于提升其可靠性极具吸引力。然而,智能合约的传统计算模型是事务性的:一旦操作提交,其效果就是永久的且无法撤销。在本文中,我们提出了未来监控器的概念,它允许监控器在提交或中止操作之前,持续等待未来交易的发生。这一构想受乐观汇总的启发——这是一种现代区块链实现,通过延迟交易效果来提升效率(并降低成本)。我们利用这种延迟提出了一种计算模型,支持(有界的)未来监控器。我们证明了监控器能正确遵守传统交易,展示了它们如何实现未来有界监控器,并论证了它们如何保证进度推进。此外,我们通过实现正确的多交易闪电贷,说明了未来有界监控器的应用。