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

_______________________________________________
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev

Reply via email to