Replies: 1 comment
-
Continue digging into this, we can rule out all the non-transitory errors before reaching the This leaves us with: Relevant
The minimum fee for the mempool is not met, this can change over time, so waiting may fix it.
The transaction is already in our mempool, we need to keep watching until it gets
There's a conflict with a transaction in the mempool. There's no much we can do here but retry in case the transaction in the mempool gets evicted.
The mempool is full. Waiting may solve this.
The transaction we're trying to send has a
The transaction we're trying to send has a relative time-lock that has not been met (
The transaction is already in the blockchain. Same as for transaction being in the mempool applies, we should monitor them until Relevant (once we can fee bump)
Fee too low. Bump.
We should not hit this one provided our node is set to allow high fees. It's also worth considering that the fee margin the tower may be rather small, otherwise it would be uneconomical to bump.
Fee too low. Bump. Not relevant (non-transitory errors, cannot be fixed without resigning)
The transaction is too small.
The transaction has non-standard
The tx exceed the
At least one of the tx scripts break some of the standardness rules.
At least one of the provided witnesses is not standard.
The transaction is a coinbase transaction (outside a block generation)
At least one of the scripts break the consensus rules.
Trying to spend from an output that would not exists if this tx is created. e.g: RBF txA for txB which spends outputs from txA. To check (includes RBFs)
Too many unconfirmed parents, tx spends from big chain of unconfirmed txs (defaults to 25). This is transitory, since confirming some of the parents may fix it. It should not apply to LN but may to other protocols. May be relevant.
Transaction tries to replace too many transactions in the mempool. This would be transitory as long as the other transaction in the mempool are evicted for whatever reason, even though it seems quite unlikely. May be relevant.
A replacement has a new input pointing to a tx in the mempool. This is transitory, the unconfirmed parent can be received after the transaction is being rejected. Relevant.
Missing inputs. This actually returns This may be relevant since the transaction to be relayed may be currently missing an input that may be received in the future. May be relevant. |
Beta Was this translation helpful? Give feedback.
-
After getting a
Breach
from theWatcher
(and therefore decrypting theencrypted_blob
) aResponder
can face multiple rejections frombitcoind
when trying to broadcast thepenalty transaction
:RPC_VERIFY_REJECTED (-26)
This include most of, both, consensus and relay rules. Invalid transactions (properly formatted but invalid, like unsigned) fit here too. This is an exhaustive1 list errors.
Codes
REJECT_MALFORMED
0x01 (1)REJECT_INVALID
0x10 (16)REJECT_OBSOLETE
0x11 (17)REJECT_DUPLICATE
0x12 (18)REJECT_NONSTANDARD
0x40 (64)REJECT_INSUFFICIENTFEE
0x42 (66)REJECT_CHECKPOINT
0x43 (67)REJECT_HIGHFEE
0x100 (256)Relay rules
TX_MEMPOOL_POLICY
TX_NOT_STANDARD
reason
, REJECT_NONSTANDARD 4TX_PREMATURE_SPEND
TX_CONFLICT
TX_WITNESS_MUTATED
reason
,reject_reason
(everything is parametrised in this one, line 932) 2Consensus rules
Some of the aforementioned relay rules can be attack surfaces.
For instance a transaction paying too much fees is a valid transaction, butThis is actually not a relay policy but a wallet one, meaning that this transactions will be relayed if they are accepted by our local node (by changingbitcoind
would reject. Furthermore, if we modify our node and send it to the network, Bitcoin Core nodes would drop (and not propagate) it. Check this for the hard imposed Bitcoin Core max fee.-maxfee
for instance).A similar thing may happen to transactions including dust outputs, or anything in 4.
RPC_VERIFY_ERROR (-25)
This seems to only cover a transaction trying to spend from non-existing / already spent outputs:
However,
RPC_TRANSACTION_ERROR
aliasesRPC_VERIFY_ERROR
and it's the default return forRPCErrorFromTransactionError
[ref]RPC_VERIFY_ALREADY_IN_CHAIN (-27)
The transaction is already in the blockchain. Either another tower, the customer or who-knowns has already broadcast the transaction.
Nothing to worry about here, we can get the confirmation count and monitor the transaction until the end of the appointment.
RPC_DESERIALIZATION_ERROR (-22)
The transaction cannot be deserialised. In other words, the transaction is malformed. Probably random data sent as transaction data. The
Responder
SHOULD NEVER face this issue, since theWatcher
checks that the transaction properly deserialises before handing the job.Finally, there is an additional rejection problem I haven't been able to test myself yet:
RPC_CLIENT_NOT_CONNECTED (-9)
This error relates to the node not being connected to any other node.
Some of this errors (like the later or the ones in 4) may not be raised in
regtest
ortestnet
.Leaving this here both to discuss what to do with relay rules and as notes of all the possible errors.
1 The list has been manually parsed from bitcoin/src/validation.cpp up to the first rejection referring to blocks.
2 Have to check these ones properly. Not sure about when they're triggered.
3 Attack surface.
4 Any of the reasons that make a transaction non-standard.
Beta Was this translation helpful? Give feedback.
All reactions