Skip to content

fix: handle possible underflow in smt (#5769) #1175

fix: handle possible underflow in smt (#5769)

fix: handle possible underflow in smt (#5769) #1175

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / JUnit Test Report failed Sep 14, 2023 in 0s

29 tests run, 28 passed, 0 skipped, 1 failed.

Annotations

Check failure on line 1 in feature:92:3

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

feature:92:3.Scenario: Pruned node should prune outputs: tests/features/Propagation.feature:92:3

Step panicked. Captured output: transport error
Raw output
Scenario: Pruned node should prune outputs
     Given I have 1 seed nodes
     When I have a base node SENDER connected to all seed nodes
     When I have a pruned node PNODE1 connected to node SENDER with pruning horizon set to 5
     When I mine a block on SENDER with coinbase CB1
     When I mine 2 blocks on SENDER
     When I create a transaction TX1 spending CB1 to UTX1
     When I submit transaction TX1 to SENDER
     When I mine 1 blocks on SENDER
     Then TX1 is in the MINED of all nodes
      Step failed:
      Defined: tests/features/Propagation.feature:101:5
      Matched: integration_tests/tests/steps/node_steps.rs:338:1
      Step panicked. Captured output: transport error
      Client {
          base_nodes: {},
          blocks: {},
          miners: {},
          ffi_wallets: {},
          wallets: {},
          merge_mining_proxies: {},
          chat_clients: [],
          transactions: {
              "TX1": Transaction {
                  offset: RistrettoSecretKey(***),
                  body: AggregateBody {
                      sorted: true,
                      inputs: [
                          TransactionInput {
                              version: V0,
                              spent_output: OutputData {
                                  version: V0,
                                  features: OutputFeatures {
                                      version: V0,
                                      output_type: Coinbase,
                                      maturity: 3,
                                      coinbase_extra: [],
                                      sidechain_feature: None,
                                      range_proof_type: BulletProofPlus,
                                  },
                                  commitment: HomomorphicCommitment(
                                      8667fec6c323730127d6ea1b2d2e6327a6a7e8b76e402f77f295efc73aa36826,
                                  ),
                                  script: TariScript {
                                      script: [
                                          Nop,
                                      ],
                                  },
                                  sender_offset_public_key: d05c948b50c6f8433539d3549277e302dbaae68d2a1a45dd1fdc3a296d147966,
                                  covenant: Covenant {
                                      tokens: [],
                                  },
                                  encrypted_data: EncryptedData {
                                      data: [
                                          168,
                                          0,
                                          62,
                                          136,
                                          8,
                                          13,
                                          106,
                                          89,
                                          142,
                                          82,
                                          191,
                                          25,
                                          40,
                                          115,
                                          148,
                                          114,
                                          87,
                                          82,
                                          139,
                                          11,
                                          183,
                                          139,
                                          127,
                                          11,
                                          169,
                                          69,
                                          62,
                                          8,
                                          255,
                                          124,
                                          217,
                                          163,
                                          200,
                                          155,
                                          132,
                                          73,
                                          176,
                                          155,
                                          157,
                                          73,
                                          77,
                                          218,
                                          27,
                                          108,
                                          200,
                                          245,
                                          69,
                                          106,
                                          199,
                                          200,
                                          82,
                                          161,
                                          92,
                                          57,
                                          13,
                                          63,
                                          36,
                                          98,
                                          204,
                                          122,
                                          74,
                                          58,
                                          116,
                                          110,
                                          199,
                                          249,
                                          218,
                                          224,
                                          144,
                                          206,
                                          231,
                                          225,
                                          216,
                                          112,
                                          39,
                                          60,
                                          179,
                                          132,
                                          237,
                                          195,
                                      ],
                                  },
                                  metadata_signature: CommitmentAndPublicKeySignature {
                                      ephemeral_commitment: HomomorphicCommitment(
                                          607eeb981be1e4025f046070f628e959c930e5ef2483d206860ab3cac910363e,
                                      ),
                                      ephemeral_pubkey: 40d299209badc92636643ed713ecbd4ff0c28e3c15e97cacbd52703f4df9946b,
                                      u_a: RistrettoSecretKey(***),
                                      u_x: RistrettoSecretKey(***),
                                      u_y: RistrettoSecretKey(***),
                                  },
                                  rangeproof_hash: FixedHash(
                                      [
                                          96,
                                          30,
                                          231,
                                          202,
                                          163,
                                          21,
                                          162,
                                          95,
                                          234,
                                          47,
                                          69,
                                          101,
                                          223,
                                          210,
                                          195,
                                          96,
                                          200,
                                          50,
                                          111,
                                          194,
                                          87,
                                          196,
                                          1,
                                          49,
                                          142,
                                          226,
                                          75,
                                          80,
                                          255,
                                          7,
                                          251,
                                          71,
                                      ],
                                  ),
                                  minimum_value_promise: MicroMinotari(
                                      0,
                                  ),
                              },
                              input_data: ExecutionStack {
                                  items: [
                                      PublicKey(
                                          cc93be7d990e6c0838240f1f610f09eb622c20b84b3103d64a527ade46bc3f7c,
                                      ),
                                  ],
                              },
                              script_signature: CommitmentAndPublicKeySignature {
                                  ephemeral_commitment: HomomorphicCommitment(
                                      0c1a4dd0cfeb6d88c16b00102b4b8d84ef4c2bfeec86284aa6b7e5b53273c80d,
                                  ),
                                  ephemeral_pubkey: 76a535bece5350b8af5ed84331a0d67f9b673437f8e91f09614940e45dedca5a,
                                  u_a: RistrettoSecretKey(***),
                                  u_x: RistrettoSecretKey(***),
                                  u_y: RistrettoSecretKey(***),
                              },
                          },
                      ],
                      outputs: [
                          TransactionOutput {
                              version: V0,
                              features: OutputFeatures {
                                  version: V0,
                                  output_type: Standard,
                                  maturity: 0,
                                  coinbase_extra: [],
                                  sidechain_feature: None,
                                  range_proof_type: BulletProofPlus,
                              },
                              commitment: HomomorphicCommitment(
                                  80fc80676e8742576f57bc18e503803507711086fb82c59827f3bf7d72c35877,
                              ),
                              proof: Some(
                                  BulletRangeProof(
                                      [
                                          1,
                                          170,
                                          199,
                                          24,
                                          78,
                                          239,
                                          81,
                                          13,
                                          245,
                                          18,
                                          181,
                                          155,
                                          39,
                                          92,
                                          205,
                                          204,
                                          18,
                                          50,
                                          2,
                                          173,
                                          212,
                                          0,
                                          215,
                                          4,
                                          140,
                                          15,
                                          142,
                                          171,
                                          148,
                                          9,
                                          147,
                                          66,
                                          36,
                                          204,
                                          85,
                                          143,
                                          50,
                                          127,
                                          90,
                                          83,
                                          2,
                                          49,
                                          240,
                                          5,
                                          129,
                                          252,
                                          195,
                                          236,
                                          21,
                                          59,
                                          253,
                                          129,
                                          236,
                                          44,
                                          97,
                                          210,
                                          161,
                                          222,
                                          217,
                                          130,
                                          16,
                                          177,
                                          127,
                                          254,
                                          14,
                                          136,
                                          41,
                                          58,
                                          94,
                                          90,
                                          118,
                                          189,
                                          44,
                                          60,
                                          118,
                                          118,
                                          136,
                                          6,
                                          25,
                                          182,
                                          72,
                                          236,
                                          171,
                                          123,
                                          222,
                                          67,
                                          29,
                                          205,
                                          9,
                                          79,
                                          9,
                                          51,
                                          49,
                                          47,
                                          82,
                                          191,
                                          118,
                                          56,
                                          249,
                                          18,
                                          239,
                                          19,
                                          68,
                                          224,
                                          139,
                                          97,
                                          43,
                                          132,
                                          236,
                                          13,
                                          15,
                                          92,
                                          148,
                                          165,
                                          180,
                                          55,
                                          133,
                                          150,
                                          146,
                                          140,
                                          153,
                                          187,
                                          177,
                                          1,
                                          195,
                                          130,
                                          24,
                                          148,
                                          65,
                                          68,
                                          235,
                                          127,
                                          47,
                                          193,
                                          129,
                                          0,
                                          180,
                                          72,
                                          76,
                                          73,
                                          254,
                                          190,
                                          91,
                                          122,
                                          125,
                                          202,
                                          126,
                                          122,
                                          143,
                                          235,
                                          41,
                                          194,
                                          111,
                                          179,
                                          78,
                                          191,
                                          196,
                                          102,
                                          9,
                                          12,
                                          45,
                                          254,
                                          174,
                                          111,
                                          91,
                                          32,
                                          118,
                                          9,
                                          207,
                                          113,
                                          206,
                                          31,
                                          92,
                                          198,
                                          163,
                                          146,
                                          161,
                                          38,
                                          11,
                                          79,
                                          124,
                                          189,
                                          114,
                                          166,
                                          38,
                                          158,
                                          223,
                                          80,
                                          7,
                                          70,
                                          87,
                                          205,
                                          49,
                                          152,
                                          122,
                                          148,
                                          88,
                                          83,
                                          32,
                                          148,
                                          246,
                                          148,
                                          50,
                                          71,
                                          148,
                                          36,
                                          68,
                                          187,
                                          110,
                                          49,
                                          178,
                                          62,
                                          158,
                                          200,
                                          27,
                                          37,
                                          38,
                                          153,
                                          72,
                                          183,
                                          231,
                                          201,
                                          31,
                                          180,
                                          124,
                                          252,
                                          168,
                                          84,
                                          91,
                                          77,
                                          67,
                                          158,
                                          203,
                                          148,
                                          101,
                                          190,
                                          109,
                                          207,
                                          238,
                                          128,
                                          144,
                                          243,
                                          224,
                                          71,
                                          145,
                                          207,
                                          182,
                                          9,
                                          244,
                                          153,
                                          147,
                                          135,
                                          17,
                                          84,
                                          44,
                                          201,
                                          76,
                                          184,
                                          219,
                                          3,
                                          255,
                                          221,
                                          28,
                                          9,
                                          213,
                                          238,
                                          142,
                                          21,
                                          154,
                                          63,
                                          97,
                                          118,
                                          101,
                                          127,
                                          174,
                                          176,
                                          193,
                                          95,
                                          124,
                                          103,
                                          144,
                                          108,
                                          49,
                                          31,
                                          36,
                                          218,
                                          24,
                                          36,
                                          32,
                                          222,
                                          237,
                                          38,
                                          168,
                                          198,
                                          0,
                                          38,
                                          150,
                                          76,
                                          62,
                                          148,
                                          159,
                                          88,
                                          84,
                                          181,
                                          137,
                                          223,
                                          240,
                                          60,
                                          217,
                                          176,
                                          43,
                                          248,
                                          221,
                                          190,
                                          2,
                                          234,
                                          63,
                                          196,
                                          204,
                                          122,
                                          65,
                                          78,
                                          225,
                                          53,
                                          201,
                                          187,
                                          91,
                                          103,
                                          216,
                                          70,
                                          182,
                                          242,
                                          51,
                                          197,
                                          42,
                                          100,
                                          80,
                                          133,
                                          12,
                                          155,
                                          10,
                                          95,
                                          201,
                                          162,
                                          112,
                                          136,
                                          3,
                                          31,
                                          25,
                                          214,
                                          240,
                                          188,
                                          88,
                                          146,
                                          182,
                                          158,
                                          27,
                                          69,
                                          23,
                                          52,
                                          203,
                                          100,
                                          207,
                                          115,
                                          143,
                                          149,
                                          52,
                                          105,
                                          195,
                                          219,
                                          164,
                                          62,
                                          34,
                                          95,
                                          82,
                                          18,
                                          28,
                                          2,
                                          77,
                                          117,
                                          28,
                                          244,
                                          237,
                                          67,
                                          45,
                                          70,
                                          173,
                                          172,
                                          229,
                                          51,
                                          94,
                                          76,
                                          94,
                                          115,
                                          21,
                                          111,
                                          102,
                                          27,
                                          108,
                                          185,
                                          8,
                                          36,
                                          142,
                                          150,
                                          135,
                                          127,
                                          54,
                                          204,
                                          227,
                                          226,
                                          21,
                                          128,
                                          99,
                                          212,
                                          111,
                                          193,
                                          114,
                                          226,
                                          7,
                                          53,
                                          178,
                                          255,
                                          128,
                                          72,
                                          118,
                                          238,
                                          49,
                                          229,
                                          1,
                                          50,
                                          170,
                                          174,
                                          36,
                                          68,
                                          113,
                                          233,
                                          51,
                                          84,
                                          139,
                                          230,
                                          238,
                                          23,
                                          133,
                                          202,
                                          138,
                                          96,
                                          29,
                                          210,
                                          3,
                                          114,
                                          139,
                                          119,
                                          240,
                                          141,
                                          100,
                                          187,
                                          9,
                                          26,
                                          195,
                                          155,
                                          119,
                                          64,
                                          95,
                                          230,
                                          147,
                                          241,
                                          37,
                                          247,
                                          6,
                                          176,
                                          114,
                                          10,
                                          52,
                                          196,
                                          68,
                                          58,
                                          115,
                                          45,
                                          163,
                                          225,
                                          11,
                                          235,
                                          2,
                                          100,
                                          119,
                                          205,
                                          100,
                                          72,
                                          132,
                                          140,
                                          195,
                                          192,
                                          169,
                                          100,
                                          110,
                                          147,
                                          111,
                                          74,
                                          69,
                                          255,
                                          114,
                                          6,
                                          44,
                                          136,
                                          77,
                                          226,
                                          67,
                                          126,
                                          99,
                                          255,
                                          83,
                                          220,
                                          9,
                                          188,
                                          218,
                                          111,
                                          0,
                                          164,
                                          167,
                                          78,
                                          63,
                                          96,
                                          58,
                                          177,
                                          131,
                                          128,
                                          224,
                                          119,
                                          52,
                                          168,
                                          36,
                                          217,
                                          93,
                                          124,
                                          108,
                                          96,
                                          112,
                                          169,
                                          249,
                                          162,
                                          52,
                                          123,
                                          18,
                                          191,
                                          3,
                                          143,
                                          19,
                                          66,
                                          56,
                                          226,
                                          25,
                                          171,
                                          102,
                                          58,
                                          146,
                                          137,
                                          167,
                                          176,
                                          18,
                                          100,
                                          85,
                                          246,
                                          201,
                                          224,
                                          102,
                                          90,
                                          70,
                                          157,
                                          42,
                                          210,
                                          178,
                                          82,
                                          201,
                                          155,
                                          117,
                                          174,
                                          11,
                                      ],
                                  ),
                              ),
                              script: TariScript {
                                  script: [
                                      Nop,
                                  ],
                              },
                              sender_offset_public_key: 92dfe2ec611ff6c0ff3afde17a6f68eaafcc65df799ce157e55b8484fca77758,
                              metadata_signature: CommitmentAndPublicKeySignature {
                                  ephemeral_commitment: HomomorphicCommitment(
                                      a0668e2df7bb88d06759bdd017b06446ec661f32aa4fc86912b94538dad5e74f,
                                  ),
                                  ephemeral_pubkey: 408bbf71a3a899b5f17354a46485d0baf624f0e73a8125a51c1cc12700311236,
                                  u_a: RistrettoSecretKey(***),
                                  u_x: RistrettoSecretKey(***),
                                  u_y: RistrettoSecretKey(***),
                              },
                              covenant: Covenant {
                                  tokens: [],
                              },
                              encrypted_data: EncryptedData {
                                  data: [
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                      0,
                                  ],
                              },
                              minimum_value_promise: MicroMinotari(
                                  0,
                              ),
                          },
                      ],
                      kernels: [
                          TransactionKernel {
                              version: V0,
                              features: (empty),
                              fee: MicroMinotari(
                                  125,
                              ),
                              lock_height: 0,
                              excess: HomomorphicCommitment(
                                  04e6e555e8789845111ba21eb43efc9bda0abcfec0fdceb5685a4a57b1b45400,
                              ),
                              excess_sig: SchnorrSignature {
                                  public_nonce: 46398658bfd90393e497fbb011f8f9e76c99cbb37ae079694e0111e194a4ee18,
                                  signature: RistrettoSecretKey(***),
                                  _phantom: PhantomData<tari_crypto::signatures::schnorr::SchnorrSigChallenge>,
                              },
                              burn_commitment: None,
                          },
                      ],
                  },
                  script_offset: RistrettoSecretKey(***),
              },
          },
          wallet_addresses: {},
          utxos: {
              "CB1": KeyManagerOutput {
                  version: V0,
                  value: MicroMinotari(
                      18462816327,
                  ),
                  spending_key_id: Managed {
                      branch: "commitment mask",
                      index: 1,
                  },
                  features: OutputFeatures {
                      version: V0,
                      output_type: Coinbase,
                      maturity: 3,
                      coinbase_extra: [],
                      sidechain_feature: None,
                      range_proof_type: BulletProofPlus,
                  },
                  script: TariScript {
                      script: [
                          Nop,
                      ],
                  },
                  covenant: Covenant {
                      tokens: [],
                  },
                  input_data: ExecutionStack {
                      items: [
                          PublicKey(
                              cc93be7d990e6c0838240f1f610f09eb622c20b84b3103d64a527ade46bc3f7c,
                          ),
                      ],
                  },
                  script_private_key_id: Managed {
                      branch: "script key",
                      index: 1,
                  },
                  sender_offset_public_key: d05c948b50c6f8433539d3549277e302dbaae68d2a1a45dd1fdc3a296d147966,
                  metadata_signature: CommitmentAndPublicKeySignature {
                      ephemeral_commitment: HomomorphicCommitment(
                          607eeb981be1e4025f046070f628e959c930e5ef2483d206860ab3cac910363e,
                      ),
                      ephemeral_pubkey: 40d299209badc92636643ed713ecbd4ff0c28e3c15e97cacbd52703f4df9946b,
                      u_a: RistrettoSecretKey(***),
                      u_x: RistrettoSecretKey(***),
                      u_y: RistrettoSecretKey(***),
                  },
                  script_lock_height: 0,
                  encrypted_data: EncryptedData {
                      data: [
                          168,
                          0,
                          62,
                          136,
                          8,
                          13,
                          106,
                          89,
                          142,
                          82,
                          191,
                          25,
                          40,
                          115,
                          148,
                          114,
                          87,
                          82,
                          139,
                          11,
                          183,
                          139,
                          127,
                          11,
                          169,
                          69,
                          62,
                          8,
                          255,
                          124,
                          217,
                          163,
                          200,
                          155,
                          132,
                          73,
                          176,
                          155,
                          157,
                          73,
                          77,
                          218,
                          27,
                          108,
                          200,
                          245,
                          69,
                          106,
                          199,
                          200,
                          82,
                          161,
                          92,
                          57,
                          13,
                          63,
                          36,
                          98,
                          204,
                          122,
                          74,
                          58,
                          116,
                          110,
                          199,
                          249,
                          218,
                          224,
                          144,
                          206,
                          231,
                          225,
                          216,
                          112,
                          39,
                          60,
                          179,
                          132,
                          237,
                          195,
                      ],
                  },
                  minimum_value_promise: MicroMinotari(
                      0,
                  ),
              },
              "UTX1": KeyManagerOutput {
                  version: V0,
                  value: MicroMinotari(
                      18462816202,
                  ),
                  spending_key_id: Managed {
                      branch: "commitment mask",
                      index: 4,
                  },
                  features: OutputFeatures {
                      version: V0,
                      output_type: Standard,
                      maturity: 0,
                      coinbase_extra: [],
                      sidechain_feature: None,
                      range_proof_type: BulletProofPlus,
                  },
                  script: TariScript {
                      script: [
                          Nop,
                      ],
                  },
                  covenant: Covenant {
                      tokens: [],
                  },
                  input_data: ExecutionStack {
                      items: [
                          PublicKey(
                              ce00df013933b9b1101b4115589bb7fde38fda7ee64e7c53658df34fbd2cc16b,
                          ),
                      ],
                  },
                  script_private_key_id: Managed {
                      branch: "script key",
                      index: 4,
                  },
                  sender_offset_public_key: 92dfe2ec611ff6c0ff3afde17a6f68eaafcc65df799ce157e55b8484fca77758,
                  metadata_signature: CommitmentAndPublicKeySignature {
                      ephemeral_commitment: HomomorphicCommitment(
                          a0668e2df7bb88d06759bdd017b06446ec661f32aa4fc86912b94538dad5e74f,
                      ),
                      ephemeral_pubkey: 408bbf71a3a899b5f17354a46485d0baf624f0e73a8125a51c1cc12700311236,
                      u_a: RistrettoSecretKey(***),
                      u_x: RistrettoSecretKey(***),
                      u_y: RistrettoSecretKey(***),
                  },
                  script_lock_height: 0,
                  encrypted_data: EncryptedData {
                      data: [
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                          0,
                      ],
                  },
                  minimum_value_promise: MicroMinotari(
                      0,
                  ),
              },
          },
          output_hash: None,
          pre_image: None,
          wallet_connected_to_base_node: {},
          seed_nodes: [
              "seed_node_0",
          ],
          wallet_tx_ids: {},
          errors: [],
          last_imported_tx_ids: [],
          last_merge_miner_response: Null,
      }