Skip to content

Conversation

@aliXsed
Copy link
Collaborator

@aliXsed aliXsed commented Nov 13, 2024

Useful info:

  • clk.eth name info is:
Label hash: 0x3c5cc49c4c05caada7ffe8d159634bd3e1825c59241310705d45e578f33da648
Nodehash: 0x71691213bee783e965b983e04ea3aac38f8277868655e40363711821e5422940
┌───────────────────────┬─────────────────────────────────┬──────────────┬────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────┬─────┬───────────────────────────────────────────────────┬───────────────┐
│       contract        │         state_variable          │ storage_slot │ offset │                                                type                                                 │ idx │                     artifact                      │ numberOfBytes │
├───────────────────────┼─────────────────────────────────┼──────────────┼────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┼─────┼───────────────────────────────────────────────────┼───────────────┤
│   ClickNameService    │              _name              │      0       │   0    │                                          t_string_storage                                           │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │             _symbol             │      1       │   0    │                                          t_string_storage                                           │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │             _owners             │      2       │   0    │                                   t_mapping(t_uint256,t_address)                                    │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │            _balances            │      3       │   0    │                                   t_mapping(t_address,t_uint256)                                    │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │         _tokenApprovals         │      4       │   0    │                                   t_mapping(t_uint256,t_address)                                    │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │       _operatorApprovals        │      5       │   0    │                          t_mapping(t_address,t_mapping(t_address,t_bool))                           │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │             _roles              │      6       │   0    │                         t_mapping(t_bytes32,t_struct(RoleData)302_storage)                          │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │         expiryDuration          │      7       │   0    │                                              t_uint256                                              │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
│   ClickNameService    │             expires             │      8       │   0    │                                   t_mapping(t_uint256,t_uint256)                                    │  0  │ /build-info/2dae3c66f2605f8c8b126e96e1bd78d1.json │      32       │
{
  account(id: "0x2e7f3926ae74fdcdcade2c2ab50990c5dafd42bd") {
    eNsByOwnerId {
      nodes {
        name
      }
    }
  }
}

TODO:

  • Find an instance of (or deploy) the StorageProofVerifier contract on Ethereum L1
  • If StorageProofVerifier needs to be deployed, find the right contract address for IZkSyncDiamond
  • Deploy an instance of ENSRegistery (for the base name of clk or clickapp) on ZkSync, approve our backend as operator for subdomains.
  • Develop ClickResolver based on ClaveResolver and deploy it on L1
  • Set the ClickResolver address for the node of aliXsed.eth on L1 NameWrapper
  • Create the skeleton of a ts project to become the clk-gateway cloud run
  • Add L2 resolve API to clk-gateway
  • Add L2 register API to clk-gateway
  • Load configuration from .env
  • Dockerize and push docker to GC artifact registry
  • Deploy clk-gateway to our gc infra (https://github.com/NodleCode/infra/pull/991)
  • Validate all API inputs
  • Provide registerL1 API only to users with verified email
  • Test the email verification flow for accessing POST /registerL1
  • Add L1 resolve with full proof validation API to clk-gateway
  • Improve error handling to distinguish between gateway unknown error and user input error (predictable errors like name not registered when resolving)
  • Add L1 resolve (no proof validation) API to clk-gateway
  • Fix CI build
  • Consider removing toLower for domain check in ClickResolver or adding it to ClickNameService
  • Allow full CORS
  • Limit /registerL1 to only allow one name per user
  • Restrict names to be at least 5 letter longs
  • Address review comments
  • Add indexer query for reverse lookup an address and find all the names owned by that address
  • Enable batch register to alleviate nonce issue for concurrent POST requests on /registerL2 (Deferred to subsequent PRs)
  • Add paymaster option for registration ((Deferred to subsequent PRs)
  • (Optional) Reserve some names (Deferred to be done as an admin job not in the code)

@aliXsed aliXsed changed the title feat: install zksync-storage-proofs lib plus update/tidy-up all libs feat: add click name service Nov 26, 2024
);
} else if (functionSelector == ADDR_MULTICHAIN_SELECTOR) {
(, uint256 coinType) = abi.decode(_data[4:], (bytes32, uint256));
if (coinType != ZKSYNC_MAINNET_COIN_TYPE) {
Copy link
Member

Choose a reason for hiding this comment

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

(discussed today, adding here for tracking) Shouldn't we have a coin type for testnet too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This ADDR_MULTICHAIN_SELECTOR path is not used for us now. So no need to do anything for testnet at the moment.


import { HardhatUserConfig } from "hardhat/config";

import "hardhat-storage-layout";
Copy link
Member

Choose a reason for hiding this comment

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

What is this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will enable producing the storage layout for our contracts from which I verified the slot 2 is what needs to be checked for ClickNameService for storage proofs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The command it enables is npx hardhat storage-layout

Comment on lines +71 to +73
if (expires[tokenId] <= block.timestamp) {
revert NameExpired(owner, expires[tokenId]);
}
Copy link
Member

Choose a reason for hiding this comment

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

By default, names should be permanent unless we enable expiry via an admin function

Copy link
Collaborator Author

@aliXsed aliXsed Dec 10, 2024

Choose a reason for hiding this comment

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

As discussed we will set a super long default expiry during deployment instead

const sub = data.name.split(".")[0];
const owner = getAddress(data.owner);

const response = await clickNameServiceContract.register(owner, sub);
Copy link
Member

Choose a reason for hiding this comment

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

This is where we might want to do manual nonce management (future ticket?)

Copy link
Collaborator Author

@aliXsed aliXsed Dec 10, 2024

Choose a reason for hiding this comment

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

No manual nonce management just buffering the request and batching them to reduce the likelihood of concurrent registers. I will create a ticket for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aliXsed aliXsed marked this pull request as ready for review December 11, 2024 00:12
@aliXsed aliXsed merged commit a3e656e into main Dec 11, 2024
2 checks passed
@aliXsed aliXsed deleted the aliX/ens-1 branch December 11, 2024 00:31
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.

3 participants