Please use this identifier to cite or link to this item: https://cuir.car.chula.ac.th/handle/123456789/77283
Title: Reducing smart contract runtime errors on the Ethereum blockchain
Other Titles: การลดความผิดพลาดที่เกิดข้ึนในขณะทํางานของ สัญญาอัจฉริยะบนอีเธอเรียมบล็อกเชน
Authors: Siwapol Jumnongsaksub
Advisors: Kunwadee Sripanidkulchai
Other author: Chulalongkorn University. Faculty of Engineering
Issue Date: 2020
Publisher: Chulalongkorn University
Abstract: With smart contracts, a wide range of applications can be implemented on blockchains. Ethereum stores smart contract byte code with the smart contract ad-dress so, the Ethereum Virtual Machine (EVM) can read and execute transactions correctly. All executed transactions (both successful and failed transactions) are stored on the platform permanently. Failed transactions are thrown by the EVM due to runtime errors and result in monetary waste. The waste from these transactions add up to around 2 million Ethers or $634.2 million. In this thesis, we propose Evitar, a warning algorithm for reducing Ethereum smart contract runtime errors, which has two mechanisms. First, Evitar proposes that users send transactions with the maximum gas allowed to avoid Out of Gas errors. However, this results in an extremely high transaction fee when transactions fail. Second, Evitar analyzes transactions called to each method in smart contracts and marks a method as a method with a high failure rate if the number of failed transactions reaches Evitar’s threshold. This mechanism prevents users from sending and paying for transactions that are likely to fail. We run experiments to evaluate the performance of Evitar by replaying transactions in a private network. The results show that Evitar can reduce failed transactions up to 99.52% compared to sending under default behaviour in exchange for a reduction in successful transactions by 1.78%. The amount of gas used by Evitar is only one-tenth compared to sending under default behaviour. Sending transactions with the maximum gas in Evitar reduces Out of Gas errors by 99.25%. In addition, Evitar can save up to 15.04 GB (82.32%) of storage in the Geth default node and 50.09 GB (50.09%) in the Parity full archive node.
Other Abstract: สัญญาอัจฉริยะทําให้แอปพลิเคชันหลากหลายประเภทสามารถทํางานบนบล็อกเชนได้อีเทอเรียมได้ทําการเก็บรหัสไบต์ของสัญญาอัจฉริยะไว้กับที่อยู่ของสัญญาอัจฉริยะ เพื่อให้อีวีเอ็มสามารถอ่านและทําธุรกรรมได้อย่างถูกต้อง ธุรกรรมที่ได้ดําเนินการไปแล้วทั้งหมดไม่ว่าจะสําเร็จ หรือ ล้มเหลว จะถูกจัดเก็บอยู่ในฐานงาน โดยไม่สามารถแก้ไขได้ตลอดไป ธุรกรรมที่ ล้มเหลวเหล่านี้ถูกหยุดการทํางานโดย อีวีเอ็ม เนื่องจากข้อผิดพลาดขณะดําเนินงาน และ ส่งผลให้เกิดการสิ้นเปลือง โดยมีมูลค่าที่สูญเสียที่ผ่านมาแล้วอย่างน้อย 2 ล้านอีเทอร์ หรือ คิดเป็น 634.2 ล้านดอลลาร์สหรัฐ วิทยานิพนธ์นี้ได้เสนอ Evitar อัลกอริทึมสําหรับแจ้งเตือน เพื่อลดข้อผิดพลาดขณะดําเนินงานของสัญญาอัจฉริยะของอีเทอเรียม โดยมีวิธีการสองวิธี วิธีการ แรก Evitar แนะนําให้ผู้ใช้งานส่งธุรกรรมด้วยจํานวนแก๊สสูงสุด เพื่อหลีกเลี่ยงการเกิดข้อผิดพลาดที่เกิดจากแก๊สไม่เพียงพอ อย่างไรก็ตาม เมื่อธุรกรรมล้มเหลวจะก่อให้เกิดค่าธรรมเนียมในการทําธุรกรรมที่สูง เพื่อป้องกันปัญหานี้ วิธีการที่สอง Evitar ได้ทําการวิเคราะห์ธุรกรรมที่เรียกไปยังชุดคําสั่งต่าง ๆ ในสัญญาอัจฉริยะ และ ระบุว่าเป็นชุดคําสั่งที่มีโอกาสล้มเหลวสูง ในกรณีที่จํานวนธุรกรรมที่ล้มเหลวมีจํานวนถึงจุดที่กําหนดไว้ วิธีการนี้จะป้องกันไม่ให้ผู้ใช้งานส่งและจ่ายค่าธรรมเนียมสําหรับธุรกรรมที่มีแนวโน้มว่าจะล้มเหลว วิทยานิพนธ์นี้ได้ทําการทดลองเพื่อวัดประสิทธิภาพของ Evitar โดยทําการส่งธุรกรรมทั้งหมดใหม่อีกครั้งในระบบโครงข่ายส่วนตัว ผลการทดลองแสดงให้เห็นว่า Evitar สามารถลดธุรกรรมที่ล้มเหลวได้ถึง 99.52 เปอร์เซ็นต์ เมื่อเทียบกับการส่งธุรกรรมแบบปกติ โดยพบการลดลงของธุรกรรมที่สําเร็จ 1.78 เปอร์เซ็นต์ ในขณะที่ปริมาณแก๊สที่ใช้โดย Evitar น้อยกว่าการส่งธุรกรรมแบบปกติมากถึง 10 เท่า สําหรับการส่งธุรกรรมด้วยจํานวนแก๊สสูงสุดสามารถลดการเกิดข้อผิดพลาดที่เกิดจากแก๊สไม่เพียงพอได้ถึง 99.25 เปอร์เซ็นต์ นอกจากนี้ Evitar ยังสามารถประหยัดพื้นที่จัดเก็บเป็นจํานวน 15.04 กิกะไบต์ หรือ ประมาณ 82.32% ในโหนดปกติ และ17.04 กิกะไบต์ หรือ ประมาณ 50.09% ในโหนดสําหรับเก็บข้อมูลถาวร
Description: Thesis (M.Eng.)--Chulalongkorn University, 2020
Degree Name: Master of Engineering
Degree Level: Master's Degree
Degree Discipline: Computer Engineering
URI: http://cuir.car.chula.ac.th/handle/123456789/77283
URI: http://doi.org/10.58837/CHULA.THE.2020.135
metadata.dc.identifier.DOI: 10.58837/CHULA.THE.2020.135
Type: Thesis
Appears in Collections:Eng - Theses

Files in This Item:
File Description SizeFormat 
6270336821.pdf1.44 MBAdobe PDFView/Open


Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.