From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 02 Sep 2024 16:20:45 -0700 Received: from mail-oo1-f63.google.com ([209.85.161.63]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1slGLl-0006xs-6n for bitcoindev@gnusha.org; Mon, 02 Sep 2024 16:20:45 -0700 Received: by mail-oo1-f63.google.com with SMTP id 006d021491bc7-5df9ac3042dsf4912434eaf.2 for ; Mon, 02 Sep 2024 16:20:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725319239; cv=pass; d=google.com; s=arc-20240605; b=GNinJi8pB6nGcDQ5nW4YDGqk/K97FxhMzuu4tW1laKmjQlU2splDnyW58NMz4aqJcX WTzQfC1R34F2D8MeHp+lrngoK04U6MgRzjVjZKYiYMeYWDkGNlAPJSDATFVeIB1uDwsy eTxqe9sSwoiJkypjPSC4ggPwyj+LPVARpHqaQ+7b2PCRtrEH/SgOPPtJHhNg7DL+JqX2 2tCxRTIbnk5GUY/p+Q6EDoTMZG3J7DGCXLROwQ2dSpfqUxrfxH0vexPf62qPq09i4cYf rRXwRFJluF3n7NT0rbZPTN/sX3VTgKfGRN1YcEXVbqbjOzkKTS8EVnl1RUx5epXxpEKv N+lQ== 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-disposition:mime-version :message-id:subject:cc:to:from:date:feedback-id:sender :dkim-signature; bh=YDgsZBhOGQvj2To26vmKW30ghmsfaugkpWwMpTjrwxI=; fh=Hv+viPMrmmJu9MPCurYx+NHDcejr2rDqwmyn5wyI6LY=; b=fC4jbLWPXeu+LGMNssXLspog0tEgNCvFqnLHqD0YABxmJRZtw6vr6lKIGuXekDxJPV 9FpppuFK5WFOuA7TDQlzfNHipvyVOffNG/ZhIyZYz4m4/vaP7sRKY1VHv0f0g/WdUG0m 53KklJEtiBXKtDJ3QtsJrROn7kEWLiItSyY+CxWWELTt2qohKUSRCD6zN8DKsf1Dvijy g2x0CZsRNJm76T4wwC/UV9sPk1GFxW+fMQEHX+N/sMUxLCK7AFDRTeFMh1AJ2s0cDzRt IXhu55eaZ4QAzmOEqhGr+FEFNGi8bHxyJvW8Va+aD3Uc69Hq5hXNplEzZunP8fiq77nE sHvg==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=ZGVPTH2z; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NJrXPhnX; spf=pass (google.com: domain of me@tobin.cc designates 103.168.172.159 as permitted sender) smtp.mailfrom=me@tobin.cc; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tobin.cc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1725319239; x=1725924039; 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-disposition:mime-version:message-id :subject:cc:to:from:date:feedback-id:sender:from:to:cc:subject:date :message-id:reply-to; bh=YDgsZBhOGQvj2To26vmKW30ghmsfaugkpWwMpTjrwxI=; b=Yl9G35APBfI0qRDECCjDQ5JLoYBc5suL8TjXbEf/CpLujknhmUpnTkeTg9+nl7e9Bc /zeK4ms/QK4+LkCnO/+LMBoBE7ZgNu5zKJ/KWVqCZplExeebt56iVs8Ywl5Lxh/4mAds GxwM84pF9mQgaP4m+i9FNXKkBLr3OxYk+iYebx8DofRi07OEQuN9Y5y77Z8IOqfi1ObO 7Jo7NaGsZOITrsz2HkLB1Sc6z6PFNOkNNqqot8yM/WwSXvawCl+KPNgL8OKcddKQ1bzo FJddXC22655OB4+5yBMaHzT29gA6llMOErO20XkfA0C7tO7lP/Bn1bnYc4uVg711Onei V3Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725319239; x=1725924039; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-disposition:mime-version:message-id :subject:cc:to:from:date:feedback-id:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=YDgsZBhOGQvj2To26vmKW30ghmsfaugkpWwMpTjrwxI=; b=AOabjPwkl808vrlGAkk2QRwi1La/6kdqcC3e76yis6h3LoQWI/CJCXeNyzCwGIumsW wa/sJQvHzMBfNlGKbxU07X8jNojZ5oWNoYlqPuGpjkFYLubrjqg7arvzomYC0OHTIcPt 0+GuVRd17oTdtSOedPjCeqPeYqxW4zoi+SGLrCqrTLLDZw4YyTvqNnWw8N9VYQEbCwRt J/InpFDyDBFB5d0zRoJVwQuPWIVOUDziozLoJ2B45LeafwF6LLHMGB3YoixyhNvPcLtt +G+ZbJxsVPTkSKi1G04HpwkhQ1UHngMvMa5QIejUNDuLsnkzdEFCkeZOfGHP11+5c4GK ERfQ== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVtpcy/7li1zAnVyGq7ijrT/ls4THLLhfCtSzD2IM8QVZcYDFPHDUK3WGfy505H1ijiMeHvqyhva/xH@gnusha.org X-Gm-Message-State: AOJu0Yw4evlp1UwVsGhw4aHZcBrEGrdseYJbv81yitcP7QB443E7hlVT t/wj2TX+gtILO/NmzFgE9Edp0DhotT9KSYrTec7Las8W1cdZFlkP X-Google-Smtp-Source: AGHT+IHT6S4rVCmWxaWevPjhtiIg2StrJXDOlGYOAsLLXm5CZMfqHsjJDh5fSlNuWgt8qs70NJuHsQ== X-Received: by 2002:a05:6820:2297:b0:5dc:9800:a443 with SMTP id 006d021491bc7-5dfacddf48fmr13551595eaf.1.1725319238832; Mon, 02 Sep 2024 16:20:38 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:a4a:e643:0:b0:5df:8190:e5d9 with SMTP id 006d021491bc7-5df98dbe205ls4854148eaf.0.-pod-prod-07-us; Mon, 02 Sep 2024 16:20:36 -0700 (PDT) X-Received: by 2002:a05:6808:22a5:b0:3df:c96:ebc4 with SMTP id 5614622812f47-3df1c942cfamr11319968b6e.6.1725319236678; Mon, 02 Sep 2024 16:20:36 -0700 (PDT) Received: by 2002:a05:6808:8cb:b0:3df:373:4881 with SMTP id 5614622812f47-3df116032cbmsb6e; Mon, 2 Sep 2024 16:18:12 -0700 (PDT) X-Received: by 2002:a05:6808:1442:b0:3df:16db:8b9e with SMTP id 5614622812f47-3df1c95d85amr11112717b6e.11.1725319091413; Mon, 02 Sep 2024 16:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725319091; cv=none; d=google.com; s=arc-20240605; b=HrlLfP2JpQlGpWH9qySd/Jd/rBHknYzU/+iMnwWalImK95BMsxh26fxbVnpTmg0FSe jIfWYpTZadZ3P066eUVChw/gFYUI6qmwUw1S+IWpUWMJPJXzaKx0Go4rY5xEUWfIyFMn HOUA4IUGzzFygmxHWoRLvIkaOVQpy8IW5gA66qfIeKRjtsdP1c/OVVKxaItTUJIogLxd 7PpDIgkfl/i12x0ptK8OZE80ga2iysXIaQfLI24qavYdRNChSwB81d+X8a5Ek0XyrBNq HzE+sMp6sZ4yOFWt375KsZCJH0TYE5fsNcS9Wf/tpbWUgydEu+u5jZdzeib8hU8MMPiA YdbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :feedback-id:dkim-signature:dkim-signature; bh=4o6t0ACKcO8NiKXiJnVXYTv+GlnBR2IefU1nEK0i7ZM=; fh=htB4OprfBlnXyMypK6zjKViIJmpg/UrDOpADf2DI1NM=; b=OTSyW812hLM2h+XdJrKE2X+9N9WlDKydYmw+5oMpQMXozE5JmnlE30IZjfi/4Pb3xQ c6DIlzuh3Cly7iQaY6OxGcGkI6Kx6bM323+GbHrmmzVY8+To6iR5t/VYx0s+Tcv8XOHK 95T2xiTH6FO4M5JxbyNRnf90HKmyeysR+FUWsRjS59LIZEBkyHvYLbR1D7wB7xqFqfzY pwyMlRXcsnK1lWR2Vbo8iQlhBnqGuQvBKY2YalqS8EgSXKo+sY9TIDfxTMOfDinamA7T 9lmHmR0qS+8aHQP/u0feKiBGTgIly90keOMGHONmPd+wJrDTkDODZ4FaLXXDK0IyGa5D KalQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=ZGVPTH2z; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NJrXPhnX; spf=pass (google.com: domain of me@tobin.cc designates 103.168.172.159 as permitted sender) smtp.mailfrom=me@tobin.cc; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tobin.cc Received: from fhigh8-smtp.messagingengine.com (fhigh8-smtp.messagingengine.com. [103.168.172.159]) by gmr-mx.google.com with ESMTPS id 5614622812f47-3df11645128si404724b6e.0.2024.09.02.16.18.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 16:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of me@tobin.cc designates 103.168.172.159 as permitted sender) client-ip=103.168.172.159; Received: from phl-compute-08.internal (phl-compute-08.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 89B731140189; Mon, 2 Sep 2024 19:18:10 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Mon, 02 Sep 2024 19:18:10 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudehgedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvvefukfgg tgguofesthdtredtredtvdenucfhrhhomhepvfhosghinhcujfgrrhguihhnghcuoehmvg esthhosghinhdrtggtqeenucggtffrrghtthgvrhhnpeeuleffudffveelfedtuedvgeeh vdelheejieejtdevtdelfeetkeefvefgjefftdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmvgesthhosghinhdrtggtpdhnsggprhgtphht thhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsihhttghoihhnuggvvh esghhoohhglhgvghhrohhuphhsrdgtohhmpdhrtghpthhtoheprghpohgvlhhsthhrrges fihpshhofhhtfigrrhgvrdhnvghtpdhrtghpthhtohepmhgrrhhtihhnrdhhrggsohhvsh htihgrkhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i05c0407e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Sep 2024 19:18:09 -0400 (EDT) Date: Tue, 3 Sep 2024 09:18:05 +1000 From: Tobin Harding To: bitcoindev@googlegroups.com Cc: Andrew Poelstra , Martin =?utf-8?Q?Habov=C5=A1tiak?= Subject: [bitcoindev] ReadCompactSize without range check Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline X-Mailer: Mutt 2.1.4 (2021-12-11) X-Original-Sender: me@tobin.cc X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@tobin.cc header.s=fm3 header.b=ZGVPTH2z; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NJrXPhnX; spf=pass (google.com: domain of me@tobin.cc designates 103.168.172.159 as permitted sender) smtp.mailfrom=me@tobin.cc; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tobin.cc 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 (/) Hi, Context: - The `ReadCompactSize` function takes an optional `range_check` parameter that defaults to `true` (see `serialize.h`). - `range_check == true` enforces that the compact size value is less than 0x02000000 i.e., if fits within a 32 unsigned integer. - Grepping the code base shows that `ReadCompactSize` is never called with `false`. My question is please: Is there any reason not use a 32 bit integer for a value encoded using CompactSize and ignore the 0xFF/9-byte-encoding of a compact size all together? Thanks, Tobin. -- 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 on the web visit https://groups.google.com/d/msgid/bitcoindev/ZtZHrc3XvTXEvHf6%40alke.