hirosystems / chainhook

Extract transactions from Stacks and Bitcoin and build event driven re-org resistant indexers and databases.
GNU General Public License v3.0
147 stars 59 forks source link

Bitcoin predicate, operation: "stx_locked" scans 25775 blocks only returns 1 data point #386

Open timstackblock opened 1 year ago

timstackblock commented 1 year ago

Bitcoin predicate, scope: "stacks_protocol" operation: "stx_locked" scans 25775 blocks only returns 1 action triggered. The time stamp is Fri Mar 17 2023 23:02:53.

Should this be the only stx_locked event in 25775 blocks?

Is this event an upgrade of POX where all the stacks were locked with POX3 if so that might make sense, please elaborate on this event as i was surprised only 1 data point was returned and as a result wanted to raise a possible bug.

{
  "uuid": "1",
  "name": "Hello Ordinals",
  "chain": "bitcoin",
  "version": 1,
  "networks": {
    "mainnet": {
      "start_block": 777534,
      "end_block": 803308,
      "if_this": {
        "scope": "stacks_protocol",
        "operation": "stx_locked"
      },
      "then_that": {
        "file_append": {
          "path": "automate/tests/bitcoin-predicates/stacks_protocol/stacks-protocol-file_result.json"
        }
      }
    }

  }
}
{"apply":[{"block_identifier":{"hash":"0x000000000000000000039285a530bc53bd54febe45e2c814b17900059642c1be","index":781284},"metadata":{"network":"mainnet"},"parent_block_identifier":{"hash":"0x00000000000000000000701e8f5e1ac355653c91535e393f0895089c44b8cccc","index":781283},"timestamp":1679108573,"transactions":[{"metadata":{"proof":null,"stacks_operations":[{"stx_locked":{"amount":"","duration":1,"sender":""}}]},"operations":[],"transaction_identifier":{"hash":"0x43e5587ebd9ff497639b3c7cbde314191938a4bae9d68645aca2bd83865734bb"}}]}],"chainhook":{"is_streaming_blocks":false,"predicate":{"operation":"stx_locked","scope":"stacks_protocol"},"uuid":"1"},"rollback":[]}
csgui commented 9 months ago

It seems that stx_locked is not fully implemented yet.

https://github.com/hirosystems/chainhook/blob/develop/components/chainhook-sdk/src/indexer/bitcoin/mod.rs#L649-L660