铭文狂热传至Layer2 zkSync为何能通过天量交易压力测试?

币圈资讯 阅读:39 2024-04-22 11:38:03 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

作者:Haotian,加密观察员 来源:X,@tmel0211

在 zkSync 链上刻铭文,短时涌入的天量交易,确实是一次 layer2 公链性能的「压力测试」,不过结果并非「宕机」,恰恰相反,这是一次 zkSync 的公开练兵,结果是 TPS 峰值、GAS 稳定性等都完美经受了考验。

乍一听,是不是有点反直觉?接下来,用技术逻辑,我来给大家澄清一下:

zkSync 打包出块的工作原理,简单而言:用户构造交易进入 zkSync Sequencer 的排序序列,然后 Sequencer 根据 Gas Fee 高低排序打包进区块,然后再把区块传入 Proof 系统验证,最后 Submit 到主网完成 finality 状态确认。

这里边有 2 个关键点,容易制造「体验糟糕」假象:

1)用户构造交易环节:大部分用户都会通过 Metamask 等钱包端发起交易,而通过钱包端向 zkSync 发交易,交易会先进入 RPC 远程调用服务器里,然后 Sequencer 接收这些交易进入排队序列。这里的排队时间短则几秒,长则几分钟,人如果等待时间较长,MetaMask 就会认定该笔交易已经失败,然后前端返回交易失败的提示。

然而,这并不意味着交易真失败了,而只是因为 Metamask 的 RPC 响应时间和反馈逻辑和 zkSync 的 Sequencer 排队打包交易逻辑存在「不兼容」所致。这正是为何,一些明明 MetaMask 显示失败的交易,在等待一段时间后,后端服务器显示又成功的原因。

如果用户不走钱包管道,直接使用后端代码调用 zkSync 的 RPC,就不会存在响应时间超时以及提示失败的问题,体验相对而言会很丝滑。这确实会让一些可使用后端代码指令的「科学家」取得了优势,但本质上属于钱包体验端的问题,和 zkSync 链的处理能力无关。

2)Sequencer 公平排序环节:当用户短时向 RPC 队列发出交易时,每一笔交易都会从 nonce 值为 0 开始叠加,如果上一笔交易还在排队状态,nonce 为 0,这时用户又发起了一笔新交易 nonce 为 1,zkSync 的 Sequencer 会根据 time 来给这些交易分配 nonce,然后按照顺序排序。

但倘若,用户在 MetaMask 前段看到上一笔交易显示失败后,同时又提交新的交易,很可能新提交的交易由于钱包端和 zkSync API 接口调用的问题,有一部分交易最终并没有成功提交到 RPC 的排队序列中。用户以为提交了很多交易,实际上 zkSync 只收到了其中一部分,而只要他们收到就会去排序处理。

这么看,用户看到 MetaMask 反馈交易失败,不停提交新交易的行为也会造成大量交易失败,因为根本就没有提交到 zkSync 链的后端,只是你在前端以为自己提交了。

整体而言,MetaMask 钱包的 RPC 响应时间逻辑问题和用户着急向链上叠加交易的行为,都会造成大量的交易「失败」,如果清楚 zkSync 的后台交易处理工作流程的话,相对更容易避开这些优化体验问题。

基于以上科普,再来澄清下「宕机」问题:

zkSync 链并未「宕机」,只是浏览器前端显示问题,因为浏览器会通过 zkSync 的 RPC 接口拉取最新数据,但是接口响应会有延迟,大量新交易会使响应变慢。

总之,浏览器的拉取数据同步速度跟不上排队交易激增的速度,这是浏览器前端的问题,与链的运转没有关系。通常等交易速度适当放缓,浏览器可以抓取到新数据后,问题就会解决。

当遇到浏览器不 work 的时候,可以通过其他同步 zkSync 区块数据信息的浏览器来交叉验证,比如:https://hyperscan.xyz

真实链的「运转性能」情况如何呢?

1)在所谓宕机传闻爆出后,zkSync 的官方工作人员 Anthony Rose 在推特却频频发出 TPS 刷新捷报。实际上,zkSync TPS 飙到了 187.9 的峰值,正常情况下,TPS 只有 50-100 左右,这说明大量的新交易涌入,zkSync 其实抗住了压力。这确实也给未来数千甚至上万的 TPS 做了一次充分的「压力测试」。

2)ZK-Rollup 的特殊机制决定了,处理的交易量越大,Gas 费则越便宜,事实上,zkSync 的 Gas 费确实更加便宜了,因为交易成本也被分摊了,根据 growthepie 数据显示,近 24 小时,zkSync 的 Gas 平均值还降低了 5.2%,平均在 $0.19 左右,这个数据每个人的体验可能不一样,但综合链的运行数据,确实是便宜了。佐证了 ZK-Rollup 的更流畅体验需要将现有的用户规模提升一个量级。

铭文事件对 layer2 公链的影响?

根据 dune 数据显示, Sync 的铭文铸造,14 个小时新增了 5M 笔交易,已有 65575 个 Holder 参加。诚如上述所言,zkSync 官方已经知道了这场社区发起的「压力测试」活动,还紧急采取措施来确保 zkSync 链的有序进行。

这个数据对 zkSync 而言确实是一次较好的压力测试实验,其正向影响大于负面。长远看,铭文事件并非传言中把 layer2 性能打回了原型,反倒给 layer2 的进一步性能优化提供了实践经验。

不过据我了解,除了 Sync 之外,还有其他铭文正在铸造,虽不及 Sync 那么 fomo,但也给此压力测试添了一把火。

Anyway,结果总体而言是好的,大家若厘清 zkSync 后台排序出块的技术逻辑,再拨开其中存在的「体验糟糕」误会,就应该懂得,一切运行安好,我们得给 layer2 多一点信心。


The short-term influx of massive transactions from the author's encrypted observer source engraved on the chain is indeed a stress test of the performance of the public chain, but the result is not downtime. On the contrary, it is an open training. The result is that the peak stability and so on have all stood the test perfectly. Is it a bit counterintuitive at first glance? Next, I will clarify the working principle of packaging out blocks with technical logic. Simply put, users construct the sorting sequence of transactions, then package them into blocks according to the high and low ranking, and then pass them into blocks. System verification finally goes to the main network to complete the status confirmation. There is a key point here, which is easy to create the illusion of bad experience. Most users will send the transaction through the wallet by waiting for the wallet to initiate the transaction. The transaction will first enter the remote call server and then receive these transactions into the queuing sequence. The queuing time here is short, ranging from a few seconds to a few minutes. If people wait for a long time, they will think that the transaction has failed, and then the front end will return the prompt of transaction failure. However, this is not the case. It means that the transaction really failed, but only because the response time and feedback logic are incompatible with the queuing and packaging transaction logic. This is exactly why some transactions that clearly show failure are displayed and succeeded by the back-end server after waiting for a period of time. If the user directly uses the back-end code call without taking the wallet pipeline, there will be no problem that the response time is overtime and the failure is prompted. The experience will be relatively smooth, which will indeed be obtained by some scientists who can use the back-end code instructions. The problem that has the advantage but essentially belongs to the wallet experience end has nothing to do with the processing capacity of the chain. When the user sends a transaction to the queue for a short time, each transaction will be superimposed from the value. If the last transaction is still in the queue state, the user will allocate these transactions according to the data and then sort them in order. However, if the user sees that the last transaction failed in the previous paragraph and submits a new transaction at the same time, it is likely that the new transaction will be submitted due to the wallet end and. The problem of interface call is that some transactions are not successfully submitted to the queuing sequence in the end. Users think that many transactions have actually been submitted, but as long as they receive them, they will sort them out. In this way, the behavior of constantly submitting new transactions when users see the feedback transaction failure will also cause a large number of transactions to fail, because there is no submission to the back end of the chain at all, but you think that you have submitted a lot of transactions at the front end. On the whole, the logic problem of wallet response time and the user's anxiety are superimposed on the chain. The transaction behavior will cause a lot of transaction failures. If the background transaction processing workflow is clear, it is relatively easy to avoid these optimization experience problems. Based on the above popular science, let's clarify that the downtime problem chain is not down. It's just the display problem of the browser front end, because the browser will pull the latest data through the interface, but the interface response will be delayed. A lot of new transactions will slow down the response. In short, the synchronization speed of the browser's pull data can't keep up with the surge of queued transactions. This is the browser front end. The problem has nothing to do with the operation of the chain. Usually, when the transaction speed slows down properly and the browser can grab new data, the problem will be solved. When the browser is not available, it can be cross-verified by other browsers that synchronize the block data information. For example, what is the operation performance of the real chain? After the so-called downtime rumor broke out, the official staff frequently sent out refreshing news on Twitter, which actually reached the peak. Under normal circumstances, there are only about two, which shows that a large number of new transactions have actually resisted. Stress: This has indeed given thousands or even tens of thousands of people a full stress test in the future. The special mechanism determines that the greater the transaction volume, the cheaper the fee will be. In fact, the fee is indeed cheaper, because the transaction cost is also shared. According to the data, the average value of the last hour has also decreased. Everyone's experience may be different, but the running data of the integrated chain is indeed cheaper, which proves that the smoother experience needs to upgrade the existing user scale by an order of magnitude. According to the inscription on the data, a new transaction has been cast for hours, and as mentioned above, the government has already known about the stress test activity initiated by the community and taken urgent measures to ensure the orderly progress of the chain. This data is indeed a good stress test experiment for me, and its positive impact is greater than its negative impact. In the long run, the inscription event did not return the performance to the prototype as rumored, but provided practical experience for further performance optimization, but it was lifted according to me. There are other inscriptions being cast, which are not as good as that, but also add a fire to this stress test. On the whole, the results are good. If you clarify the technical logic of sorting out blocks in the background and then get rid of the bad experience and misunderstanding, you should know that everything is running well. We have to give more confidence. 比特币今日价格行情网_okx交易所app_永续合约_比特币怎么买卖交易_虚拟币交易所平台

文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明 网址:https://netpsp.com/?id=62296

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
关注我们

若遇到问题,加微信客服---清歌

搜索
排行榜
扫一扫,加我为微信好友加我为微信好友