<p>Transaction validity rules applied to the mempool/unconfirmed transactions are static; they include all known softforks, for example, independent of whether those are (already) active on the chain. This simplifies mempool reasoning around the time softforks activate, as the alternative would mean the mempool needs to be re-evaluated every time rules change.</p>
<p>On regtest it is possible to operate in a state where the BIP68 software isn't active from the very beginning. What does <code>getdeploymentinfo</code> say under <code>&quot;csv&quot;</code>?</p>

CC BY-SA 4.0
2022-11-08T21:36:47.843Z
I've upgraded to v23.0.0 from v22.0.0. Now I get TestBlockValidity failed: bad-txns-nonfinal (code -25) error. Thank you!
Burak
CC BY-SA 4.0
2022-11-08T21:45:22.403Z
Prior to 23.0, CSV would activate after height 432. In 23.0 and later, all soft forks are set to always be active, although this can be overridden in configuration.
Ava Chow
CC BY-SA 4.0
2022-11-08T21:28:46.783Z
2022-11-08T21:28:46.783Z
Pieter Wuille
<p>On regtest, I can use <code>generateblock</code> to successfully a mine transaction i.e containing an input with nSequence (0x05000000), although the input has not reached the specified age (5 confirmations). Though I get <strong>non-BIP68-final (code -26)</strong> error when I use <code>sendrawtransaction</code>. Wondering why this is the case.</p>
<p>Here's how I do it:</p>
<p>For easy demonstration I fund OP_TRUE (<code>decodescript 51</code>). It gives me p2wsh address: <code>bcrt1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqseac85</code>.</p>
<p>Then I fund this address 1000 sats: TXID: <code>a21c3ccc203f0c30c613e4409b011e5753ca10bb93fe5036849ab87e14e4cb6c</code>, VOUT: <code>1</code>.</p>
<p>Then I mine this funding transaction:</p>
<pre><code>generateblock 2N1AwW2Jv4NcsgBWwggDPN7PLx4MpgRNjhs '[&quot;a21c3ccc203f0c30c613e4409b011e5753ca10bb93fe5036849ab87e14e4cb6c&quot;]'
</code></pre>
<p>Then I manually construct a raw tx spending this input with witness 0x51, with nSequence 0x02000000:</p>
<pre><code>020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000
</code></pre>
<p><code>sendrawtransaction 020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000</code> gives me the error: <strong>“non-BIP68-final (code -26)”</strong></p>
<p>However,</p>
<p><code>generateblock 2N1AwW2Jv4NcsgBWwggDPN7PLx4MpgRNjhs '[&quot;020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000&quot;]'</code>
successfully mines the block:</p>
<pre><code>{
  &quot;hash&quot;: &quot;0f63ae01726730e186a5a8e16c2b4f9673ce135c46d033f8c60ee636319ffa6a&quot;
}
</code></pre>

CC BY-SA 4.0
2022-11-08T21:07:02.600Z
Can you provide the transaction you are attempting to broadcast and the details about the UTXO(s) it spends?
Ava Chow
CC BY-SA 4.0
2022-11-08T21:18:40.503Z
Updated my post.
Burak
<regtest>
BIP68 does not apply on regtest
Burak
# BIP68 does not apply on regtest

(Asked by: username_0 on 2022-11-08)

On regtest, I can use generateblock to successfully a mine transaction i.e containing an input with nSequence (0x05000000), although the input has not reached the specified age (5 confirmations). Though I get non-BIP68-final (code -26) error when I use sendrawtransaction. Wondering why this is the case.
Here's how I do it:
For easy demonstration I fund OP_TRUE (decodescript 51). It gives me p2wsh address: bcrt1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqseac85.
Then I fund this address 1000 sats: TXID: a21c3ccc203f0c30c613e4409b011e5753ca10bb93fe5036849ab87e14e4cb6c, VOUT: 1.
Then I mine this funding transaction:
generateblock 2N1AwW2Jv4NcsgBWwggDPN7PLx4MpgRNjhs '["a21c3ccc203f0c30c613e4409b011e5753ca10bb93fe5036849ab87e14e4cb6c"]'

Then I manually construct a raw tx spending this input with witness 0x51, with nSequence 0x02000000:
020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000

sendrawtransaction 020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000 gives me the error: “non-BIP68-final (code -26)”
However,
generateblock 2N1AwW2Jv4NcsgBWwggDPN7PLx4MpgRNjhs '["020000000001016ccbe4147eb89a843650fe93bb10ca53571e019b40e413c6300c3f20cc3c1ca201000000000200000001f4010000000000002251209bb9efbddf9d70afd3ac2cef011747236bdf90832a78b08f57d1139f07aa918501015100000000"]'
successfully mines the block:
{
  "hash": "0f63ae01726730e186a5a8e16c2b4f9673ce135c46d033f8c60ee636319ffa6a"
}

**Tags:** regtest

> **Comments:**
> **username_1**: Can you provide the transaction you are attempting to broadcast and the details about the UTXO(s) it spends?  
> **username_0**: Updated my post.  

---

## 1 answers

### Answer by username_2 on 2022-11-08. Score: 3 | Accepted answer

Transaction validity rules applied to the mempool/unconfirmed transactions are static; they include all known softforks, for example, independent of whether those are (already) active on the chain. This simplifies mempool reasoning around the time softforks activate, as the alternative would mean the mempool needs to be re-evaluated every time rules change.

On regtest it is possible to operate in a state where the BIP68 software isn't active from the very beginning. What does `getdeploymentinfo` say under `"csv"`?

> **Comments:**
> **username_0**: I've upgraded to v23.0.0 from v22.0.0. Now I get TestBlockValidity failed: bad-txns-nonfinal (code -25) error. Thank you!  
> **username_1**: Prior to 23.0, CSV would activate after height 432. In 23.0 and later, all soft forks are set to always be active, although this can be overridden in configuration.  

---

