snapshot-labs / sx-monorepo

Snapshot monorepo
https://snapshot.box
MIT License
14 stars 12 forks source link

feat: add L1 execution tracking #382

Closed Sekhmet closed 3 months ago

Sekhmet commented 4 months ago

Summary

Closes: https://github.com/snapshot-labs/sx-monorepo/issues/169

This PR adds full tracking for L1 execution from Starknet spaces, leveraging latest contracts. L1 execution is tracked by checking status of L2 transaction (if it has status of ACCEPTED_ON_L1) and by using subgraph-api to also track actual execution on L1.

Entire execution is handled by Mana.

How to test

  1. Run VITE_ENABLED_NETWORKS=s,sep,sn-sep yarn dev:full.
  2. Have Safe on Ethereum Sepolia ready.
  3. Deploy new space with your safe added as treasury and EthRelayer strategy (make sure you enter /#/create page with Starknet logged in, otherwise there might be some issues with enabling your space automatically), set it up with shorter voting time.
  4. Write down address of your L1AvatarExecutionStrategy contract on L1 from transaction that was deployed.
  5. Go to Safe app and using Zodiac module enable that contract from step 4 as custom module.
  6. Create new proposal, vote on it, wait (might need extra time to wait as blocks need to be updated on Starknet).
  7. Click Execute transactions.
  8. Refresh, you will see info about that L1 transaction needs to be received, it will take long time (10-12 hours).
  9. Later on, come back, it should see that it was received and give you option to execute queued transactions.
  10. Click that button.
  11. Refresh, it will give you link to L1 transaction where it was executed.
Sekhmet commented 3 months ago

I will deploy all subgraphs before merging this PR so master will work once merged.