algorandfoundation / algokit-subscriber-ts

Simple, but flexible / configurable Algorand transaction subscription / indexing mechanism
MIT License
12 stars 6 forks source link

Dynamic filters #28

Open robdmoore opened 6 months ago

robdmoore commented 6 months ago

Support the ability to add filters dynamically based on the information retrieved in blocks (potentially re-running those filters in the block that the new filter was discovered in?).

Need to figure out if indexer catchup mode can be supported by this or not - it would be tricky to do, but may be possible.

Requires #27

We will need to include a filter persistence mechanism similar to watermarking.

Idea: either allow entire filters to be dynamically added, or allow a static set of filters to reference a "dynamic filter value", which resolves to an named array value that can be looked up.

Question: do we re-run the modified filter for the current block or does it take effect from the next block (simpler).

PhearZero commented 1 week ago

Was looking into this today a bit, this would be the main blocker for governance transactions.

I couldn't think of any other way than Follower Mode + Dynamic Filters in order to solve the problem. We can easily orchestrate the state in the node and get the current balances to validate the payment transaction commitment. Not sure about how the filter will react to it

robdmoore commented 1 week ago

I've got it mostly implemented in #45 - just needed final polish, but been distracted since then...