oura icon indicating copy to clipboard operation
oura copied to clipboard

Missing collateral

Open pablosymc opened this issue 1 year ago • 1 comments

Given the following config:

[source]
type = "N2C"
address = ["Unix", "/opt/cardano/cnode/sockets/node0.socket"]
magic = "mainnet"

[source.intersect]
type = "Origin"

[cursor]
type = "File"
path = "./cursor"

[source.mapper]
include_transaction_details = true

[[filters]]
type = "Fingerprint"

[[filters]]
type = "Selection"

[filters.check]
predicate = "variant_in"
argument = ["Block", "Collateral", "RollBack", "Transaction"]

[sink]
type = "Kafka"
brokers = ["localhost:9092"]
topic = "cardano"
paritioning = "ByBlock"

And the following transaction:

{
  "hash": "f9ed2fef27cdcf60c863ba03f27d0e38f39c5047cf73ffdf2428b48edbe83234",
  "fee": 373665,
  "ttl": 49503712,
  "validity_interval_start": null,
  "network_id": null,
  "input_count": 1,
  "collateral_input_count": 0,
  "has_collateral_output": false,
  "output_count": 1,
  "mint_count": 0,
  "total_output": 2726335,
  "metadata": null,
  "inputs": [
    {
      "tx_id": "944cb825a06993865dcf5d8e80354ed5afa1bcfb2f17b179c139a5bae23594cd",
      "index": 1
    }
  ],
  "outputs": [
    {
      "address": "addr1vxk5cxgnfqkgzh25ztf6zj5p3h9pnk2mxp3xwe2pzh72rtg0nf5cs",
      "amount": 2726335,
      "assets": [],
      "datum_hash": null,
      "inline_datum": null
    }
  ],
  "collateral_inputs": null,
  "collateral_output": null,
  "mint": null,
  "vkey_witnesses": [
    {
      "vkey_hex": "92c5efea5bf9a8fa1f1eaf2e97e7cf425122c034f360abaf44ea9fb56622e919",
      "signature_hex": "9f858a30c5a53f2aba8955e6c33126e818f6701cd21137b017f972b4dc31c42e9e229d3e02c4cfad443e3e4f034caf1681f94bc6a2b3cc83c6aa9dc3ef4e6001"
    }
  ],
  "native_witnesses": [],
  "plutus_witnesses": [
    {
      "script_hash": "15b95fdaceeb507073a1bd198803373beeafbd82560fbf8abe9073ff",
      "script_hex": "......" (omitted)
    }
  ],
  "plutus_redeemers": [
    {
      "purpose": "spend",
      "ex_units_mem": 0,
      "ex_units_steps": 0,
      "input_idx": 0,
      "plutus_data": {
        "constructor": 0,
        "fields": []
      }
    }
  ],
  "plutus_data": [
    {
      "datum_hash": "2c14cb7463238191c1786dfdcc37012c2fa8534f87f22b75d8f5dc3ecf4f4d74",
      "plutus_data": {
        "constructor": 0,
        "fields": [
          {
            "constructor": 0,
            "fields": [
              {
                "bytes": "ad4c1913482c815d5412d3a14a818dca19d95b306267654115fca1ad"
              },
              {
                "bytes": "a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235"
              },
              {
                "bytes": "484f534b59"
              },
              {
                "int": 1000000
              }
            ]
          }
        ]
      }
    }
  ],
  "withdrawals": null,
  "size": 4957
}

Another transaction:

{
  "hash": "08a7e98294857cf2500f421943ec005f0ed4825c96504ab0cefe1fbb60018df8",
  "fee": 450000,
  "ttl": 49580478,
  "validity_interval_start": null,
  "network_id": null,
  "input_count": 1,
  "collateral_input_count": 0,
  "has_collateral_output": false,
  "output_count": 1,
  "mint_count": 0,
  "total_output": 2650000,
  "metadata": null,
  "inputs": [
    {
      "tx_id": "944cb825a06993865dcf5d8e80354ed5afa1bcfb2f17b179c139a5bae23594cd",
      "index": 1
    }
  ],
  "outputs": [
    {
      "address": "addr1vxk5cxgnfqkgzh25ztf6zj5p3h9pnk2mxp3xwe2pzh72rtg0nf5cs",
      "amount": 2650000,
      "assets": [],
      "datum_hash": null,
      "inline_datum": null
    }
  ],
  "collateral_inputs": null,
  "collateral_output": null,
  "mint": null,
  "vkey_witnesses": [
    {
      "vkey_hex": "92c5efea5bf9a8fa1f1eaf2e97e7cf425122c034f360abaf44ea9fb56622e919",
      "signature_hex": "0b4bcf57af84c89a7b5599a78d2644978a1b63e3dcd8d5a73ee785686b102b9e89896adcde393b20064aa57d50542dd443f5b31752d217a1c4cfd2f8b41b2605"
    }
  ],
  "native_witnesses": [],
  "plutus_witnesses": [
    {
      "script_hash": "15b95fdaceeb507073a1bd198803373beeafbd82560fbf8abe9073ff",
     "script_hex": "......" (omitted)
    }
  ],
  "plutus_redeemers": [
    {
      "purpose": "spend",
      "ex_units_mem": 720000,
      "ex_units_steps": 320000000,
      "input_idx": 0,
      "plutus_data": {
        "constructor": 0,
        "fields": []
      }
    }
  ],
  "plutus_data": [
    {
      "datum_hash": "2c14cb7463238191c1786dfdcc37012c2fa8534f87f22b75d8f5dc3ecf4f4d74",
      "plutus_data": {
        "constructor": 0,
        "fields": [
          {
            "constructor": 0,
            "fields": [
              {
                "bytes": "ad4c1913482c815d5412d3a14a818dca19d95b306267654115fca1ad"
              },
              {
                "bytes": "a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235"
              },
              {
                "bytes": "484f534b59"
              },
              {
                "int": 1000000
              }
            ]
          }
        ]
      }
    }
  ],
  "withdrawals": null,
  "size": 4995
}

It look's like both of these transaction's https://cardanoscan.io/transaction/f9ed2fef27cdcf60c863ba03f27d0e38f39c5047cf73ffdf2428b48edbe83234 and https://cardanoscan.io/transaction/08a7e98294857cf2500f421943ec005f0ed4825c96504ab0cefe1fbb60018df8 do indeed have collateral set.

I should note however, it does appear that this transaction failed, https://cardanoscan.io/transaction/f9ed2fef27cdcf60c863ba03f27d0e38f39c5047cf73ffdf2428b48edbe83234 and collateral was taken from the wallet.

Am I doing something wrong with my config, or is there an issue with getting collateral? I'm expecting that the collateral_inputs should not be null for a successful or failed transaction, and collateral_output should be null for a failed transaction. If i'm understanding this correctly.

I would also expect that collateral_input_count and has_collateral_output be correct as well.

Any assistance or feedback would be appreciated!

Note: I'm assuming that collateral_inputs and collateral_outputs would assist me in determining whether a transaction has failed? Please let me know if there is another way to detect a failed transaction.

pablosymc avatar Aug 01 '23 13:08 pablosymc