From: Pieter Wuille <bitcoin-dev@wuille.net>
To: John <csdarkcounter@gmail.com>
Cc: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] Transaction Validation Optimization
Date: Wed, 19 Feb 2025 18:20:51 +0000 [thread overview]
Message-ID: <PwJsLY2Y0zpBfSnWT-O1iP-r6n7sipm-EFgK-LnnZqkPMoSUO6HJxigmt2J0CRTd8A6V4UVpA-JFCd6MaXZ0Up1bye5zVxXGdSrhIsyr38s=@wuille.net> (raw)
In-Reply-To: <3c2b1e7a-ffcd-41da-a533-2d9224fc016fn@googlegroups.com>
On Tuesday, February 18th, 2025 at 10:22 AM, John <csdarkcounter@gmail.com> wrote:
> Hi everyone,
>
> While analyzing the codebase, I observed what seems to be duplicate validation steps for transactions that already exist in the mempool when they appear in new blocks. Specifically, I'm curious if the secondary validation performed during block acceptance could be safely optimized for SegWit-verified transactions using their wtxid hashes.(I'm still working on the source code, and I'm not sure if the source code was validated twice
Bitcoin Core maintains a signature validation cache and a script validation cache (see the ValidationCache class), which generally means that mempool transactions don't need to be (fully) validated again when seen in a block. The script validation cache includes the validation flags (including which consensus rules are active) too, so the cache will not function across softfork activations, for example.
--
Pieter
--
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/PwJsLY2Y0zpBfSnWT-O1iP-r6n7sipm-EFgK-LnnZqkPMoSUO6HJxigmt2J0CRTd8A6V4UVpA-JFCd6MaXZ0Up1bye5zVxXGdSrhIsyr38s%3D%40wuille.net.
prev parent reply other threads:[~2025-02-19 18:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 15:22 John
2025-02-19 5:47 ` Eric Voskuil
2025-02-19 18:20 ` Pieter Wuille [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='PwJsLY2Y0zpBfSnWT-O1iP-r6n7sipm-EFgK-LnnZqkPMoSUO6HJxigmt2J0CRTd8A6V4UVpA-JFCd6MaXZ0Up1bye5zVxXGdSrhIsyr38s=@wuille.net' \
--to=bitcoin-dev@wuille.net \
--cc=bitcoindev@googlegroups.com \
--cc=csdarkcounter@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox