Delivery-date: Wed, 19 Feb 2025 10:47:02 -0800 Received: from mail-oa1-f64.google.com ([209.85.160.64]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tkp65-0007Bo-Ns for bitcoindev@gnusha.org; Wed, 19 Feb 2025 10:47:02 -0800 Received: by mail-oa1-f64.google.com with SMTP id 586e51a60fabf-2bcbd5bfc95sf26499fac.3 for ; Wed, 19 Feb 2025 10:47:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1739990816; cv=pass; d=google.com; s=arc-20240605; b=Eby2dOl9zcyRbVdTU6oKpmYd3eUxQMTzmwZUD0q8YifrdRKEcKP3eqVf8srV2K2Oq9 SkBVGmieVynYX8gmihY9Gv26tvWIEy+dJB7M+4PEcx/385xdotIaZWyFfNyn000N0qLL 4eMjo3dV2+piVBUA4SQABI2FsCziMlmTAdLRyLqIXRxI+qy4r4+Q8z9tpCLYWn99pFlf jyQ8q/QXQ8rJGAuZg1NsO/uNRoP+uURDj/ISvUo3CoHR6ZBYA45fk7FsrIykU8/ZyXvt x5Sie2RSc5iYFViW8CQDF7dfX/pUv1V1fmljr+sfYWNeSVN8jzhA+IZQEUGSLlVXdGF/ o9wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding :mime-version:feedback-id:references:in-reply-to:message-id:subject :cc:from:to:date:sender:dkim-signature; bh=OgVV3st/YxN/qKN2T1tTIhLqmlX8DX4YcP6ek+Xf2es=; fh=iZi6B2F0/WF8Ti/1/Kf4jqAIn6v/N4glz3UQwyquqjw=; b=lf8GerInzEImbraBKoxP8QePkoz5aGJqaZqMzkYrg0DSGVdkeMKzOxM/gVKTAgGJuL tljj+Tj63JXOVnUxpEsh6ueYL1lQC/5nBKi7FOVvMgUj3YKewsQaccguqkLZJXzpUOJ5 POW2i+NUjXPLTHOlaArdMVdoHlLNN7F0beR7My3a/HdJlNF3GM2jMZftOvkvEYeIE40y M3gD9NxPqVbwvV/+N1A7gaVJB2wBmCzIzZAxQUvyUW9WY2JGqtWNxDUp2Ka8Eau3fQA3 5mX4Fl4Jghre909/ir7L5+gEBOXCAgQ1O0QLq2vDVAnT+0v8sPSMNIK0nAVaN9kk4xBD 8+7w==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@wuille.net header.s=protonmail header.b=K6yShDdW; spf=pass (google.com: domain of bitcoin-dev@wuille.net designates 185.70.43.23 as permitted sender) smtp.mailfrom=bitcoin-dev@wuille.net; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wuille.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1739990816; x=1740595616; darn=gnusha.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :date:sender:from:to:cc:subject:date:message-id:reply-to; bh=OgVV3st/YxN/qKN2T1tTIhLqmlX8DX4YcP6ek+Xf2es=; b=WVrH6ktX3GQQhzeb1q8rfEEYBdc2YbGn4sj1c/pVHyYQRkzmtR4ejoLMdUrF2irsl1 oM4L0L1V35XMtC9R8L4C+T4GO+VJtp3nm6Mbb37dhL4+Vxe2DQC+HKuF4kkW5iJ3hjv/ 4bumVxGD2ZTKL79JURjLxPqSMk1Wt1uQNwozzxS1bV9m5dydbMoczqPfGJ4shnU9V6h7 bgYP4txevByd7ZYZ7K3saLucm84h2D7Tvil5isWnWnrsRWe3Z+g9amRmNhqkfo5/EL2m AGoBjmEJZhsUyzLZGdWOuF8F/1R2tFa5qBhyt8fa0qrF+qtAVmIFTP7NOaQGGfaF8WMB lQyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739990816; x=1740595616; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :date:x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=OgVV3st/YxN/qKN2T1tTIhLqmlX8DX4YcP6ek+Xf2es=; b=IFl26ZwRZN907KvzrCMGGw+VvFA0B4s4i9bG6cjW7ZoNgMGFpaVZ6yGmO2PMr3CD19 LrgBw79lTyh9lbsoQM3HrwYgY9q5Y0NCWe2YUH6iM3JV/FoIhaHAJC/2yBYn5+AGEvQ5 Jxdm63Dip201SGPGStLMwoSQaGBhEB69UHZUxj6QEJ69bulzG4j1gDgAC+WkmSxlXBYg RzaYUGhrP/IzJ7Pi0i354b3CYKAC26iJTHLShWYr3tEkwEKHjwF6y9iUoAPTr8rS8V/+ dSYWHj/YSyHu9lSuoayZrYuByvhJHepfGdeIDHS08Ld75U6KApzXYzlha/uTdT7jAhfg 5/Zg== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXaKWBdFqvflnlxOHegvkgvirr6MjvqAnn5N+qUKlQcK5UyF0aAqIjhqdkVFm9TlrEvF3hNkCP8uUFA@gnusha.org X-Gm-Message-State: AOJu0Yx4Z/pzb4mTQFbS3XzRoElG+tKYIYNTIRbrhVQWhNlUkwQiTCAe mX/csiumIiPRqnBw6wXYdCjFuUvJQA0CjjCR0qhAtKoMX+wbwfwX X-Google-Smtp-Source: AGHT+IF3vHTHCJiCRrSaKuwNG6FBiauvN9vmIBZILlns43hhj0fYGyhBKG6uKNAvaacG7onSgQCq0A== X-Received: by 2002:a05:6870:7010:b0:2b8:3e6b:605 with SMTP id 586e51a60fabf-2bc99b5d7b0mr11884986fac.20.1739990814676; Wed, 19 Feb 2025 10:46:54 -0800 (PST) X-BeenThere: bitcoindev@googlegroups.com; h=Adn5yVEt/wIH5LXA+IpuBVkXzXrZ8JqH8OiryOCWJyRAW098yg== Received: by 2002:a05:6871:a117:b0:29e:3d45:93e6 with SMTP id 586e51a60fabf-2bd2f97b6b7ls57921fac.1.-pod-prod-03-us; Wed, 19 Feb 2025 10:46:52 -0800 (PST) X-Received: by 2002:a05:6808:2012:b0:3f4:177c:a4af with SMTP id 5614622812f47-3f4177ca6b2mr1671503b6e.11.1739990812131; Wed, 19 Feb 2025 10:46:52 -0800 (PST) Received: by 2002:a05:600c:6c47:b0:439:8c8f:60f0 with SMTP id 5b1f17b1804b1-4398c8f6682ms5e9; Wed, 19 Feb 2025 10:20:57 -0800 (PST) X-Received: by 2002:a05:6000:1f87:b0:38f:23f4:2d7a with SMTP id ffacd0b85a97d-38f33f43751mr18232587f8f.40.1739989255655; Wed, 19 Feb 2025 10:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739989255; cv=none; d=google.com; s=arc-20240605; b=lbZdcEzreePN/7tvMzw+gas6Url7hmX+WhgKh6Jmw8YlU4v6h5x1Tcd7mRvrspPleC oBzhlVSVQfLREbOJhrJpugM3jU4HghWmu6PjTKgxBQB6Qw3qS94mbCkyQdE6n6g9UsH/ o7l8+njAkZuPwEDjWt/tducoF3hooOTUKREujX0YUS5zfrjj1A/t9Fr9oPksDVVvRXIK puBw5k4rYzKseNCRv4rmVDeNgfKZAkBqLZMq9QA/2IxTihfv41CfSAukW2AXhnG+x7/W AeQvy2HdrNneDC7OUVu3azlfEJXI3LyOjQl1NNyBQSQIfjXe70CyNDfQyne5Q3+huQm1 PQrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=gCqrRF9E5Xa/rI8x4OEkzmlEzQddDtA/nHRWOTRY8b4=; fh=bZhKHWNYmEIuUC5KPA/S3nPasycal1EIkOD40x2mX7U=; b=jqlhWhDaTbJDKuAXoOpjDU0Bkwx/+wEph07+zQ49nfpk0CohTnPJmrY57CQ9SAwTN5 0A3uUfDmwFwDspO2QHCO/37z0zvEJnWI04KyqBDjzyMAghX8zL8YQj8hHQAcyKjLfGGl ebi67481YRMACpYMpiLM9GOZtmX0PppbwmCa8ic3MlMOCR/sfyy/DQA6pCWBm4Lvy7Lo ijipsakdiA5yeCjsyF6OltiSx/FPHLg9UwiIlrO4F33uJQxmgL1nFbitOExtfIXVTb2Z 5SnuT19LnkPmjvlLRWmaAG5EDUv5qGlp+goEv4t7sa6+RKmAZd7IH3d5MajW6HCzcqlM ud7w==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@wuille.net header.s=protonmail header.b=K6yShDdW; spf=pass (google.com: domain of bitcoin-dev@wuille.net designates 185.70.43.23 as permitted sender) smtp.mailfrom=bitcoin-dev@wuille.net; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wuille.net Received: from mail-4323.protonmail.ch (mail-4323.protonmail.ch. [185.70.43.23]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-4399be7a426si1158805e9.0.2025.02.19.10.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 10:20:55 -0800 (PST) Received-SPF: pass (google.com: domain of bitcoin-dev@wuille.net designates 185.70.43.23 as permitted sender) client-ip=185.70.43.23; Date: Wed, 19 Feb 2025 18:20:51 +0000 To: John From: Pieter Wuille Cc: Bitcoin Development Mailing List Subject: Re: [bitcoindev] Transaction Validation Optimization Message-ID: In-Reply-To: <3c2b1e7a-ffcd-41da-a533-2d9224fc016fn@googlegroups.com> References: <3c2b1e7a-ffcd-41da-a533-2d9224fc016fn@googlegroups.com> Feedback-ID: 19463299:user:proton X-Pm-Message-ID: a50b9961616bb6ef26a29ec9143fcdf60a614a3f MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Original-Sender: bitcoin-dev@wuille.net X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@wuille.net header.s=protonmail header.b=K6yShDdW; spf=pass (google.com: domain of bitcoin-dev@wuille.net designates 185.70.43.23 as permitted sender) smtp.mailfrom=bitcoin-dev@wuille.net; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wuille.net Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.8 (/) On Tuesday, February 18th, 2025 at 10:22 AM, John = wrote: > Hi everyone, >=20 > While analyzing the codebase, I observed what seems to be duplicate valid= ation steps for transactions that already exist in the mempool when they ap= pear in new blocks. Specifically, I'm curious if the secondary validation p= erformed during block acceptance could be safely optimized for SegWit-verif= ied transactions using their wtxid hashes.=EF=BC=88I'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 sof= tfork activations, for example. --=20 Pieter --=20 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 e= mail to bitcoindev+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/= PwJsLY2Y0zpBfSnWT-O1iP-r6n7sipm-EFgK-LnnZqkPMoSUO6HJxigmt2J0CRTd8A6V4UVpA-J= FCd6MaXZ0Up1bye5zVxXGdSrhIsyr38s%3D%40wuille.net.