zeta-chain / node

ZetaChain’s blockchain node and an observer validator client
https://zetachain.com
MIT License
167 stars 109 forks source link

Implement `RemoveInboundTracker` #1345

Open lumtis opened 1 year ago

lumtis commented 1 year ago

We currently have the message RemoveFromOutTxTracker that allows to manually remove a out tx tracker by an admin group 1. https://github.com/zeta-chain/node/blob/9028fe3e5ba17d01d7cb58e23594d7e559718278/x/crosschain/keeper/keeper_out_tx_tracker.go#L157

Would it make sense to have a similar mechanism for InTx tracker ?

cc @kingpinXD

kingpinXD commented 1 year ago

It would be good, but I feel it might be lower on our priority list . As opposed to outtxtrackers created for every outbound, the inTx trackers would be created manually or by a separate process that scans external chains looking for missed trackers. something like this : https://github.com/zeta-chain/node/blob/add-xcheck-cmd/cmd/xcheck/main.go

We could add more stringent checks before creating the tracker first. What do you think?

lumtis commented 1 year ago

Ok, thanks for the context, it sounds good to let this issue aside for the time being.

brewmaster012 commented 1 year ago

I was thinking about the other direction; since adding trackers is relatively easy, we can set expiration of the intx tracker (or periodically purge them). This also is needed for better spam (is the checking enough to ward off all spams?) control, via requiring intx tracker submitter to post some ZETA as bond.

kingpinXD commented 4 days ago

Trackers with expiry would mean

  1. We only query non-expired trackers
  2. We still need a mechanism to clean up expired trackers to prevent these trackers from increasing the size of the state . This cleanup can be
    • BeginBlock logic.
    • A trasnaction.

I dont think adding more logic in the begin block is preferable , as it is harder to test and not under active control.

If we decide to go with the tx route I guess , implementing the original msg to delete the tracker is much simpler than having an expiry mechanism and deleting expired tracker