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

Multi-chain reputation rebooted #1216

Closed
wants to merge 53 commits into from
Closed

Conversation

area
Copy link
Member

@area area commented Feb 22, 2024

A continuation / adaption of #1132. I didn't want to lose the contents of that branch, so this is a different branch based on it, with the bridging functionality changed and restructured.

Quite a big refactor since the last time someone other than me looked at this, so let's talk about the big change, which is the introduction of the ColonyBridge contract. The intention here is that this contract is the only contract that colonyNetwork interacts with when it comes to bridging, and will do so for all time (a claim that will surely never become wrong) through an IColonyBridge interface. The intention here is to abstract out the specificities of any bridging solution we're using, and putting them all in the ColonyBridge contract.

We had briefly talked about this being subsumed in to a single contract inside ColonyNetwork, but as I continued with implementation I ended up back here because of how we would need external calls anyway from ColonyNetwork to itself, as the bridging requests are spread across multiple files. May as well have the external calls to another contract. I also wasn't keen on polluting the ColonyNetwork contract storage with bridge-specific details. Either way, the upshot is that we no longer have the before/after bytes for each type of bridging transaction, and the behaviour is much easier to understand from reading the contracts (indeed, is actually defined by the contracts).

The ColonyBridge contract gets configured with all known ColonyBridges on other chains and the colonyNetwork on the chain it is deployed to. ColonyNetwork gets configured only with the ColonyBridge contract on its chain. ColonyBridges also get configured with whatever additional details need to be provided for the bridging solution being used. In this case, it's the wormhole address, but obviously could be anything with another implementation.

To change the bridge being used, we would deploy new sets of ColonyBridges to all chains with the new functionality, and then point the colonyNetworks at them - no changes to the ColonyNetwork contract required in that scenario. It would be nice to have a test with the old AMB functionality demonstrating that e.g. using the AMB we could still control a Gnosis Safe. I have confirmed with product that they are not expecting chain<->chain gnosis safe support with the multichain deployment, and so that functionality is going to be lost.

There is an implicit assumption here that colonyNetwork will only ever want to send messages to another colonyNetwork. I think that's fine, but I could see it meriting discussion.

@area area force-pushed the feat/multichain-reputation-rebased branch 3 times, most recently from 10860dc to 1c38029 Compare February 27, 2024 14:49
Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

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

Two high level comments:

  • I would be open to creating ColonyNetworkSkills in a separate PR which does nothing but re-arrange code. It'll make it easier to see what is actually changing behavior-wise in this one.

  • There seems to be a lot of repetitive code in the bridging implementation. Overall I'd be happy seeing some more abstraction and helper functions introduced. Generalizing the low-level calls into some re-usable higher-level functions would help.

contracts/colonyNetwork/ColonyNetworkDeployer.sol Outdated Show resolved Hide resolved
contracts/colonyNetwork/ColonyNetworkDataTypes.sol Outdated Show resolved Hide resolved
contracts/colonyNetwork/ColonyNetworkMining.sol Outdated Show resolved Hide resolved
contracts/colonyNetwork/ColonyNetworkSkills.sol Outdated Show resolved Hide resolved
contracts/colonyNetwork/ColonyNetworkSkills.sol Outdated Show resolved Hide resolved
contracts/bridging/WormholeBridgeForColony.sol Outdated Show resolved Hide resolved
contracts/bridging/WormholeBridgeForColony.sol Outdated Show resolved Hide resolved
contracts/bridging/WormholeBridgeForColony.sol Outdated Show resolved Hide resolved
contracts/bridging/WormholeBridgeForColony.sol Outdated Show resolved Hide resolved
test/contracts-network/colony-network.js Outdated Show resolved Hide resolved
@area area force-pushed the feat/multichain-reputation-rebased branch 3 times, most recently from 09a15be to f7c2511 Compare February 29, 2024 13:04
@area area changed the base branch from develop to maint/introduce-colonyNetworkSkills February 29, 2024 14:31
@area area marked this pull request as draft February 29, 2024 14:31
@area area force-pushed the feat/multichain-reputation-rebased branch 19 times, most recently from ad73979 to 0b4f19b Compare March 4, 2024 11:59
Base automatically changed from maint/introduce-colonyNetworkSkills to develop March 4, 2024 17:02
@area area force-pushed the feat/multichain-reputation-rebased branch from ebcaee3 to 8caed67 Compare April 4, 2024 19:53
@area area force-pushed the feat/multichain-reputation-rebased branch from b449516 to fb0f170 Compare April 4, 2024 20:04
@area
Copy link
Member Author

area commented May 1, 2024

Included with the merge of #1237

@area area closed this May 1, 2024
@area area mentioned this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants