Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ft_event scope missing transfer events #469

Closed
Xarek-Wizard opened this issue Jan 3, 2024 · 2 comments · Fixed by #484
Closed

ft_event scope missing transfer events #469

Xarek-Wizard opened this issue Jan 3, 2024 · 2 comments · Fixed by #484
Assignees
Labels
Milestone

Comments

@Xarek-Wizard
Copy link

Utilising the following predicate:

{
  "chain": "stacks",
  "uuid": "51807662-9ed2-4f39-9ba2-8ad1ed732c95",
  "name": "Leo Transfer",
  "version": 1,
  "networks": {
    "mainnet": {
      "start_block": 133683,
      "end_block": 134292,
      "if_this": {
        "scope": "ft_event",
        "asset_identifier": "SP1AY6K3PQV5MRT6R4S671NWW2FRVPKM0BR162CT6.leo-token::leo",
        "actions": ["mint", "burn", "transfer"]
      },
      "then_that": {
        "file_append": {
          "path": "leo/leo-sip-transfer.txt"
        }
      }
    }
  }
}

The transaction ID 0xa62ad0db39c4dbc9cef589e653e003935dfc1413624c1c7d287cbe0e94d9dc41 does not appear. This transaction contains the following receipt event, which makes me believe it should be present:

{
  "data": {
    "amount": "52105343749",
    "asset_identifier": "SP1AY6K3PQV5MRT6R4S671NWW2FRVPKM0BR162CT6.leo-token::leo",
    "recipient": "SP23Q75G4RSWGWQNEBXHKEZQYG6JYGA5579GN6VZ8",
    "sender": "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.alex-vault-v1-1"
  },
  "type": "FTTransferEvent"
}

Snagging predicate:

{
  "chain": "stacks",
  "uuid": "3a78f219-c223-4b5d-9e0c-f17379646de6",
  "name": "Leo Transfer Snag",
  "version": 1,
  "networks": {
    "mainnet": {
      "start_block": 133683,
      "end_block": 134292,
      "if_this": {
        "scope": "txid",
        "equals": "0xa62ad0db39c4dbc9cef589e653e003935dfc1413624c1c7d287cbe0e94d9dc41"
      },
      "then_that": {
        "file_append": {
          "path": "leo/leo-sip-transfer-snag.txt"
        }
      }
    }
  }
}
@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Jan 3, 2024
@MicaiahReid MicaiahReid self-assigned this Jan 4, 2024
@MicaiahReid
Copy link
Contributor

Hi @Xarek-Wizard thanks for the issue.

I've been able to confirm this behavior. It's interesting, when I use this predicate:

{
  "chain": "stacks",
  "uuid": "3a78f219-c223-4b5d-9e0c-f17379646de6",
  "name": "Leo Transfer Snag",
  "version": 1,
  "networks": {
    "mainnet": {
      "start_block": 133989,
      "end_block": 133990,
      "if_this": {
        "scope": "ft_event",
        "asset_identifier": "SP1AY6K3PQV5MRT6R4S671NWW2FRVPKM0BR162CT6.leo-token::leo",
        "actions": ["mint", "burn", "transfer"]
      },
      "then_that": {
        "file_append": {
          "path": "leo/leo-sip-transfer-snag.txt"
        }
      }
    }
  }
}

so that it's just the block with txid 0xa62ad0db39c4dbc9cef589e653e003935dfc1413624c1c7d287cbe0e94d9dc41 being scanned, I am getting a trigger from chainhook with the block, 133692, but it doesn't include that expected transaction.

I will continue looking into this. @lgalabru I'm curious if you have any hunches

@MicaiahReid MicaiahReid moved this from 🆕 New to 🏗 In Progress in DevTools Jan 16, 2024
@smcclellan smcclellan added this to the Q1-2024 milestone Jan 19, 2024
@MicaiahReid MicaiahReid moved this from 🏗 In Progress to 📋 Backlog in DevTools Jan 29, 2024
@MicaiahReid MicaiahReid moved this from 📋 Backlog to 🏗 In Progress in DevTools Jan 31, 2024
MicaiahReid added a commit that referenced this issue Feb 6, 2024
### Description

When evaluatin a stacks predicate of type `ft_event` or `nft_event`, we
were returning from a loop of all events after the first loop. We should
only return early if there is a match, and should continue searching all
events if there isn't. This PR implements that fix.

Fixes #469

---

### Checklist

- [x] All tests pass
- [x] Tests added in this PR (if applicable)
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in DevTools Feb 6, 2024
MicaiahReid added a commit that referenced this issue Feb 8, 2024
### Description

When evaluatin a stacks predicate of type `ft_event` or `nft_event`, we
were returning from a loop of all events after the first loop. We should
only return early if there is a match, and should continue searching all
events if there isn't. This PR implements that fix.

Fixes #469

---

### Checklist

- [x] All tests pass
- [x] Tests added in this PR (if applicable)
github-actions bot pushed a commit that referenced this issue Feb 8, 2024
## [1.3.0](v1.2.1...v1.3.0) (2024-02-08)

### Features

* optionally serve Prometheus metrics ([#473](#473)) ([67a38ac](67a38ac))

### Bug Fixes

* adjust ordinal_number entry in ts client inscription transfer event, add new reveal data ([#476](#476)) ([28bf5c4](28bf5c4))
* remove early return for event evaluation ([#484](#484)) ([98f9e86](98f9e86)), closes [#469](#469)
* remove unreachable panic; return instead ([#490](#490)) ([abe0fd5](abe0fd5))
* use cli feature for `cargo chainhook-install` ([#486](#486)) ([32f4d4e](32f4d4e))
* validate predicate `start_block` and `end_block` ([#489](#489)) ([e70025b](e70025b)), closes [#477](#477) [#464](#464)
Copy link

github-actions bot commented Feb 8, 2024

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

vabanaerytk added a commit to vabanaerytk/chainhook that referenced this issue Aug 7, 2024
## [1.3.0](hirosystems/chainhook@v1.2.1...v1.3.0) (2024-02-08)

### Features

* optionally serve Prometheus metrics ([#473](hirosystems/chainhook#473)) ([1a3e356](hirosystems/chainhook@1a3e356))

### Bug Fixes

* adjust ordinal_number entry in ts client inscription transfer event, add new reveal data ([#476](hirosystems/chainhook#476)) ([fe7ef78](hirosystems/chainhook@fe7ef78))
* remove early return for event evaluation ([#484](hirosystems/chainhook#484)) ([d0e2f60](hirosystems/chainhook@d0e2f60)), closes [#469](hirosystems/chainhook#469)
* remove unreachable panic; return instead ([#490](hirosystems/chainhook#490)) ([c7894ac](hirosystems/chainhook@c7894ac))
* use cli feature for `cargo chainhook-install` ([#486](hirosystems/chainhook#486)) ([206cb17](hirosystems/chainhook@206cb17))
* validate predicate `start_block` and `end_block` ([#489](hirosystems/chainhook#489)) ([85f3e71](hirosystems/chainhook@85f3e71)), closes [#477](hirosystems/chainhook#477) [#464](hirosystems/chainhook#464)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants