Smart contracts on Ethereum can be used to encode business logic and have been applied to many different areas, such as token exchanges and games. Unlike general programs, the computations of contracts on Ethereum are restricted by the gas limit. If a transaction runs out of the gas limit before an execution finishes, the Ethereum virtual machine throws an out-of-gas exception, and the entire transaction fails, which reverts to the state before the transaction started, although the transaction fee is still deducted. It is therefore, essential to conduct a gas estimation before sending a transaction. Existing studies have mostly failed in estimating the gas for a loop function because the number of iterations of the loops cannot be statically determined. However, we found that a quarter of all contracts have loop functions, and the gas cost for the loops is higher than for the other functions. Therefore, it is necessary to apply a gas estimation for the loop functions. In this study, we propose a gas estimation approach based on the transaction trace to dynamically estimate the gas for the loop functions. Our belief is that we can learn the relationship between the historical transaction traces and their gas costs to estimate the gas for new transactions. We considered three different abstractions of the original transaction trace and fed them to different machine learning models. The results show that our approach is effective in gas estimation and that a random forest can achieve the most accurate estimation.
BackgroundAccurate, simple and non-invasive tools are needed for efficient screening of abnormal glu-cose tolerance (AGT) and educating the general public.AimTo develop a neural network-based initial screening and educational model for AGT.Data and methods230 subjects with AGT and 3,243 subjects with normal glucose tolerance (NGT) were allocated into training, validation and test sets using stratified randomization. The ratios of AGT versus NGT in three groups were 150:50, 30:570 and 50:950, respectively. A feed-forward neural network (FFNN) was trained to predict 2-hour plasma glucose of 75 g Oral Glucose Tolerance Test (OGTT) using age, family history of diabetes, weight, height, waist and hip circumference. The screening performance was evaluated by the area under the receiver operating characteristic (ROC) curve (AUC) and the partial AUC (in the range of false positive rates between 35 and 65%) and compared to those from logistic regression, linear regression and ADA Risk Test.ResultsSensitivity, specificity, accuracy and percentage that needed further testing at 7.2 mmol/L in test group were 90.0%(95%CI: 78.6 to 95.7%), 47.7% (95%CI: 44.5 to 50.9%), 49.8% (95%CI: 46.7 to 52.9%) and 54.2% (95%CI: 51.1 to 57.3%) respectively. The entire and partial AUCs were 0.70 (95%CI: 0.62 to 0.78) and 0.26 (95%CI: 0.22 to 0.30). The partial AUC of the NN was higher than those of logistic regression (p = 0.06), linear regression (p = 0.06) and ADA Risk Test (P = 0.006).ConclusionNN can be used as a high-sensitive and non-invasive initial screening and educational tool for AGT.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.