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

[Proxy colonies M1] feat: create proxy colony via voting reputation #4036

Open
wants to merge 1 commit into
base: feat/re-enable-proxy-colony
Choose a base branch
from

Conversation

bassgeta
Copy link
Contributor

@bassgeta bassgeta commented Jan 7, 2025

Description

This PR adds functionality to create a proxy colony via voting reputation.
Additionally it adds tracing between actions which are motion finalization and the motion they have finalized.
So basically

  1. finalizationActionId is a new attribute set on voting reputation and multisig motions, which tells us which txHash finalized this motion.
  2. finalizedActionId is a new field on the action object which tells us which txHash was finalized by this action.

So we have this bound in two ways just in case we want to search it from both ends.

Block ingestor PR

Testing

First of all, start up your dev env, run the create data script and install the voting reputation extension.
Before we try out the proxy colony part lets check out if motions are in fact linked to their finalization actions.

  1. Create a mint tokens motion, fully support it and finalize it
  2. Run the following queries and verify that the motion data now has a pointer to the action that finalized it
getColonyAction(
    id: "MOTION_TX_HASH"
  ) {
    id
    initiatorAddress
    finalizedActionId
    type
    motionData {
      finalizationActionId
      id
      transactionHash
      finalizationActionData {
        id
        type
        isMotionFinalization
      }
    }
  }

image
image
4. Since we see that finalizedActionData is populated and has the isMotionFinalization set to true it means we have succesfully saved this. But let's try doing it the other way around. Run the following query

listColonyActions(
    filter: {colonyId: {eq: "YOUR_COLONY_ID"}, type: {eq: MINT_TOKENS}, isMotionFinalization: {eq: true}}
  ) {
    items {
      type
      finalizedActionId
      id
      finalizedActionData {
        isMotionFinalization
        type
        id
      }
      isMotionFinalization
    }
  }

image

Verify that the action's finalizedActionId equals to the parent motion's txHash and that its flag isMotionFinalization is se to true. Additionally finalizedActionData should be of type MINT_TOKENS_MOTION.

  1. Go to the colony dashboard
  2. Create a new Manage supported chains action and choose Reputation as the decision method
    image
  3. Run the following query to make sure a proxy colony for this chain wasn't deployed
listProxyColonies(
    filter: {colonyAddress: {eq: "<YOUR>COLONY_ADDRESS>"}}
  ) {
    items {
      chainId
      colonyAddress
      id
      isActive
    }
  }

image
7. Run the following query and verify that the motion has the target chain, but no action that finalized it (Note that currently multiChainInfo is used here just to get the chain we are deploying to)

getColonyAction(
    id: "<YOUR_TX_HASH>"
  ) {
    multiChainInfo {
      completed
      targetChainId
    }
    finalizedActionId
    finalizedActionData {
      id
      multiChainInfo {
        completed
        targetChainId
        wormholeInfo {
          emitterChainId
          emitterAddress
          sequence
        }
      }
    }
  }

image
8. Fully support the motion and Finalize it (npm run forward-time 1 or just oppose it and get to the voting step)
image
9. Finalize it and verify that
a) the proxy colony was deployed by running the listProxyColonies query from above
image
b) the motion now has a finalizedActionId and the action multichain info is filled in

You can also check that the chain doesn't appear in the Add supported chain dropdown!

Diffs

New stuff

  • createProxyColonyMotion saga
  • new action type ADD_PROXY_COLONY_MOTION

Changes 🏗

  • The block-ingestor now tries parsing events with the proxy colony ABIs too
  • Added finalizationActionId to both multisig and voting reputation motions (check out the block-ingestor)

Resolves #3450

@mmioana mmioana force-pushed the feat/manage-supported-chains-action branch from 81ae988 to 6295a4f Compare January 7, 2025 13:11
@bassgeta bassgeta force-pushed the feat/3450-add-proxy-colony-motion branch from d8e2b62 to 8c0aa8c Compare January 8, 2025 16:01
@bassgeta bassgeta changed the title feat: create proxy colony motion picked up by block ingestor [Proxy colonies M1] feat: create proxy colony via voting reputation Jan 8, 2025
@bassgeta bassgeta marked this pull request as ready for review January 8, 2025 16:14
@bassgeta bassgeta requested a review from a team as a code owner January 8, 2025 16:14
@mmioana mmioana force-pushed the feat/manage-supported-chains-action branch from 6295a4f to 7e6f635 Compare January 8, 2025 17:19
@bassgeta bassgeta force-pushed the feat/3450-add-proxy-colony-motion branch from 8c0aa8c to 055fdfc Compare January 9, 2025 11:38
@bassgeta bassgeta changed the base branch from feat/manage-supported-chains-action to feat/re-enable-proxy-colony January 9, 2025 11:39
Copy link
Contributor

@davecreaser davecreaser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, good stuff @bassgeta. Obviously I saw most of this done live while on the call, but I went over it again and gave it some testing locally. All working well! Aside from the one comment which you already know about (completed not being set to true in the motion action).

Screenshot 2025-01-09 at 18 09 11 Screenshot 2025-01-09 at 18 12 20 Screenshot 2025-01-09 at 18 15 14 Screenshot 2025-01-09 at 18 15 35

Checking the block ingestor PR now. On this side though all good 🚀

@@ -1,8 +1,7 @@
FROM colony-cdapp-dev-env/base:latest

# @TODO maybe add a PROXY_BLOCK_INGESTOR_HASH and fallback to BLOCK_INGESTOR_HASH
ENV BLOCK_INGESTOR_HASH=3e66c1f5d0245048930f0aeae55fa332de6989f4

ENV BLOCK_INGESTOR_HASH=68a509568e06f233511e468959a0ab8afe87bfc2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to streamline this somehow so we only have to update it in one place. I'm sure you and Ioanna already thought about this though, and it's a super future improvement anyway, just throwing it out there!

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

Successfully merging this pull request may close these issues.

2 participants