Return-Path: Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5E897C000E; Wed, 14 Jul 2021 03:32:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 52D4560A50; Wed, 14 Jul 2021 03:32:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -1.499 X-Spam-Level: X-Spam-Status: No, score=-1.499 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.398, SPF_HELO_NONE=0.001, SPF_NONE=0.001, UNPARSEABLE_RELAY=0.001] autolearn=no autolearn_force=no Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gNRMYPXb6Yop; Wed, 14 Jul 2021 03:32:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from azure.erisian.com.au (cerulean.erisian.com.au [139.162.42.226]) by smtp3.osuosl.org (Postfix) with ESMTPS id 842EF608DC; Wed, 14 Jul 2021 03:32:10 +0000 (UTC) Received: from aj@azure.erisian.com.au (helo=sapphire.erisian.com.au) by azure.erisian.com.au with esmtpsa (Exim 4.92 #3 (Debian)) id 1m3Vcz-0004BI-OG; Wed, 14 Jul 2021 13:32:07 +1000 Received: by sapphire.erisian.com.au (sSMTP sendmail emulation); Wed, 14 Jul 2021 13:32:00 +1000 Date: Wed, 14 Jul 2021 13:32:00 +1000 From: Anthony Towns To: Jeremy Message-ID: <20210714033200.GA7155@erisian.com.au> References: <20210708084416.GB1339@erisian.com.au> <20210712050115.GA6250@erisian.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score-int: -18 X-Spam-Bar: - Cc: Bitcoin Protocol Discussion , lightning-dev Subject: Re: [bitcoin-dev] [Lightning-dev] Eltoo / Anyprevout & Baked in Sequences X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 03:32:11 -0000 On Mon, Jul 12, 2021 at 03:07:29PM -0700, Jeremy wrote: > Perhaps there's a more general principle -- evaluating a script should > only return one bit of info: "bool tx_is_invalid_script_failed"; every > other bit of information -- how much is paid in fees (cf ethereum gas > calculations), when the tx is final, if the tx is only valid in some > chain fork, if other txs have to have already been mined / can't have > been mined, who loses funds and who gets funds, etc... -- should already > be obvious from a "simple" parsing of the tx. > I don't think we have this property as is. > E.g. consider the transaction: > TX: >    locktime: None >    sequence: 100 >    scriptpubkey: 101 CSV That tx will never be valid, no matter the state of the chain -- even if it's 420 blocks after the utxo it's spending: it fails because "top stack item is greater than the transaction input sequence" rule from BIP 112. > How will you tell it is able to be included without running the script? You have to run the script at some point, but you don't need to run the script to differentiate between it being valid on one chain vs valid on some other chain. > What's nice is the transaction in this form cannot go from invalid to valid -- > once invalid it is always invalid for a given UTXO. Huh? Timelocks always go from invalid to valid -- they're invalid prior to some block height (IsFinal() returns false), then valid after. Not going from valid to invalid is valuable because it limits the cases where you have to remove txs (and their descendents) from the mempool. Cheers, aj