
Cost-Eective Data Feeds to Blockchains via Workload-Adaptive Data Replication Kai Li Yuzhe Tang∗ Jiaqi Chen [email protected] [email protected] [email protected] Syracuse University Syracuse University Syracuse University Syracuse, NY Syracuse, NY Syracuse, NY Zhehu Yuan† Cheng Xu Jianliang Xu [email protected] [email protected] [email protected] New York University Hong Kong Baptist University Hong Kong Baptist University New York, NY Kowloon, Hong Kong Kowloon, Hong Kong Abstract CCS Concepts: • Security and privacy Distributed ! systems security; • Information systems Remote Feeding external data to a blockchain, a.k.a. data feed, is ! an essential task to enable blockchain interoperability and replication. support emerging cross-domain applications. Given the data- Keywords: Blockchains, data feeds, authenticated data struc- intensive nature of real-life feeds (e.g., high-frequency price tures, data replication, workload awareness, DeFi. updates) and the high cost of using blockchain, namely Gas, it is imperative to reduce the Gas cost of data feeds. Moti- ACM Reference Format: vated by the constant-changing workloads in nancial ap- Kai Li, Yuzhe Tang, Jiaqi Chen, Zhehu Yuan, Cheng Xu, and Jian- liang Xu. 2020. Cost-Eective Data Feeds to Blockchains via plications, this work aims at designing a dynamic, workload- Workload-Adaptive Data Replication . In Middleware’20: ACM/I- approach for Gas cost optimization. This design space aware FIP Middleware, Dec. 7-11, DELFT, The Netherlands. ACM, New York, is understudied in existing blockchain research which has NY, USA, 15 pages. so far focused on static data placement. This work presents GRuB, a cost-eective data feed that 1 Introduction dynamically replicates data between the blockchain and o- A smart contract is a user program that runs on a blockchain, chain cloud storage. GRuB monitors the current workload such as Ethereum [10] and EOS.IO [5]. It holds the promises and makes data-replication decisions in a workload-adaptive to expand the blockchain’s functionalities from the basic fashion. Online algorithms are proposed to bound the worst- cryptocurrency payments to broader applications in decen- case cost in Gas. GRuB’s decision-making components run tralized nance (DeFi), supply chains, online gaming, et al. on the untrusted cloud o-chain for lower Gas, and employs Feeding external data onto the blockchain, a.k.a. data feed, a security protocol to authenticate the data transferred be- is an essential task to enable these blockchain applications. tween the blockchain and cloud. We built a GRuB prototype Today, data feeds are widely adopted, notably in DeFi. For on Ethereum and supported real nancial applications. Us- instance, stablecoins, a cryptocurrency with stable price that ing the workloads reconstructed from Ethereum transaction sees an explosion of interest (as in Facebook’s Libra [11]) history, we evaluate GRuB’s cost and show a Gas saving by and deployment (as in the popular DAI [23] and Tether [24] 10% 74%, in comparison with the static baselines. tokens on Ethereum) since 2019, require feeding real-world ⇠ asset prices to the blockchain, for instance the Ether-price ∗ Corresponding author. feed used in DAI [23]. For another instance, to enable asset † Work is done when the author is an undergraduate at Syracuse University. exchange across dierent blockchains, say allowing a Bitcoin owner to transact with an Ethereum token owner, it entails Permission to make digital or hard copies of all or part of this work for a “side-chain” feed such as BtcRelay [2, 8, 69] to send the re- personal or classroom use is granted without fee provided that copies are not made or distributed for prot or commercial advantage and that copies bear cently found Bitcoin blocks onto Ethereum for verifying Bit- this notice and the full citation on the rst page. Copyrights for components coin deposit. There are many other blockchain applications of this work owned by others than ACM must be honored. Abstracting with that have been or can be enabled by data feeds, including credit is permitted. To copy otherwise, or republish, to post on servers or to decentralized insurance [71], tracing supply-chains [17, 65], redistribute to lists, requires prior specic permission and/or a fee. Request healthcare [51], transparency logging [14, 30, 66], trustless permissions from [email protected]. information-security [15], et al. Middleware’20, DEC 2020, DELFT © 2020 Association for Computing Machinery. Operating today’s data feeds can be an expensive busi- ACM ISBN 978-1-4503-XXXX-X/18/06...$15.00 ness. Specically, many real-world data feeds generate an Doi: 10.1145/3423211.3425696 intensive stream of data updates at a high frequency (e.g., 1 371 Middleware’20, DEC 2020, DELFT Kai Li, Yuzhe Tang, Jiaqi Chen, Zhehu Yuan, Cheng Xu, and Jianliang Xu the price updates in seconds and microseconds). Under these (the trusted blockchain and untrusted cloud) should be dier- data-intensive streams, data feeds, if improperly designed, entiated from the existing work considering only untrusted could cause a heavy use of blockchain and lead to high mon- cloud services [57, 63] and one trusted cloud service out of etary cost, known as Gas [68]. The expense burdens not only multiple clouds [29, 32]. data-feed operators (e.g., ChainLink and MakerDAO) but also the nancial applications running on top of the data feeds Data-consumer DU smart contracts (e.g., decentralized exchanges such as AmpleForth and Syn- smart contracts (DUs) Callbacks gGet theix [48]), eventually transferring to high fees for end users Queries (internal (e.g., users of decentralized exchanges). It is thus impera- calls) Storage-manager Data gPuts smart contract tive to design cost-eective data feeds for scaling blockchain updates KV store applications to support real-world data-intensive scenarios. Storage- Dynamic data replication manager Data The goal of this work is to explore how a dynamic, smart contract producer DO Cloud storage provider (SP) workload-aware design of data feed can eectively save Gas. (DO) The design goal is motivated by 1) the observation that real- world nancial applications exhibit highly dynamic work- Conventional data feed GRuB s data feed (hybrid KV store) load patterns, which present opportunities to reduce costs Figure 1. GRuB’s system models in comparison with the — Intuitively, if one can dynamically adjust the location of model of conventional data feed. Green in this gure illus- the data feeds (w.r.t. the blockchain) according to the current trates smart contracts running on a blockchain, and red is data supply-demand, the Gas cost caused by the repeated the cloud service provider SP who is the adversary. use of blockchains could be avoided. See the next two para- The key decision to make in GRuB is whether and when a graphs for a detailed justication. 2) Furthermore, the design data record in the feed should be replicated onto the smart- space of a workload-aware approach has not been studied contract storage on a blockchain. Always storing a replica in the existing blockchain-systems research. While there of the data being read, on the one hand, can benet future is a large body of research works on reducing blockchain data reads by avoiding loading data onto the blockchain re- costs, notably the layer-two protocols exemplied by pay- peatedly. On the other hand, if there are no future reads, ment channels [16, 35, 52, 56] that aim to place application such a data replica would be wasted. Thus, GRuB chooses to logic othe blockchain, all existing approaches are based replicate data in a workload-adaptive manner: If the current on static data placement. That is, the placement of data and workload is dominated by the reads from DUs, the GRuB computation w.r.t. blockchains stays xed once the system would decide to store a data replica on the blockchain. Oth- starts running, and it does not reect the constant change erwise, if the current workload is dominated by the updates in the workloads. The design space of a dynamic, workload- from the DO, the GRuB would decide to avoid replicating aware approach to optimize smart-contract costs for data data on chain. This design systematically avoids the two feeds is an uncharted territory. most expensive operations in Gas. That is, replicating data This work presents GRuB, a workload-adaptive data repli- on chain under read-intensive workloads can avoid the ex- cation framework for cost-eective data feeding. The system pensive transactions otherwise needed to bring data onto the model is a data pipeline involving three actors: As illustrated blockchain, and evicting data replicas under write-intensive in the left part of Figure 1, an o-chain data producer (DO) workloads can prevent the expensive storage writes in smart feeds a stream of data updates to multiple data-consumer contracts. See Section 2.2 for details on Ethereum’s Gas-based smart contracts (DUs) on the blockchain. The data ow is cost model and Section 2.3 for a basic measurement study coordinated by an intermediarykey-value (KV) store between that corroborates our insight here. the DO and DUs. A conventional design of data feed is to Dynamic decision making w.r.t. data replication has been realize the KV store in a smart contract that accepts DO’s a well-studied research topic in conventional distributed sys- data updates in transactions and DU’s queries in contract tems. Briey, a common approach [42] is to model the target internal calls. An alternative design is to statically place the system by multiple “sites”, and run workload monitoring KV store othe blockchain (e.g., the static o-chain feed, and decision making distributedly on each site. These solu- TownCrier [71]). By contrast, GRuB is a KV store built on tions lay an important foundation for designing dynamic hybrid storage media: By default, the data updates are per- data-replication in GRuB.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages15 Page
-
File Size-