{"id":1470,"date":"2026-10-26T22:47:29","date_gmt":"2026-10-26T14:47:29","guid":{"rendered":"https:\/\/lezoo6.com\/index.php\/news\/daily\/stuck-nonce-replace-cancel\/"},"modified":"2026-10-26T22:47:29","modified_gmt":"2026-10-26T14:47:29","slug":"stuck-nonce-replace-cancel","status":"publish","type":"page","link":"https:\/\/lezoo6.com\/index.php\/news\/daily\/stuck-nonce-replace-cancel\/","title":{"rendered":"Nonce \u5361\u4f4f\u4e4b\u540e\uff1a\u66ff\u6362\u3001\u52a0\u901f\u4e0e\u53d6\u6d88\u7684\u4e09\u79cd\u505a\u6cd5"},"content":{"rendered":"<div class=\"lz-art\">\n<p>\u4ea4\u6613\u4e00\u76f4 pending\uff0c\u6700\u5e38\u89c1\u7684\u4e0d\u662f\u7f51\u7edc\u6162\uff0c\u800c\u662f nonce \u88ab\u4e00\u7b14\u4f4e\u8d39\u4ea4\u6613\u5360\u4f4f\u4e86\u3002\u4ee5\u592a\u574a\u6309 nonce \u4e25\u683c\u987a\u5e8f\u6267\u884c\uff1a\u524d\u4e00\u7b14\u4e0d\u8fdb\u5757\uff0c\u540e\u9762\u5168\u6392\u961f\u3002\u89e3\u51b3\u529e\u6cd5\u53ea\u6709\u4e09\u7c7b\u2014\u2014\u63d0\u9ad8\u540c\u4e00 nonce \u7684\u8d39\u7528\u3001\u7528\u540c\u4e00 nonce \u53d1\u4e00\u7b14\u7a7a\u4ea4\u6613\u53d6\u6d88\u3001\u6216\u8005\u7b49\u3002<\/p>\n<h2>\u4e00\u3001\u5148\u786e\u8ba4\u5361\u5728\u54ea\u4e00\u6b65<\/h2>\n<p>\u7528 eth_getTransactionCount(address, \\&#8221;pending\\&#8221;) \u4e0e \\&#8221;latest\\&#8221; \u5bf9\u6bd4\uff1a\u4e24\u8005\u76f8\u7b49\u8bf4\u660e\u6ca1\u6709 pending \u4ea4\u6613\uff1bpending \u5927\u4e8e latest \u8bf4\u660e\u6709\u4ea4\u6613\u5360\u7740 nonce \u6ca1\u8fdb\u5757\u3002\u518d\u770b\u8fd9\u7b14\u4ea4\u6613\u662f\u5426\u8fd8\u5728\u5185\u5b58\u6c60\u3001\u662f\u5426\u88ab\u6253\u5305\u65b9\u4e22\u5f03\uff08\u8282\u70b9\u91cd\u542f\u540e\u53ef\u80fd\u4e22\u5931\uff09\u3002<\/p>\n<h2>\u4e8c\u3001\u66ff\u6362\uff1a\u540c\u4e00 nonce\uff0c\u66f4\u9ad8\u8d39\u7528<\/h2>\n<p>EIP-1559 \u4e0b\u591a\u6570\u5ba2\u6237\u7aef\u8981\u6c42\u65b0\u4ea4\u6613\u7684 maxFeePerGas \u81f3\u5c11\u6bd4\u539f\u4ea4\u6613\u9ad8 10%\uff08\u90e8\u5206\u8282\u70b9\u6309 max(maxFee\u00d71.1, baseFee\u00d71.1) \u5224\u65ad\uff09\uff1blegacy \u4ea4\u6613 gasPrice \u540c\u7406\u3002\u4f4e\u4e8e\u8fd9\u4e2a\u9608\u503c\uff0c\u66ff\u6362\u8bf7\u6c42\u4f1a\u88ab\u76f4\u63a5\u62d2\u7edd\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u505a\u6cd5<\/th>\n<th>\u6761\u4ef6<\/th>\n<th>\u4ee3\u4ef7<\/th>\n<th>\u98ce\u9669<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u52a0\u901f\uff08\u540c nonce \u66f4\u9ad8\u8d39\uff09<\/td>\n<td>\u539f\u4ea4\u6613\u4ecd\u5728\u5185\u5b58\u6c60<\/td>\n<td>\u591a\u4ed8\u7684 gas \u5dee\u989d<\/td>\n<td>\u4e24\u7b14\u540c\u65f6\u88ab\u63a5\u53d7\u7684\u6982\u7387\u6781\u4f4e\uff0c\u4f46\u9700\u786e\u8ba4\u65e7\u4ea4\u6613\u5df2\u88ab\u66ff\u6362<\/td>\n<\/tr>\n<tr>\n<td>\u53d6\u6d88\uff08\u540c nonce \u8f6c\u8d26\u7ed9\u81ea\u5df1 0\uff09<\/td>\n<td>\u539f\u4ea4\u6613\u672a\u8fdb\u5757<\/td>\n<td>\u4e00\u7b14 21,000 gas \u7684\u8d39\u7528<\/td>\n<td>\u539f\u4ea4\u6613\u82e5\u5148\u88ab\u6253\u5305\uff0c\u53d6\u6d88\u4f1a\u5931\u8d25<\/td>\n<\/tr>\n<tr>\n<td>\u7b49\u5f85<\/td>\n<td>\u539f\u4ea4\u6613\u6709\u6548\u4e14\u8d39\u7528\u591f\u4f4e\u4f46\u4e0d\u6025<\/td>\n<td>\u65f6\u95f4<\/td>\n<td>\u671f\u95f4\u6240\u6709\u540e\u7eed\u4ea4\u6613\u88ab\u963b\u585e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e09\u3001\u53d6\u6d88\u4ea4\u6613\u4e3a\u4ec0\u4e48\u662f 21,000 gas<\/h2>\n<p>\u56e0\u4e3a\u5b83\u662f\u4e00\u7b14\u6700\u7b80\u5355\u7684\u8f6c\u8d26\uff1ato \u586b\u81ea\u5df1\u3001value \u586b 0\uff0c\u53ea\u6d88\u8017\u57fa\u7840 21,000 gas\u3002\u8d39\u7528\u6309\u53d6\u6d88\u5f53\u65f6\u7684 baseFee \u4e0e priority \u8ba1\uff0c\u4e0e\u4f60\u539f\u672c\u60f3\u505a\u7684\u4e8b\u60c5\u65e0\u5173\u2014\u2014\u8fd9\u4e00\u70b9\u5e38\u88ab\u8bef\u89e3\u4e3a\u300c\u53d6\u6d88\u8981\u4ed8\u4e24\u500d\u624b\u7eed\u8d39\u300d\u3002<\/p>\n<h2>\u56db\u3001nonce gap \u4e0e\u6279\u91cf\u4ea4\u6613<\/h2>\n<p>\u5982\u679c\u4f60\u8fde\u7eed\u53d1 5 \u7b14\uff0c\u7b2c 2 \u7b14\u5361\u4f4f\uff0c\u7b2c 3\u20135 \u7b14\u5373\u4f7f\u8d39\u7528\u5f88\u9ad8\u4e5f\u4e0d\u4f1a\u8fdb\u5757\u3002\u6b64\u65f6\u5e94\u8be5\u8865\u7684\u662f\u7b2c 2 \u4e2a nonce\uff0c\u800c\u4e0d\u662f\u7ed9\u6700\u540e\u4e00\u7b14\u52a0\u4ef7\u3002\u6279\u91cf\u573a\u666f\u4e0b\uff0c\u9884\u7559\u7684 nonce \u5e8f\u5217\u6700\u597d\u4e00\u6b21\u62ff\u5168\uff0c\u907f\u514d\u91cd\u590d\u53d6\u7528\u3002<\/p>\n<h2>\u4e94\u3001\u4e09\u79cd\u5e38\u89c1\u8bef\u7528<\/h2>\n<p>\u7b2c\u4e00\uff0c\u7528\u4e0d\u540c\u94b1\u5305\u5bf9\u540c\u4e00\u8d26\u6237\u53d1\u4ea4\u6613\uff0c\u5bfc\u81f4 nonce \u91cd\u590d\u6216\u51b2\u7a81\u3002\u7b2c\u4e8c\uff0c\u66ff\u6362\u65f6\u53ea\u63d0\u9ad8 priority fee\uff0cmaxFeePerGas \u6ca1\u53d8\uff0c\u4ecd\u53ef\u80fd\u88ab\u62d2\u3002\u7b2c\u4e09\uff0c\u53d6\u6d88\u4ea4\u6613\u53d1\u7ed9\u4e00\u4e2a\u5408\u7ea6\u5730\u5740\uff0cgas \u6d88\u8017\u8d85\u8fc7 21,000\uff0c\u8d39\u7528\u4f30\u7b97\u9519\u8bef\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<details>\n<summary>\u66ff\u6362\u4ea4\u6613\u4e00\u5b9a\u6210\u529f\u5417\uff1f<\/summary>\n<p>\u4e0d\u4e00\u5b9a\u3002\u65e7\u4ea4\u6613\u53ef\u80fd\u5df2\u7ecf\u88ab\u6253\u5305\u65b9\u6536\u5f55\uff0c\u66ff\u6362\u53ea\u5728\u5b83\u8fd8\u5728\u5185\u5b58\u6c60\u65f6\u6709\u6548\uff1b\u5e7f\u64ad\u540e\u8981\u56de\u67e5\u8be5 nonce \u7684\u6700\u7ec8\u56de\u6267\u3002<\/p>\n<\/details>\n<details>\n<summary>\u53d6\u6d88\u4ea4\u6613\u4f1a\u635f\u5931\u672c\u91d1\u5417\uff1f<\/summary>\n<p>\u4e0d\u4f1a\u3002value \u4e3a 0\u3001to \u4e3a\u81ea\u5df1\uff0c\u53ea\u635f\u5931 gas \u8d39\u7528\u3002<\/p>\n<\/details>\n<details>\n<summary>\u4e3a\u4ec0\u4e48\u94b1\u5305\u663e\u793a\u300cnonce \u592a\u4f4e\u300d\uff1f<\/summary>\n<p>\u94fe\u4e0a\u8be5 nonce \u5df2\u88ab\u4f7f\u7528\u3002\u91cd\u65b0\u8bfb\u53d6 pending\/latest \u8ba1\u6570\uff0c\u7528\u6700\u65b0\u7684 next nonce \u91cd\u53d1\u3002<\/p>\n<\/details>\n<h2>\u76f8\u5173\u9605\u8bfb<\/h2>\n<p><a href=\"\/index.php\/news\/daily\/gas-used-vs-gas-limit-scopes\/\">gasLimit \u4e0e gasUsed<\/a>\u3001<a href=\"\/index.php\/news\/daily\/eip712-signature-eight-checks\/\">EIP-712 \u516b\u9879\u6838\u5bf9<\/a>\u3001<a href=\"\/index.php\/news\/daily\/\">\u6bcf\u65e5\u5feb\u8baf<\/a>\u3002<\/p>\n<p class=\"lz-note\">\u8d39\u7528\u53c2\u6570\u4ee5\u4e3b\u6d41\u5ba2\u6237\u7aef\u9ed8\u8ba4\u7b56\u7565\u4e3a\u51c6\uff1b\u4e0d\u6784\u6210\u6295\u8d44\u5efa\u8bae\u3002<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"\u66ff\u6362\u4ea4\u6613\u4e00\u5b9a\u6210\u529f\u5417\uff1f\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"\u4e0d\u4e00\u5b9a\u3002\u53ea\u6709\u65e7\u4ea4\u6613\u4ecd\u5728\u5185\u5b58\u6c60\u65f6\u624d\u6709\u6548\uff0c\u9700\u56de\u67e5\u8be5 nonce \u7684\u6700\u7ec8\u56de\u6267\u3002\"}},{\"@type\":\"Question\",\"name\":\"\u53d6\u6d88\u4ea4\u6613\u4f1a\u635f\u5931\u672c\u91d1\u5417\uff1f\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"\u4e0d\u4f1a\u3002value \u4e3a 0\u3001to \u4e3a\u81ea\u5df1\uff0c\u53ea\u6d88\u8017 21,000 gas \u7684\u8d39\u7528\u3002\"}},{\"@type\":\"Question\",\"name\":\"\u6279\u91cf\u4ea4\u6613\u5361\u4f4f\u8be5\u8865\u54ea\u4e00\u7b14\uff1f\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"\u8865\u5361\u4f4f\u7684\u90a3\u4e2a nonce\uff0c\u5373\u5e8f\u5217\u4e2d\u6700\u5c0f\u7684\u672a\u8fdb\u5757 nonce\uff0c\u800c\u4e0d\u662f\u6700\u540e\u52a0\u4ef7\u3002\"}}]}<\/script>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ea4\u6613\u4e00\u76f4 pending\uff0c\u6700\u5e38\u89c1\u7684\u4e0d\u662f\u7f51\u7edc\u6162\uff0c\u800c\u662f nonce \u88ab\u4e00\u7b14\u4f4e\u8d39\u4ea4\u6613\u5360\u4f4f\u4e86\u3002\u4ee5\u592a\u574a\u6309 nonce \u4e25 &#8230; <a title=\"Nonce \u5361\u4f4f\u4e4b\u540e\uff1a\u66ff\u6362\u3001\u52a0\u901f\u4e0e\u53d6\u6d88\u7684\u4e09\u79cd\u505a\u6cd5\" class=\"read-more\" href=\"https:\/\/lezoo6.com\/index.php\/news\/daily\/stuck-nonce-replace-cancel\/\" aria-label=\"\u9605\u8bfb Nonce \u5361\u4f4f\u4e4b\u540e\uff1a\u66ff\u6362\u3001\u52a0\u901f\u4e0e\u53d6\u6d88\u7684\u4e09\u79cd\u505a\u6cd5\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":857,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-1470","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages\/1470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/comments?post=1470"}],"version-history":[{"count":0,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages\/1470\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages\/857"}],"wp:attachment":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/media?parent=1470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}