stakwork/sphinx-key

VLS Policy management

Opened this issue · 10 comments

  • how do we change policies?

    • maybe we have another MQTT topic for publishing policy changes to the key. The app will need to sign the policy payload with the private key
  • recovering from policy "crash"... the key should not panic

For example, when receiving a 1000 sat payment for an invoice of the same amount, we crash on a policy failure as shown below:

I (2763296) lightning_signer::node: 026f signing an invoice d894de2f85253ba6683e1581423879850ed5af524594447da934d32f45760573 -> 1000000
I (2771276) sphinx_key_signer: VLS msg: ValidateCommitmentTx(ValidateCommitmentTx { tx: LargeBytes([2, 0, 0, 0, 1, 140, 119, 107, 106, 252, 146, 96, 108, 91, 17, 198, 5, 226, 89, 211, 92, 154, 96, 65, 50, 102, 169, 141, 26, 221, 169, 62, 123, 69, 218, 105, 119, 1, 0, 0, 0, 0, 77, 127, 109, 128, 4, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 21, 16, 93, 107, 189, 133, 132, 109, 154, 170, 4, 90, 5, 122, 192, 36, 191, 32, 110, 101, 98, 35, 169, 104, 131, 17, 198, 11, 20, 121, 135, 123, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 202, 160, 101, 53, 251, 108, 110, 96, 202, 141, 7, 243, 14, 219, 252, 17, 236, 94, 40, 235, 20, 50, 56, 165, 105, 29, 122, 60, 37, 136, 46, 241, 232, 3, 0, 0, 0, 0, 0, 0, 34, 0, 32, 59, 229, 122, 247, 37, 95, 123, 209, 196, 105, 113, 126, 72, 146, 248, 96, 250, 176, 0, 12, 193, 45, 88, 251, 77, 37, 24, 228, 162, 31, 7, 47, 110, 126, 1, 0, 0, 0, 0, 0, 34, 0, 32, 210, 139, 216, 45, 7, 177, 133, 181, 129, 254, 169, 80, 127, 175, 128, 225, 6, 38, 81, 227, 237, 113, 158, 12, 203, 64, 4, 94, 46, 46, 114, 123, 166, 95, 139, 32]), psbt: LargeBytes([112, 115, 98, 116, 255, 1, 0, 223, 2, 0, 0, 0, 1, 140, 119, 107, 106, 252, 146, 96, 108, 91, 17, 198, 5, 226, 89, 211, 92, 154, 96, 65, 50, 102, 169, 141, 26, 221, 169, 62, 123, 69, 218, 105, 119, 1, 0, 0, 0, 0, 77, 127, 109, 128, 4, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 21, 16, 93, 107, 189, 133, 132, 109, 154, 170, 4, 90, 5, 122, 192, 36, 191, 32, 110, 101, 98, 35, 169, 104, 131, 17, 198, 11, 20, 121, 135, 123, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 202, 160, 101, 53, 251, 108, 110, 96, 202, 141, 7, 243, 14, 219, 252, 17, 236, 94, 40, 235, 20, 50, 56, 165, 105, 29, 122, 60, 37, 136, 46, 241, 232, 3, 0, 0, 0, 0, 0, 0, 34, 0, 32, 59, 229, 122, 247, 37, 95, 123, 209, 196, 105, 113, 126, 72, 146, 248, 96, 250, 176, 0, 12, 193, 45, 88, 251, 77, 37, 24, 228, 162, 31, 7, 47, 110, 126, 1, 0, 0, 0, 0, 0, 34, 0, 32, 210, 139, 216, 45, 7, 177, 133, 181, 129, 254, 169, 80, 127, 175, 128, 225, 6, 38, 81, 227, 237, 113, 158, 12, 203, 64, 4, 94, 46, 46, 114, 123, 166, 95, 139, 32, 0, 1, 1, 43, 160, 134, 1, 0, 0, 0, 0, 0, 34, 0, 32, 189, 39, 192, 48, 240, 243, 106, 61, 101, 136, 166, 19, 35, 175, 27, 66, 204, 103, 113, 47, 112, 208, 109, 172, 157, 212, 196, 208, 15, 144, 32, 130, 34, 2, 2, 199, 112, 204, 100, 167, 17, 227, 112, 230, 107, 96, 223, 150, 127, 161, 69, 255, 202, 195, 96, 231, 194, 254, 96, 34, 120, 32, 187, 113, 247, 178, 183, 71, 48, 68, 2, 32, 56, 229, 57, 24, 16, 108, 237, 145, 110, 194, 52, 133, 11, 213, 198, 105, 101, 79, 79, 103, 173, 33, 73, 88, 132, 123, 62, 28, 136, 106, 92, 239, 2, 32, 111, 165, 199, 135, 114, 54, 75, 133, 39, 166, 135, 84, 130, 149, 89, 178, 136, 250, 50, 131, 252, 155, 10, 28, 224, 125, 157, 21, 172, 192, 176, 135, 1, 1, 3, 4, 1, 0, 0, 0, 1, 5, 71, 82, 33, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 33, 2, 199, 112, 204, 100, 167, 17, 227, 112, 230, 107, 96, 223, 150, 127, 161, 69, 255, 202, 195, 96, 231, 194, 254, 96, 34, 120, 32, 187, 113, 247, 178, 183, 82, 174, 34, 6, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 8, 107, 45, 127, 120, 0, 0, 0, 0, 34, 6, 2, 199, 112, 204, 100, 167, 17, 227, 112, 230, 107, 96, 223, 150, 127, 161, 69, 255, 202, 195, 96, 231, 194, 254, 96, 34, 120, 32, 187, 113, 247, 178, 183, 8, 69, 176, 60, 214, 0, 0, 0, 0, 0, 1, 1, 40, 33, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 172, 115, 100, 96, 178, 104, 0, 1, 1, 40, 33, 2, 199, 112, 204, 100, 167, 17, 227, 112, 230, 107, 96, 223, 150, 127, 161, 69, 255, 202, 195, 96, 231, 194, 254, 96, 34, 120, 32, 187, 113, 247, 178, 183, 172, 115, 100, 96, 178, 104, 0, 1, 1, 141, 118, 169, 20, 2, 133, 239, 195, 159, 83, 209, 207, 27, 161, 32, 204, 90, 163, 186, 130, 113, 195, 110, 123, 135, 99, 172, 103, 33, 2, 210, 244, 233, 8, 147, 183, 207, 6, 234, 199, 176, 58, 153, 95, 92, 93, 223, 97, 13, 234, 66, 148, 92, 170, 156, 150, 245, 2, 193, 87, 180, 136, 124, 130, 1, 32, 135, 99, 169, 20, 186, 37, 227, 184, 45, 103, 4, 125, 206, 236, 246, 13, 252, 213, 225, 176, 113, 119, 225, 43, 136, 82, 124, 33, 2, 152, 174, 188, 73, 113, 229, 77, 154, 77, 19, 149, 43, 234, 145, 71, 142, 163, 177, 85, 106, 68, 244, 45, 193, 59, 230, 216, 214, 153, 222, 46, 54, 82, 174, 103, 117, 2, 58, 1, 177, 117, 172, 104, 81, 178, 117, 104, 0, 1, 1, 37, 33, 2, 126, 164, 51, 154, 164, 148, 165, 102, 127, 129, 128, 243, 139, 186, 167, 11, 81, 18, 44, 105, 122, 119, 251, 19, 183, 157, 236, 79, 40, 55, 12, 252, 173, 81, 178, 0]), htlcs: [Htlc { side: 1, amount: 1000000, payment_hash: Sha256([216, 148, 222, 47, 133, 37, 59, 166, 104, 62, 21, 129, 66, 56, 121, 133, 14, 213, 175, 82, 69, 148, 68, 125, 169, 52, 211, 47, 69, 118, 5, 115]), ctlv_expiry: 314 }], commitment_number: 7, feerate: 253, signature: BitcoinSignature { signature: [56, 229, 57, 24, 16, 108, 237, 145, 110, 194, 52, 133, 11, 213, 198, 105, 101, 79, 79, 103, 173, 33, 73, 88, 132, 123, 62, 28, 136, 106, 92, 239, 111, 165, 199, 135, 114, 54, 75, 133, 39, 166, 135, 84, 130, 149, 89, 178, 136, 250, 50, 131, 252, 155, 10, 28, 224, 125, 157, 21, 172, 192, 176, 135], sighash: 1 }, htlc_signatures: [BitcoinSignature { signature: [115, 79, 24, 168, 50, 132, 218, 215, 42, 181, 197, 211, 89, 112, 233, 34, 109, 56, 172, 235, 122, 49, 49, 141, 61, 3, 158, 197, 46, 67, 139, 39, 27, 249, 224, 33, 187, 172, 10, 79, 147, 15, 27, 234, 49, 115, 251, 180, 251, 9, 164, 70, 33, 167, 122, 42, 72, 177, 173, 36, 106, 246, 102, 92], sighash: 131 }] })
W (2771966) lightning_signer::channel: VALIDATION FAILED: Policy("validate_holder_commitment_tx: validate_commitment_tx: received htlc.value_sat 1000 less than dust limit 2448")
tx=Transaction {
    version: 2,
    lock_time: 546004902,
    input: [
        TxIn {
            previous_output: OutPoint {
                txid: 7769da457b3ea9dd1a8da9663241609a5cd359e205c6115b6c6092fc6a6b778c,
                vout: 1,
            },
            script_sig: Script(),
            sequence: 2154659661,
            witness: Witness {
                content: [],
                witness_elements: 0,
                last: 0,
                second_to_last: 0,
            },
        },
    ],
    output: [
        TxOut {
            value: 330,
            script_pubkey: Script(OP_0 OP_PUSHBYTES_32 15105d6bbd85846d9aaa045a057ac024bf206e656223a9688311c60b1479877b),
        },
        TxOut {
            value: 330,
            script_pubkey: Script(OP_0 OP_PUSHBYTES_32 caa06535fb6c6e60ca8d07f30edbfc11ec5e28eb143238a5691d7a3c25882ef1),
        },
        TxOut {
            value: 1000,
            script_pubkey: Script(OP_0 OP_PUSHBYTES_32 3be57af7255f7bd1c469717e4892f860fab0000cc12d58fb4d2518e4a21f072f),
        },
        TxOut {
            value: 97902,
            script_pubkey: Script(OP_0 OP_PUSHBYTES_32 d28bd82d07b185b581fea9507faf80e1062651e3ed719e0ccb40045e2e2e727b),
        },
    ],
}
setup=ChannelSetup {
    is_outbound: false,
    channel_value_sat: 100000,
    push_value_msat: 0,
    funding_outpoint: OutPoint {
        txid: 7769da457b3ea9dd1a8da9663241609a5cd359e205c6115b6c6092fc6a6b778c,
        vout: 1,
    },
    holder_selected_contest_delay: 6,
    holder_shutdown_script: None,
    counterparty_points: ChannelPublicKeys {
        funding_pubkey: PublicKey(
            b7b2f771bb20782260fec2e760c3caff45a17f96df606be670e311a764cc70c7dec0212a6e87a8823ddad34a0f9607d40c5eb3a482646617a6751ff2f9414bc6,
        ),
        revocation_basepoint: PublicKey(
            9e08fa4db151c582bdf23538b7d5ed9156edac433200673441a9d649b7edf485c3c6fe33e234c443d239969b92c86cba6ef4ed809b20ba022da7d13e0fa81954,
        ),
        payment_point: PublicKey(
            fc0c37284fec9db713fb777a692c12510ba7ba8bf380817f66a594a49a33a47e6ebd2817defeb0ac37391357d1e8e7e1bc72626fc91879021eae9222e9dffd1a,
        ),
        delayed_payment_basepoint: PublicKey(
            17f8622b7609a826fd667e873fbbfe9182de60e97e061e0dd410506b31d4db241607495926079d708a307f7a4099eb3fe52cf284e41a63fd60f25373ac092d1c,
        ),
        htlc_basepoint: PublicKey(
            2de23ae22ce66ed2876914102aa2e48b10cb2dd63879103a88a69f5a53e4827131e9a89c9b804754951436c7ff8706842a33549a7153a1ecdf68a6230a06abde,
        ),
    },
    counterparty_selected_contest_delay: 6,
    counterparty_shutdown_script: None,
    commitment_type: Anchors,
}
state=ChainState {
    current_height: 0,
    funding_depth: 0,
    funding_double_spent_depth: 0,
    closing_depth: 0,
}
info=CommitmentInfo2 {
    is_counterparty_broadcaster: false,
    to_countersigner_pubkey: PublicKey(
        fc0c37284fec9db713fb777a692c12510ba7ba8bf380817f66a594a49a33a47e6ebd2817defeb0ac37391357d1e8e7e1bc72626fc91879021eae9222e9dffd1a,
    ),
    to_countersigner_value_sat: 97902,
    revocation_pubkey: PublicKey(
        84fa60767f458a0b5b6a00c3883f49574d64500e9db6b5c871b436d7adf9d982fe86d7aa44cccc5855a5e9bec7de172375ae3cf82a1459bfb9b6b57252f6101e,
    ),
    to_broadcaster_delayed_pubkey: PublicKey(
        7e259d2da3df574167b901ca5f098fc40445ea35dba3d1cfb8d179e4b9651235186f9ccc7d3d2995a192f54d98bbac803dedf546e414f77779b224a023520c30,
    ),
    to_broadcaster_value_sat: 0,
    to_self_delay: 6,
    offered_htlcs: [],
    received_htlcs: [
        HTLCInfo2 {
            value_sat: 1000,
            payment_hash: "d894de2f85253ba6683e1581423879850ed5af524594447da934d32f45760573",
            cltv_expiry: 314,
        },
    ],
    feerate_per_kw: 253,
}
E (2772306) lightning_signer::util::status: FAILED PRECONDITION: policy failure: validate_holder_commitment_tx: validate_commitment_tx: received htlc.value_sat 1000 less than dust limit 2448
Guru Meditation Error: Core  0 panic'ed (Illegal instruction). Exception was unhandled.
Core  0 register dump:
MEPC    : 0x4200c6d0  RA      : 0x4200c5e4  SP      : 0x3fc9fcc0  GP      : 0x3fc8f400  
TP      : 0x3fc54300  T0      : 0x00000006  T1      : 0x4038d94c  T2      : 0xfefefeff  
S0/FP   : 0x00000001  S1      : 0x00000001  A0      : 0x00000001  A1      : 0x3c1a3d50  
A2      : 0x3fcadeb0  A3      : 0x00000004  A4      : 0x3fc96396  A5      : 0x600c2000  
A6      : 0x3fcb8bd0  A7      : 0x0000000a  S2      : 0x0000001a  S3      : 0x3fc9ffb0  
S4      : 0x3fca0030  S5      : 0x3fc9ffc0  S6      : 0x00000000  S7      : 0x3c1a06c0  
S8      : 0x3c1a068c  S9      : 0x3fca0130  S10     : 0x3c1a066c  S11     : 0x00000001  
T3      : 0x00000000  T4      : 0x3a3a6c69  T5      : 0x00000000  T6      : 0x20303030  
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
MHARTID : 0x00000000  
Stack memory:
3fc9fcc0: 0x00000037 0x3fc9fd9c 0x00000001 0x00000000 0x00000000 0x00000000 0x068c6c22 0x3fca0030
3fc9fce0: 0x00000007 0x00000000 0x3fcb7954 0x00000100 0x000000df 0x3fcb60ec 0x00000400 0x0000033d
3fc9fd00: 0x3fcadcc0 0x00000004 0x00000001 0x000000fd 0x3fcae7f8 0x00000004 0x00000001 0x1839e538
3fc9fd20: 0x91ed6c10 0x8534c26e 0x69c6d50b 0x674f4f65 0x584921ad 0x1c3e7b84 0xef5c6a88 0x87c7a56f
3fc9fd40: 0x854b3672 0x5487a627 0xb2599582 0x8332fa88 0x1c0a9bfc 0x159d7de0 0x87b0c0ac 0x3c1c0101
3fc9fd60: 0xe1308e40 0x6606a638 0x37ea51fb 0xac3c5e80 0xb2606473 0x01010068 0xc7022128 0xa764cc70
3fc9fd80: 0xe670e311 0x96df606b 0xff45a17f 0xe760c3ca 0x2260fec2 0x71bb2078 0xacb7b2f7 0xb2606473
3fc9fda0: 0x01010068 0x14a9768d 0xc3ef8502 0xcfd1539f 0xcc20a11b 0x82baa35a 0x7b6ec371 0x67ac6387
3fc9fdc0: 0xf4d20221 0xb79308e9 0xc7ea06cf 0x5f993ab0 0x61df5d5c 0x9442ea0d 0x969caa5c 0x57c102f5
3fc9fde0: 0x827c88b4 0x63872001 0x068c6c22 0x3fca0030 0x00000007 0x00000000 0x3fcb7954 0x00000100
3fc9fe00: 0x000000df 0x3fcb60ec 0x00000400 0x0000033d 0x3fcadcc0 0x00000004 0x00000001 0x000000fd
3fc9fe20: 0x3fcae7f8 0x00000004 0x00000001 0x1839e538 0x91ed6c10 0x8534c26e 0x69c6d50b 0x674f4f65
3fc9fe40: 0x584921ad 0x1c3e7b84 0xef5c6a88 0x87c7a56f 0x854b3672 0x5487a627 0xb2599582 0x8332fa88
3fc9fe60: 0x1c0a9bfc 0x159d7de0 0x87b0c0ac 0x3c1c0101 0xe1308e40 0x6606a638 0x37ea51fb 0xac3c5e80
3fc9fe80: 0xb2606473 0x01010068 0xc7022128 0xa764cc70 0xe670e311 0x96df606b 0xff45a17f 0xe760c3ca
3fc9fea0: 0x2260fec2 0x71bb2078 0xacb7b2f7 0xb2606473 0x01010068 0x14a9768d 0xc3ef8502 0xcfd1539f
3fc9fec0: 0xcc20a11b 0x82baa35a 0x7b6ec371 0x67ac6387 0xf4d20221 0xb79308e9 0xc7ea06cf 0x5f993ab0
3fc9fee0: 0x61df5d5c 0x9442ea0d 0x969caa5c 0x57c102f5 0x827c88b4 0x63872001 0x827c88b4 0x63872001
3fc9ff00: 0x00000000 0x00000002 0x00000000 0x00000000 0x00000001 0x00000000 0x3fcae128 0x3fcb5b6c
3fc9ff20: 0x00000029 0x00000029 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9ff40: 0x00000000 0x00000000 0x00000400 0x420fd4f8 0x00000001 0x00000001 0x3fcb9558 0x0000007d
3fc9ff60: 0x0000007d 0x82304709 0x00000000 0x3c1a063e 0x3c1a06d0 0x3fca0034 0x3c1a06b8 0x3c1a063e
3fc9ff80: 0x3c1a062c 0x3fc96070 0x00000003 0x42004cb4 0x00000020 0x3fcb5bc4 0x3fc963e0 0x421008ac
3fc9ffa0: 0x3c1a06c8 0x00000001 0x00000001 0x3fcad340 0x00000000 0x00000000 0x3fcae128 0x0000001f
3fc9ffc0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9ffe0: 0x00000000 0x00000020 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca0000: 0x00000000 0x00000000 0x3c1a2800 0x420f0c68 0x00000002 0x3fcb7344 0x000004f5 0x000004f5
3fca0020: 0x00000002 0x3fcb7344 0x000004f5 0x000004f5 0x00000000 0x3fcb4980 0x0000004b 0x0000004b
3fca0040: 0x3fcb60ec 0x000004f5 0x000004f5 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca0060: 0x3fcac244 0x00000000 0x00000001 0x3fcad8d0 0x00000000 0x00000000 0x3fca0130 0x4200798c
3fca0080: 0x00000000 0x3fc963f4 0x5a804416 0x3fca1a94 0x00000000 0x3fca1a94 0x00000001 0x00000010
3fca00a0: 0x00000010 0x3fca1fbc 0x0000000a 0x0000000a 0x3fca205c 0x0000000a 0x0000000a 0x3fcac244
ELF file SHA256: 0000000000000000
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403805ae
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x172c
load:0x403ce000,len:0x928
load:0x403d0000,len:0x2ce0
entry 0x403ce000
I (35) boot: ESP-IDF v4.4-dev-2825-gb63ec47238 2nd stage bootloader
I (35) boot: compile time 12:10:40
I (35) boot: chip revision: 3
I (38) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (45) boot.esp32c3: SPI Speed      : 80MHz

And once we go above the dust limit, receiving a 5'000 sat payment, we crash like this:

I (149386) lightning_signer::node: 026f signing an invoice 233799904289713d0cf8831677c9cbe016fc4c627253fe2bb0967c7071dc22d7 -> 5000000
I (187966) sphinx_key_signer: VLS msg: ValidateCommitmentTx(ValidateCommitmentTx { tx: LargeBytes([2, 0, 0, 0, 1, 71, 29, 31, 111, 165, 253, 232, 8, 51, 202, 148, 237, 104, 138, 53, 26, 47, 233, 216, 169, 230, 142, 7, 212, 232, 81, 202, 170, 76, 235, 228, 95, 1, 0, 0, 0, 0, 29, 109, 42, 128, 4, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 21, 16, 93, 107, 189, 133, 132, 109, 154, 170, 4, 90, 5, 122, 192, 36, 191, 32, 110, 101, 98, 35, 169, 104, 131, 17, 198, 11, 20, 121, 135, 123, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 225, 105, 230, 20, 69, 169, 101, 12, 68, 86, 68, 234, 112, 91, 245, 211, 127, 156, 145, 142, 144, 140, 219, 35, 135, 229, 177, 129, 78, 107, 242, 56, 136, 19, 0, 0, 0, 0, 0, 0, 34, 0, 32, 217, 174, 89, 198, 131, 14, 237, 124, 86, 58, 121, 26, 116, 65, 178, 15, 197, 230, 165, 8, 236, 71, 180, 199, 247, 75, 251, 181, 41, 61, 2, 113, 61, 111, 1, 0, 0, 0, 0, 0, 34, 0, 32, 210, 128, 97, 123, 45, 32, 98, 202, 108, 63, 95, 221, 135, 249, 179, 16, 172, 160, 128, 47, 67, 0, 43, 21, 83, 107, 32, 33, 128, 171, 213, 226, 1, 73, 234, 32]), psbt: LargeBytes([112, 115, 98, 116, 255, 1, 0, 223, 2, 0, 0, 0, 1, 71, 29, 31, 111, 165, 253, 232, 8, 51, 202, 148, 237, 104, 138, 53, 26, 47, 233, 216, 169, 230, 142, 7, 212, 232, 81, 202, 170, 76, 235, 228, 95, 1, 0, 0, 0, 0, 29, 109, 42, 128, 4, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 21, 16, 93, 107, 189, 133, 132, 109, 154, 170, 4, 90, 5, 122, 192, 36, 191, 32, 110, 101, 98, 35, 169, 104, 131, 17, 198, 11, 20, 121, 135, 123, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 225, 105, 230, 20, 69, 169, 101, 12, 68, 86, 68, 234, 112, 91, 245, 211, 127, 156, 145, 142, 144, 140, 219, 35, 135, 229, 177, 129, 78, 107, 242, 56, 136, 19, 0, 0, 0, 0, 0, 0, 34, 0, 32, 217, 174, 89, 198, 131, 14, 237, 124, 86, 58, 121, 26, 116, 65, 178, 15, 197, 230, 165, 8, 236, 71, 180, 199, 247, 75, 251, 181, 41, 61, 2, 113, 61, 111, 1, 0, 0, 0, 0, 0, 34, 0, 32, 210, 128, 97, 123, 45, 32, 98, 202, 108, 63, 95, 221, 135, 249, 179, 16, 172, 160, 128, 47, 67, 0, 43, 21, 83, 107, 32, 33, 128, 171, 213, 226, 1, 73, 234, 32, 0, 1, 1, 43, 160, 134, 1, 0, 0, 0, 0, 0, 34, 0, 32, 165, 105, 118, 188, 192, 254, 147, 21, 211, 99, 73, 176, 32, 129, 156, 237, 254, 201, 1, 55, 243, 253, 77, 211, 244, 195, 21, 81, 216, 140, 123, 146, 34, 2, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 71, 48, 68, 2, 32, 97, 42, 24, 104, 65, 144, 59, 166, 26, 218, 193, 73, 65, 33, 241, 245, 4, 166, 151, 30, 14, 140, 238, 174, 140, 54, 48, 32, 32, 25, 55, 165, 2, 32, 43, 2, 107, 217, 220, 45, 102, 178, 197, 198, 243, 57, 226, 66, 95, 231, 159, 104, 151, 20, 21, 135, 136, 165, 7, 159, 4, 126, 239, 86, 37, 200, 1, 1, 3, 4, 1, 0, 0, 0, 1, 5, 71, 82, 33, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 33, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 82, 174, 34, 6, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 8, 107, 45, 127, 120, 0, 0, 0, 0, 34, 6, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 8, 246, 198, 89, 123, 0, 0, 0, 0, 0, 1, 1, 40, 33, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 172, 115, 100, 96, 178, 104, 0, 1, 1, 40, 33, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 172, 115, 100, 96, 178, 104, 0, 1, 1, 141, 118, 169, 20, 92, 206, 208, 213, 213, 125, 90, 111, 227, 83, 50, 222, 113, 145, 220, 209, 108, 75, 226, 47, 135, 99, 172, 103, 33, 3, 49, 249, 170, 162, 140, 107, 97, 105, 249, 218, 167, 83, 253, 242, 135, 194, 148, 157, 87, 7, 220, 65, 134, 52, 60, 144, 34, 128, 45, 35, 228, 189, 124, 130, 1, 32, 135, 99, 169, 20, 156, 35, 37, 120, 226, 246, 29, 219, 64, 89, 140, 101, 25, 10, 82, 54, 177, 67, 22, 164, 136, 82, 124, 33, 3, 33, 63, 18, 52, 165, 140, 249, 99, 32, 230, 53, 29, 76, 194, 125, 138, 100, 146, 196, 224, 153, 235, 190, 236, 97, 152, 48, 80, 43, 216, 75, 207, 82, 174, 103, 117, 2, 58, 1, 177, 117, 172, 104, 81, 178, 117, 104, 0, 1, 1, 37, 33, 3, 7, 56, 187, 213, 176, 22, 206, 179, 8, 100, 49, 120, 167, 107, 131, 127, 151, 110, 74, 20, 112, 245, 169, 249, 72, 196, 221, 184, 174, 250, 134, 176, 173, 81, 178, 0]), htlcs: [Htlc { side: 1, amount: 5000000, payment_hash: Sha256([35, 55, 153, 144, 66, 137, 113, 61, 12, 248, 131, 22, 119, 201, 203, 224, 22, 252, 76, 98, 114, 83, 254, 43, 176, 150, 124, 112, 113, 220, 34, 215]), ctlv_expiry: 314 }], commitment_number: 1, feerate: 253, signature: BitcoinSignature { signature: [97, 42, 24, 104, 65, 144, 59, 166, 26, 218, 193, 73, 65, 33, 241, 245, 4, 166, 151, 30, 14, 140, 238, 174, 140, 54, 48, 32, 32, 25, 55, 165, 43, 2, 107, 217, 220, 45, 102, 178, 197, 198, 243, 57, 226, 66, 95, 231, 159, 104, 151, 20, 21, 135, 136, 165, 7, 159, 4, 126, 239, 86, 37, 200], sighash: 1 }, htlc_signatures: [BitcoinSignature { signature: [63, 249, 10, 127, 241, 236, 227, 9, 135, 229, 210, 45, 207, 11, 154, 35, 119, 33, 162, 102, 11, 132, 139, 95, 145, 83, 119, 80, 33, 112, 224, 15, 62, 15, 179, 130, 29, 117, 73, 136, 145, 103, 109, 2, 212, 137, 23, 43, 147, 164, 134, 212, 165, 38, 223, 48, 188, 75, 86, 50, 168, 145, 244, 178], sighash: 131 }] })
I (188796) sphinx_key_signer: VLS msg: Ecdh(Ecdh { point: [2, 211, 8, 198, 224, 18, 232, 44, 205, 184, 166, 99, 196, 173, 37, 15, 153, 139, 45, 120, 89, 255, 29, 160, 89, 229, 95, 198, 103, 182, 251, 33, 245] })
I (188896) sphinx_key_signer: VLS msg: SignRemoteCommitmentTx(SignRemoteCommitmentTx { tx: LargeBytes([2, 0, 0, 0, 1, 71, 29, 31, 111, 165, 253, 232, 8, 51, 202, 148, 237, 104, 138, 53, 26, 47, 233, 216, 169, 230, 142, 7, 212, 232, 81, 202, 170, 76, 235, 228, 95, 1, 0, 0, 0, 0, 29, 109, 42, 128, 4, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 21, 16, 93, 107, 189, 133, 132, 109, 154, 170, 4, 90, 5, 122, 192, 36, 191, 32, 110, 101, 98, 35, 169, 104, 131, 17, 198, 11, 20, 121, 135, 123, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 225, 105, 230, 20, 69, 169, 101, 12, 68, 86, 68, 234, 112, 91, 245, 211, 127, 156, 145, 142, 144, 140, 219, 35, 135, 229, 177, 129, 78, 107, 242, 56, 136, 19, 0, 0, 0, 0, 0, 0, 34, 0, 32, 207, 200, 155, 181, 6, 60, 141, 197, 217, 89, 111, 138, 87, 162, 148, 95, 242, 6, 7, 234, 96, 147, 242, 165, 214, 66, 164, 126, 209, 69, 116, 176, 61, 111, 1, 0, 0, 0, 0, 0, 34, 0, 32, 93, 57, 236, 43, 108, 204, 34, 137, 39, 212, 178, 13, 239, 233, 64, 244, 189, 115, 141, 147, 84, 167, 216, 211, 1, 120, 70, 41, 131, 64, 113, 94, 1, 73, 234, 32]), psbt: LargeBytes([112, 115, 98, 116, 255, 1, 0, 223, 2, 0, 0, 0, 1, 71, 29, 31, 111, 165, 253, 232, 8, 51, 202, 148, 237, 104, 138, 53, 26, 47, 233, 216, 169, 230, 142, 7, 212, 232, 81, 202, 170, 76, 235, 228, 95, 1, 0, 0, 0, 0, 29, 109, 42, 128, 4, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 21, 16, 93, 107, 189, 133, 132, 109, 154, 170, 4, 90, 5, 122, 192, 36, 191, 32, 110, 101, 98, 35, 169, 104, 131, 17, 198, 11, 20, 121, 135, 123, 74, 1, 0, 0, 0, 0, 0, 0, 34, 0, 32, 225, 105, 230, 20, 69, 169, 101, 12, 68, 86, 68, 234, 112, 91, 245, 211, 127, 156, 145, 142, 144, 140, 219, 35, 135, 229, 177, 129, 78, 107, 242, 56, 136, 19, 0, 0, 0, 0, 0, 0, 34, 0, 32, 207, 200, 155, 181, 6, 60, 141, 197, 217, 89, 111, 138, 87, 162, 148, 95, 242, 6, 7, 234, 96, 147, 242, 165, 214, 66, 164, 126, 209, 69, 116, 176, 61, 111, 1, 0, 0, 0, 0, 0, 34, 0, 32, 93, 57, 236, 43, 108, 204, 34, 137, 39, 212, 178, 13, 239, 233, 64, 244, 189, 115, 141, 147, 84, 167, 216, 211, 1, 120, 70, 41, 131, 64, 113, 94, 1, 73, 234, 32, 0, 1, 1, 43, 160, 134, 1, 0, 0, 0, 0, 0, 34, 0, 32, 165, 105, 118, 188, 192, 254, 147, 21, 211, 99, 73, 176, 32, 129, 156, 237, 254, 201, 1, 55, 243, 253, 77, 211, 244, 195, 21, 81, 216, 140, 123, 146, 1, 5, 71, 82, 33, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 33, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 82, 174, 34, 6, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 8, 246, 198, 89, 123, 0, 0, 0, 0, 34, 6, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 8, 107, 45, 127, 120, 0, 0, 0, 0, 0, 1, 1, 40, 33, 2, 132, 103, 48, 156, 88, 162, 5, 191, 82, 87, 5, 78, 13, 171, 41, 174, 61, 64, 142, 48, 225, 56, 166, 6, 102, 251, 81, 234, 55, 128, 94, 60, 172, 115, 100, 96, 178, 104, 0, 1, 1, 40, 33, 3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51, 172, 115, 100, 96, 178, 104, 0, 1, 1, 136, 118, 169, 20, 67, 182, 212, 84, 70, 151, 70, 66, 116, 29, 122, 206, 88, 56, 34, 169, 134, 98, 247, 48, 135, 99, 172, 103, 33, 3, 110, 98, 2, 88, 78, 3, 255, 115, 189, 44, 36, 143, 64, 21, 45, 66, 246, 173, 45, 150, 249, 111, 81, 255, 121, 102, 56, 78, 79, 212, 10, 147, 124, 130, 1, 32, 135, 100, 117, 82, 124, 33, 3, 223, 237, 238, 69, 124, 72, 155, 149, 113, 198, 187, 131, 3, 173, 140, 67, 45, 34, 35, 215, 147, 149, 70, 153, 151, 109, 120, 243, 244, 203, 143, 175, 82, 174, 103, 169, 20, 156, 35, 37, 120, 226, 246, 29, 219, 64, 89, 140, 101, 25, 10, 82, 54, 177, 67, 22, 164, 136, 172, 104, 81, 178, 117, 104, 0, 1, 1, 75, 99, 33, 3, 123, 39, 182, 167, 251, 66, 134, 233, 119, 245, 27, 176, 199, 140, 124, 178, 13, 94, 170, 242, 85, 171, 208, 109, 11, 254, 93, 26, 138, 24, 116, 85, 103, 86, 178, 117, 33, 2, 88, 57, 236, 81, 234, 107, 178, 56, 43, 32, 65, 198, 65, 208, 113, 249, 255, 131, 220, 243, 92, 79, 56, 169, 123, 51, 82, 100, 192, 140, 183, 94, 104, 172, 0]), remote_funding_key: [3, 14, 253, 118, 154, 250, 84, 239, 104, 161, 145, 14, 179, 223, 21, 12, 251, 78, 99, 100, 182, 211, 19, 7, 153, 194, 128, 9, 3, 10, 98, 15, 51], remote_per_commitment_point: [3, 207, 22, 121, 105, 31, 141, 181, 243, 179, 187, 27, 192, 217, 184, 68, 145, 156, 222, 149, 103, 132, 92, 2, 97, 253, 49, 47, 60, 49, 59, 21, 155], option_static_remotekey: true, commitment_number: 1, htlcs: [Htlc { side: 1, amount: 5000000, payment_hash: Sha256([35, 55, 153, 144, 66, 137, 113, 61, 12, 248, 131, 22, 119, 201, 203, 224, 22, 252, 76, 98, 114, 83, 254, 43, 176, 150, 124, 112, 113, 220, 34, 215]), ctlv_expiry: 314 }], feerate: 253 })
I (189876) sphinx_key_signer: VLS msg: SignRemoteHtlcTx(SignRemoteHtlcTx { tx: LargeBytes([2, 0, 0, 0, 1, 196, 10, 133, 210, 153, 144, 217, 255, 228, 99, 175, 167, 132, 20, 222, 0, 40, 105, 6, 188, 15, 82, 70, 164, 219, 96, 110, 176, 181, 95, 240, 214, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 224, 18, 0, 0, 0, 0, 0, 0, 34, 0, 32, 93, 57, 236, 43, 108, 204, 34, 137, 39, 212, 178, 13, 239, 233, 64, 244, 189, 115, 141, 147, 84, 167, 216, 211, 1, 120, 70, 41, 131, 64, 113, 94, 58, 1, 0, 0]), psbt: LargeBytes([112, 115, 98, 116, 255, 1, 0, 94, 2, 0, 0, 0, 1, 196, 10, 133, 210, 153, 144, 217, 255, 228, 99, 175, 167, 132, 20, 222, 0, 40, 105, 6, 188, 15, 82, 70, 164, 219, 96, 110, 176, 181, 95, 240, 214, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 224, 18, 0, 0, 0, 0, 0, 0, 34, 0, 32, 93, 57, 236, 43, 108, 204, 34, 137, 39, 212, 178, 13, 239, 233, 64, 244, 189, 115, 141, 147, 84, 167, 216, 211, 1, 120, 70, 41, 131, 64, 113, 94, 58, 1, 0, 0, 0, 1, 1, 43, 136, 19, 0, 0, 0, 0, 0, 0, 34, 0, 32, 207, 200, 155, 181, 6, 60, 141, 197, 217, 89, 111, 138, 87, 162, 148, 95, 242, 6, 7, 234, 96, 147, 242, 165, 214, 66, 164, 126, 209, 69, 116, 176, 1, 5, 136, 118, 169, 20, 67, 182, 212, 84, 70, 151, 70, 66, 116, 29, 122, 206, 88, 56, 34, 169, 134, 98, 247, 48, 135, 99, 172, 103, 33, 3, 110, 98, 2, 88, 78, 3, 255, 115, 189, 44, 36, 143, 64, 21, 45, 66, 246, 173, 45, 150, 249, 111, 81, 255, 121, 102, 56, 78, 79, 212, 10, 147, 124, 130, 1, 32, 135, 100, 117, 82, 124, 33, 3, 223, 237, 238, 69, 124, 72, 155, 149, 113, 198, 187, 131, 3, 173, 140, 67, 45, 34, 35, 215, 147, 149, 70, 153, 151, 109, 120, 243, 244, 203, 143, 175, 82, 174, 103, 169, 20, 156, 35, 37, 120, 226, 246, 29, 219, 64, 89, 140, 101, 25, 10, 82, 54, 177, 67, 22, 164, 136, 172, 104, 81, 178, 117, 104, 0, 1, 1, 75, 99, 33, 3, 123, 39, 182, 167, 251, 66, 134, 233, 119, 245, 27, 176, 199, 140, 124, 178, 13, 94, 170, 242, 85, 171, 208, 109, 11, 254, 93, 26, 138, 24, 116, 85, 103, 86, 178, 117, 33, 2, 88, 57, 236, 81, 234, 107, 178, 56, 43, 32, 65, 198, 65, 208, 113, 249, 255, 131, 220, 243, 92, 79, 56, 169, 123, 51, 82, 100, 192, 140, 183, 94, 104, 172, 0]), wscript: [118, 169, 20, 67, 182, 212, 84, 70, 151, 70, 66, 116, 29, 122, 206, 88, 56, 34, 169, 134, 98, 247, 48, 135, 99, 172, 103, 33, 3, 110, 98, 2, 88, 78, 3, 255, 115, 189, 44, 36, 143, 64, 21, 45, 66, 246, 173, 45, 150, 249, 111, 81, 255, 121, 102, 56, 78, 79, 212, 10, 147, 124, 130, 1, 32, 135, 100, 117, 82, 124, 33, 3, 223, 237, 238, 69, 124, 72, 155, 149, 113, 198, 187, 131, 3, 173, 140, 67, 45, 34, 35, 215, 147, 149, 70, 153, 151, 109, 120, 243, 244, 203, 143, 175, 82, 174, 103, 169, 20, 156, 35, 37, 120, 226, 246, 29, 219, 64, 89, 140, 101, 25, 10, 82, 54, 177, 67, 22, 164, 136, 172, 104, 81, 178, 117, 104], remote_per_commitment_point: [3, 207, 22, 121, 105, 31, 141, 181, 243, 179, 187, 27, 192, 217, 184, 68, 145, 156, 222, 149, 103, 132, 92, 2, 97, 253, 49, 47, 60, 49, 59, 21, 155], option_anchor_outputs: true })
E (190226) lightning_signer::util::status: FAILED PRECONDITION: policy failure: validate_htlc_tx: feerate_per_kw of 253 is smaller than the minimum of 500
Guru Meditation Error: Core  0 panic'ed (Illegal instruction). Exception was unhandled.
Core  0 register dump:
MEPC    : 0x4200c6d0  RA      : 0x4200c5e4  SP      : 0x3fc9fcc0  GP      : 0x3fc8f400  
TP      : 0x3fc54300  T0      : 0x00000006  T1      : 0x4038d94c  T2      : 0xfefefeff  
S0/FP   : 0x00000001  S1      : 0x00000001  A0      : 0x00000001  A1      : 0x3c1a3d50  
A2      : 0x01000085  A3      : 0x00000008  A4      : 0x3fc96396  A5      : 0x600c2000  
A6      : 0x3fcb5f3c  A7      : 0x0000000a  S2      : 0x00000004  S3      : 0x3fc9ffb0  
S4      : 0x3fca0030  S5      : 0x3fc9ffc0  S6      : 0x00000000  S7      : 0x3c1a06c0  
S8      : 0x3c1a068c  S9      : 0x3fca0130  S10     : 0x3c1a066c  S11     : 0x00000001  
T3      : 0x00000000  T4      : 0x3a3a6c69  T5      : 0x00000000  T6      : 0x6c6c616d  
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
MHARTID : 0x00000000  
Stack memory:
3fc9fcc0: 0x00000038 0x3fc9fd9c 0x00000001 0x00000000 0x00000000 0x00000000 0x068c6c37 0x3fcb8cf8
3fc9fce0: 0x00000080 0x0000005e 0x3fcb86e4 0x00000200 0x00000170 0x3fcb88e8 0x00000100 0x00000088
3fc9fd00: 0x7916cf03 0xb58d1f69 0x1bbbb3f3 0x44b8d9c0 0x95de9c91 0x025c8467 0x2f31fd61 0x153b313c
3fc9fd20: 0x3fc9019b 0x60ea0706 0xd6a5f293 0xd17ea442 0x01b07445 0xa9768805 0xd4b64314 0x46974654
3fc9fd40: 0x7a1d7442 0x223858ce 0xf76286a9 0xac638730 0x6e032167 0x4e580262 0xbd73ff03 0x408f242c
3fc9fd60: 0xf6422d15 0xf9962dad 0x79ff516f 0x4f4e3866 0x7c930ad4 0x87200182 0x7c527564 0xeddf0321
3fc9fd80: 0x487c45ee 0xc671959b 0xad0383bb 0x222d438c 0x9593d723 0x6d979946 0xcbf4f378 0xae52af8f
3fc9fda0: 0x9c14a967 0xe2782523 0x40db1df6 0x19658c59 0xb136520a 0x88a41643 0xb25168ac 0x01006875
3fc9fdc0: 0x21634b01 0xb6277b03 0x8642fba7 0x1bf577e9 0x7c8cc7b0 0xaa5e0db2 0xd0ab55f2 0x5dfe0b6d
3fc9fde0: 0x74188a1a 0xb2566755 0x068c6c37 0x3fcb8cf8 0x00000080 0x0000005e 0x3fcb86e4 0x00000200
3fc9fe00: 0x00000170 0x3fcb88e8 0x00000100 0x00000088 0x7916cf03 0xb58d1f69 0x1bbbb3f3 0x44b8d9c0
3fc9fe20: 0x95de9c91 0x025c8467 0x2f31fd61 0x153b313c 0x3fc9019b 0x60ea0706 0xd6a5f293 0xd17ea442
3fc9fe40: 0x01b07445 0xa9768805 0xd4b64314 0x46974654 0x7a1d7442 0x223858ce 0xf76286a9 0xac638730
3fc9fe60: 0x6e032167 0x4e580262 0xbd73ff03 0x408f242c 0xf6422d15 0xf9962dad 0x79ff516f 0x4f4e3866
3fc9fe80: 0x7c930ad4 0x87200182 0x7c527564 0xeddf0321 0x487c45ee 0xc671959b 0xad0383bb 0x222d438c
3fc9fea0: 0x9593d723 0x6d979946 0xcbf4f378 0xae52af8f 0x9c14a967 0xe2782523 0x40db1df6 0x19658c59
3fc9fec0: 0xb136520a 0x88a41643 0xb25168ac 0x01006875 0x21634b01 0xb6277b03 0x8642fba7 0x1bf577e9
3fc9fee0: 0x7c8cc7b0 0xaa5e0db2 0xd0ab55f2 0x5dfe0b6d 0x74188a1a 0xb2566755 0x74188a1a 0xb2566755
3fc9ff00: 0x00000000 0x00000002 0x00000000 0x00000000 0x00000001 0x00000000 0x3fcb6738 0x3fcae5d8
3fc9ff20: 0x00000029 0x00000029 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9ff40: 0x00000000 0x00000000 0x00000200 0x420fd4f8 0x00000001 0x00000001 0x3fcae87c 0x0000005a
3fc9ff60: 0x0000005a 0x00000009 0x00000000 0x3c1a063e 0x3c1a06d0 0x3fca0034 0x3c1a06b8 0x3c1a063e
3fc9ff80: 0x3c1a062c 0x3fc96070 0x00000003 0x42004cb4 0x00000020 0x3fcb5bbc 0x3fc963e0 0x421008ac
3fc9ffa0: 0x3c1a06c8 0x00000001 0x00000001 0x3fcb5c80 0x00000000 0x00000000 0x3fcb6738 0x0000001f
3fc9ffc0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9ffe0: 0x00000000 0x00000020 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca0000: 0x00000000 0x00000000 0x3c1a2800 0x420f0c68 0x00000002 0x3fcb8a60 0x00000294 0x00000294
3fca0020: 0x00000002 0x3fcb8a60 0x00000294 0x00000294 0x00000000 0x3fcb7a4c 0x0000004b 0x0000004b
3fca0040: 0x3fcb86e4 0x00000294 0x00000294 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fca0060: 0x3fcac244 0x00000000 0x00000001 0x3fcad10c 0x00000000 0x00000000 0x3fca0130 0x4200798c
3fca0080: 0x00000000 0x3fc963f4 0x4a084517 0x3fca1a94 0x00000000 0x3fca1a94 0x00000001 0x00000010
3fca00a0: 0x00000010 0x3fca1fbc 0x0000000a 0x0000000a 0x3fca205c 0x0000000a 0x0000000a 0x3fcac244
ELF file SHA256: 0000000000000000
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403805ae
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x172c
load:0x403ce000,len:0x928
load:0x403d0000,len:0x2ce0
entry 0x403ce000
I (35) boot: ESP-IDF v4.4-dev-2825-gb63ec47238 2nd stage bootloader
I (35) boot: compile time 12:10:40
I (35) boot: chip revision: 3
I (38) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (45) boot.esp32c3: SPI Speed      : 80MHz

Guru Meditation Error: Illegal Instruction seems to come from any panic in the rust code. Its too bad the actual panic message is not returned :(

But I wonder if we need to go through and match errors so we can specifically log them before panicing, like here https://github.com/stakwork/sphinx-key/blob/master/signer/src/lib.rs#L74

Discussion on the errors shown above

The second error I raised in this thread is fixed by this MR from Ken: https://gitlab.com/lightning-signer/validating-lightning-signer/-/merge_requests/265

I'm still in touch with Ken about the first error though - it seems to be a disconnect between what the node sets as the dust minimum, and what the signer will accept as the dust minimum.

This is because on my regtest nodes, when I do a listpeers, they both announce the following setting: "dust_limit_satoshis": 546,. On the other hand - as can be seen from the first error in this thread, the signer seems to only be happy with outputs above 2448 satoshis:

W (2771966) lightning_signer::channel: VALIDATION FAILED: Policy("validate_holder_commitment_tx: validate_commitment_tx: received htlc.value_sat 1000 less than dust limit 2448")

I then made the following diff in the vls code, and the 1000 sat payment went through:

######## git diff ecebd76366451a
diff --git a/lightning-signer-core/src/policy/simple_validator.rs b/lightning-signer-core/src/policy/simple_validator.rs
index 8865ce9..ad38be5 100644
--- a/lightning-signer-core/src/policy/simple_validator.rs
+++ b/lightning-signer-core/src/policy/simple_validator.rs
@@ -1406,9 +1406,7 @@ impl SimpleValidator {
 
         let mut htlc_value_sat: u64 = 0;
 
-        let offered_htlc_dust_limit = MIN_DUST_LIMIT_SATOSHIS
-            + (DUST_RELAY_TX_FEE as u64 * htlc_timeout_tx_weight(setup.option_anchor_outputs())
-                / 1000);
+        let offered_htlc_dust_limit = 0;
         for htlc in &info.offered_htlcs {
             // TODO - this check should be converted into two checks, one the first time
             // the HTLC is introduced and the other every time it is encountered.
@@ -1430,9 +1428,7 @@ impl SimpleValidator {
             }
         }
 
-        let received_htlc_dust_limit = MIN_DUST_LIMIT_SATOSHIS
-            + (DUST_RELAY_TX_FEE as u64 * htlc_success_tx_weight(setup.option_anchor_outputs())
-                / 1000);
+        let received_htlc_dust_limit = 0;
         for htlc in &info.received_htlcs {
             // TODO - this check should be converted into two checks, one the first time
             // the HTLC is introduced and the other every time it is encountered.
######## 

Policy error recovery

I asked Ken whether there is currently anything more graceful we can do other than to throw a panic here for example:

https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/vls-signer-stm32/src/demo_signer_main.rs#L103

It doesn't look like VLS provides an easy way to recover from potential failures in the handle call at the moment, it's still a work in progress - so for now, our best route is to avoid triggering these policy failures at all :)

Guru Meditation Error: Illegal Instruction seems to come from any panic in the rust code. Its too bad the actual panic message is not returned :(

But I wonder if we need to go through and match errors so we can specifically log them before panicing, like here https://github.com/stakwork/sphinx-key/blob/master/signer/src/lib.rs#L74

Definitely! Here nonetheless the errors are logged right before the line below so these changes aren't needed immediately:

Guru Meditation Error: Core  0 panic'ed (Illegal instruction). Exception was unhandled.

For now, I have a branch here that silences the two errors mentioned in the above thread:

https://gitlab.com/Evanfeenstra/validating-lightning-signer/-/tree/ken-mr-265

See this branch for this repo to get those changes here:

https://github.com/stakwork/sphinx-key/tree/silence-policy-errors

The two errors above have been resolved by:
https://gitlab.com/lightning-signer/validating-lightning-signer/-/merge_requests/269
and
https://gitlab.com/lightning-signer/validating-lightning-signer/-/merge_requests/271

Aside from there not being a standard way to recover from a policy failure yet, I have also confirmed that we also don't yet have an API to make changes to the policy.

Our own policy struct can be serialize/deserialized and stored on SD, and passed in RootHandler init. Lets figure out how to

  1. pull it from SD
  2. if it doesn't exist, use a default
  3. update the stored policy (that will come from mqtt channel -> mpsc channel)

Control Message types:

Ping -> Pong
QueryPolicy -> ReturnPolicy
UpdatePolicy -> PolicyUpdated

Do we need some kind of "error" persistence in broker, so the hardware can publish errors and policy breaches?

Im thinking for authorizing Control messages, the "signed timestamp" that the tribe server uses is not ideal. Because recent requests must be cached to prevent replays, but that can lead to denial-of-service by flooding (persisting to the SD will slow things down)

Instead I'm thinking a nonce-based approach where each message is appended with a unique nonce (an incrementing u64). Each message must have a higher nonce than the last. The ESP32 will only need to keep track of its current nonce (and the app as well). That way the broker admin cannot DoS the ESP by replaying messages

See here: https://github.com/stakwork/sphinx-rs/blob/master/auther/src/nonce.rs