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

Challenge 2: Ark Protocol - Prevent bunch stuck txs #714

Closed
taitruong opened this issue Mar 23, 2023 · 1 comment
Closed

Challenge 2: Ark Protocol - Prevent bunch stuck txs #714

taitruong opened this issue Mar 23, 2023 · 1 comment
Labels
challenge Claim Challenge Task

Comments

@taitruong
Copy link
Contributor

taitruong commented Mar 23, 2023

The most critical use for stucked txs occurs due to attacks and exploits. Like any malicious cw721 contract could resend on ACK response another transfer on both sides. This is one of other possibilities in forcing to congested channels.

Stuck txs - specifically means sending tons of IBC packets back and forth through a channel. This leads into tons of packets being queued for a channel. Relayers take these packets for a channel in FIFO style and relays them to the other chain back and forth.

So the best way is having packets being governed and controlled. Packets send to a channel is done by an IBC port: in this case it is the NFT module or ICS721 contract. Governance and controlling packets can be done on 2 occassion, both initially triggered by a send packet:

  1. Collection (sender) passing NFT to ICS721 (nft module or wasm contract)
  2. ICS721 sends packet to channel to IBC port on other chain

Governance in this case means whitelisting both cases:

  1. only whitelisted senders (collections) are eligible to call ICS721
  2. only whitelisted channels will be used for transfer

Ark Protocol has contributed 4 contracts, acting as CW721 and ICS721 proxies: https://github.com/arkprotocol/cw721-proxy/tree/sender-whitelist

  1. Governed/Whitelisting Collections by Code Id
  2. Governed/Whitelisting Collections
  3. Governed/Whitelisting Channels
  4. Governed/Whitelisting Collections And Channels

These contracts can be passed as proxies for ICS721 here:

All 4 contracts are using these WL packages:

https://github.com/arkprotocol/cw721-proxy/blob/sender-whitelist/packages/cw721-whitelist/src/lib.rs
https://github.com/arkprotocol/cw721-proxy/blob/sender-whitelist/packages/cw721-whitelist-map/src/lib.rs

These packages allows to be used in contracts for whitelisting and governance of ICS721.

PR for contributing back to @0xekez' implementation as public good ( #712 ) and open source it: 0xekez/cw721-proxy#1

Please also not @0xekez rate limiter proxy: https://github.com/0xekez/cw721-proxy/tree/main/contracts/cw721-rate-limited-proxy

@taitruong taitruong changed the title Challenge 2: Challenge! Prevent bunch stuck txs Challenge 2: Ark Protocol - Prevent bunch stuck txs Mar 23, 2023
@taitruong
Copy link
Contributor Author

taitruong commented Mar 23, 2023

The same WL logic could be ofc also be implemented on other chains using the NFT module. There might be others being interested on doing this :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge Claim Challenge Task
Projects
None yet
Development

No branches or pull requests

2 participants