In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how much data can be contained in the intelligent contract transaction in Ethernet Square". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In theory, there is no direct or fixed upper limit on transaction size or block size in ethernet, which is also an advantage of ethernet.
However, this does not mean that there is no upper limit on the amount of data a transaction can carry, because there is an upper limit on the amount of gas that a block can use. At the time of writing this article, ethstats shows that the value is 7, 984, 452, about 7 million.
So, in theory, we can create a transaction that consumes all the gas that a block can use, which determines the maximum amount of data a transaction can theoretically contain.
Another factor determining the size of the data is the content of the data, because different data consumes different gas:
0 bytes consume 4 gas
Non-zero bytes consume 68 gas
21000 gas paid per transaction
Using the gas upper limit of the block, combined with the content of your data, you can calculate the size of data that can be sent by a transaction.
You can try sending random data from 256kb using mist:
This consumes about 9 million gas,mist and will attempt to create a deal, but will not succeed.
Let's try to approach the upper limit of the block gas, this time using 44444 random bytes:
This transaction can be successful, you can click here to view the transaction data.
Value: 60 Finney (0.06 Ether)
Gas: 3131800
Gas Price: 50 Gwei (0.00000005 Ether)
Gas Used By Transaction: 3031800
Actual Transaction Cost: 151.59 Finney (0.15159 Ether)
Cumulative Gas Used: 3031800
You see, we successfully wrote 44k bytes of data on block 967163.
This is the end of the content of "how much data can be contained in Ethernet Square Intelligent contract Trading". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.