Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Diamond registry #153

Merged
merged 36 commits into from
Jul 26, 2023
Merged

Diamond registry #153

merged 36 commits into from
Jul 26, 2023

Conversation

cryptoAtwill
Copy link
Collaborator

Integrate the diamond pattern into the subnet registry. The overall flow is as follows:

  • SubnetRegistry is deployed with SubnetGetterFacet and SubnetManagerFacet selectors.
  • ipc-agent calls newSubnetActor in SubnetRegistry with the function selectors as parameters.
  • SubnetRegistry deploys the getterFacet and managerFacet and obtains their addresses.
  • SubnetRegistry deploys a new SubnetActorDiamond with the provided constructor params and facet info.

@cryptoAtwill cryptoAtwill changed the base branch from diamond to sa-gateway-diamonds July 24, 2023 07:58
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

A few comments, specially in the deployment scripts.

scripts/deploy-registry.template Outdated Show resolved Hide resolved
scripts/deploy-registry.template Outdated Show resolved Hide resolved
scripts/deploy-registry.template Outdated Show resolved Hide resolved
name: ethers.utils.formatBytes32String('Subnet'),
ipcGatewayAddr: GATEWAY,
consensus: 0,
minActivationCollateral: ethers.utils.parseEther("1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to set this one to 1FIL not one Ether (I don't think the units match).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

they are all 18 decimals right?

src/CloneFactory.sol Outdated Show resolved Hide resolved
scripts/deploy-registry.template Outdated Show resolved Hide resolved
src/SubnetRegistry.sol Outdated Show resolved Hide resolved
src/SubnetRegistry.sol Outdated Show resolved Hide resolved
src/SubnetRegistry.sol Outdated Show resolved Hide resolved
src/SubnetRegistry.sol Outdated Show resolved Hide resolved
scripts/deploy-registry.template Outdated Show resolved Hide resolved
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

LGTM, let's start the integration with the agent if there are no blockers

@cryptoAtwill cryptoAtwill merged commit 1ded739 into sa-gateway-diamonds Jul 26, 2023
@cryptoAtwill cryptoAtwill deleted the diamond_registry branch July 26, 2023 02:28
adlrocha added a commit that referenced this pull request Jul 28, 2023
* Draft facets

* constructor

* update draft

* drafting

* new getter

* draft

* fix bug

* update tests

* update tests

* fix tests

* format

* fix console

* fix console

* fix test

* update github actions

* update pip

* update pip

* fix linting

* refactor info facet

* fix subnet facet

* fix router facet

* fix router facet

* fix lib

* update reentrancy

* format

* init sa diamond

* fix all

* update tests

* make getters

* Refactor src

* add test util

* fix getters

* fix visibility

* update getters

* fix format

* remove console

* update makefile

* add readme

* remove constructors

* deploy diamond

* comment libs

* fix test flow

* build

* build

* build

* update

* resolve conflicts

* format

* fix slither findings

* fix linting

* fix linting

* Fix foundry

* Update src/interfaces/IDiamond.sol

* minor fix

* comment

* uncomment libs

* Fixing addr

* fix readme

* fix depl scripts

* Add louper

* fix linting

* fix testGatewayDiamond_SubmitTopDownCheckpoint_FuzzNumberOfMessages

* fix format

* Update epoch processing (#155)

* Adopt epoch validation

* Fix epoch in ExecutableQueueHelper

* fix linting

* Add tests for libvoring

* add listSubnets

* Fix tests

* Fix misprint in test

* Diamond registry (#153)

* integrate diamond subnet registry

* make selectors storage

* revert openzeppelin changes

* more comments

* update registry template

* fix error

* fix error

* fix error

* fix errors

* fix errors

* fix errors

* fix tests

* fix tests

* update template

* reduce registry size

* remove unused methods

* clean up code

* update registry

* add clone factory

* more logs

* update deployment script

* remove compile

* format

* update template

* remove clone factory

* remove clone factory

* fix test

* revert deleted functions

* update deployment

* remove extra logs

* fix test setup

* fixing unit tests

* fixing unit tests

* fix latest subnet bug

* update nonce when subnet created

* update comment

* Add storage checker (#157)

* Add storage checker

* Run workflows for feature branches

* Diamond patches (#158)

* add nonce to get top down msgs

* add bottomUpCheckPeriod

* Subnet registry fixes (#159)

* Fix bottom up checkpoint period (#160)

fix bottom up checkpoint period

* update contract storage signatures

* Remove old actors

* Update layout

* add list bottom up checkpoint

* fix typo

* Fix list bottom up (#161)

* fix list bottom up

* fix typo

* make multiple of bottom up period

* fix slither

* make pretty

---------

Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com>

* Minor fixes (#163)

* remove deployment script for gateway

---------

Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>
Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com>
Co-authored-by: cryptoAtwill <108330426+cryptoAtwill@users.noreply.github.com>
Co-authored-by: cryptoAtwill <willes.lau@protocol.ai>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants