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

docs: add arc-2 proposal #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

docs: add arc-2 proposal #2

wants to merge 1 commit into from

Conversation

cjcobb23
Copy link

@cjcobb23 cjcobb23 commented Dec 4, 2024

No description provided.

origin_chain: ChainNameRaw,
token_id: TokenId,
decimals: u8,
supply: Option<Uint256>, // None if not tracked for this chain
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
supply: Option<Uint256>, // None if not tracked for this chain
supply: TokenSupply,

perhaps, so usage is clear

Choose a reason for hiding this comment

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

I also prefer a dedicated enum. This is a public interface, so I want to convey clearly the meaning of parameters, and

enum TokenSupply{
   Tracked(uint256),
   Untracked
}

is absolutely straight forward about what it's doing

token_id: TokenId,
decimals: u8,
supply: Option<Uint256>, // None if not tracked for this chain
deployment_type: TokenDeploymentType // Trustless or Custom
Copy link
Member

Choose a reason for hiding this comment

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

this isn't being stored in the state

Choose a reason for hiding this comment

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

Next steps: seems like there is still quite a bit of confusion around deployment types and managers

Comment on lines +50 to +53
deployed_chain: ChainNameRaw,
origin_chain: ChainNameRaw,
token_id: TokenId,
decimals: u8,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
deployed_chain: ChainNameRaw,
origin_chain: ChainNameRaw,
token_id: TokenId,
decimals: u8,
chain: ChainNameRaw,
token_id: TokenId,
decimals: u8,
origin_chain: ChainNameRaw,

maybe chain is sufficient with a different field order

Choose a reason for hiding this comment

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

instance_chain? I'm all for concise naming, but chain might be a bit too confusing

Copy link
Author

Choose a reason for hiding this comment

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

i think chain is too vague when there are two chain fields in this struct. instance_chain is fine, or target_chain

// all of the existing methods remain unchanged

#[permission(Elevated)]
RegisterToken {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
RegisterToken {
RegisterTokenInstance {

avoids confusion with the RegisterToken ITS message type

Copy link

Choose a reason for hiding this comment

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

I feel like the name needs to convey the purpose that link p2p token to the hub. RegisterTokenInstance is still opaque

Choose a reason for hiding this comment

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

This command is very specific for this purpose and will be obsolete once we have migrated all tokens, right? So why not literally go with something like MigrateP2pTokenInstance?

Copy link
Author

Choose a reason for hiding this comment

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

I don't like the Migrate prefix, because the command itself is not actually migrating anything. Would prefer RegisterP2pTokenInstance

Comment on lines +16 to +17
be registered with the hub and to be processed through the hub. At the edge contracts, these tokens will need to be
migrated from p2p mode to hub mode.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
be registered with the hub and to be processed through the hub. At the edge contracts, these tokens will need to be
migrated from p2p mode to hub mode.
be registered with the hub and to be processed through the hub. After the tokens are registered on the ITS hub, the ITS edge contracts can switch their connection from p2p to hub mode.

The ITS tokens themselves don't need any migration on edge contracts, just need to switch connection type

in p2p mode (without the hub). This allows existing ITS tokens that were deployed prior to the ITS hub release to
be registered with the hub and to be processed through the hub. At the edge contracts, these tokens will need to be
migrated from p2p mode to hub mode.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Only the EVM ITS edge contracts using the Axelar consensus protocol are using p2p mode in production.

just to clarify that this doesn't affect Amplifier deployments

// all of the existing methods remain unchanged

#[permission(Elevated)]
RegisterToken {
Copy link
Member

Choose a reason for hiding this comment

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

allow providing a list of token instances so batching doesn't require multiple proposals even if governance is used

Choose a reason for hiding this comment

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

I understand the need for batching, but as an implementation approach, I'd rather we have RegisterToken (or whatever we're going to call it) and then create a command RegisterTokens that takes a vector of RegisterToken messages. I'm fine adding batching to goals though

Comment on lines +62 to +68
Therefore, the command can be executed more than once with the same arguments albeit a different supply, which will
overwrite the existing supply for that chain.

The command will fail if the token instance already exists with a different decimals, origin_chain or
deployment_type (or maybe we shouldn't fail, in case there is a mistake and we need to overwrite?).
The command will fail if the supply is set to None and deployed_chain does not equal origin chain.
The command will fail if either the deployed_chain or origin_chain is not registered with the hub.
Copy link
Member

Choose a reason for hiding this comment

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

hmm. i'm fine with having a separate method to update supply so both implementations are cleaner

overwrite the existing supply for that chain.

The command will fail if the token instance already exists with a different decimals, origin_chain or
deployment_type (or maybe we shouldn't fail, in case there is a mistake and we need to overwrite?).
Copy link
Member

Choose a reason for hiding this comment

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

i think we can validate these values off-chain so we don't need to overwrite. the supply is the trickier one.

Copy link

Choose a reason for hiding this comment

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

override the supply is an interesting idea, we still need a clearer plan about how to set the accurate supply

// all of the existing methods remain unchanged

#[permission(Elevated)]
RegisterToken {
Copy link

Choose a reason for hiding this comment

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

I feel like the name needs to convey the purpose that link p2p token to the hub. RegisterTokenInstance is still opaque

overwrite the existing supply for that chain.

The command will fail if the token instance already exists with a different decimals, origin_chain or
deployment_type (or maybe we shouldn't fail, in case there is a mistake and we need to overwrite?).
Copy link

Choose a reason for hiding this comment

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

override the supply is an interesting idea, we still need a clearer plan about how to set the accurate supply


The command will fail if the token instance already exists with a different decimals, origin_chain or
deployment_type (or maybe we shouldn't fail, in case there is a mistake and we need to overwrite?).
The command will fail if the supply is set to None and deployed_chain does not equal origin chain.
Copy link

Choose a reason for hiding this comment

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

can you explain in doc why the command will fails in these 3 scenarios?

Copy link

@cgorenflo cgorenflo left a comment

Choose a reason for hiding this comment

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

I'd like to iterate over the document some more, but not necessarily in this initial PR. I've marked comments as "next steps" that I want to see marked as open questions in the document, but that can be worked on in the next iteration instead of indefinitely blocking the merge

// all of the existing methods remain unchanged

#[permission(Elevated)]
RegisterToken {

Choose a reason for hiding this comment

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

This command is very specific for this purpose and will be obsolete once we have migrated all tokens, right? So why not literally go with something like MigrateP2pTokenInstance?

// all of the existing methods remain unchanged

#[permission(Elevated)]
RegisterToken {

Choose a reason for hiding this comment

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

I understand the need for batching, but as an implementation approach, I'd rather we have RegisterToken (or whatever we're going to call it) and then create a command RegisterTokens that takes a vector of RegisterToken messages. I'm fine adding batching to goals though

Comment on lines +50 to +53
deployed_chain: ChainNameRaw,
origin_chain: ChainNameRaw,
token_id: TokenId,
decimals: u8,

Choose a reason for hiding this comment

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

instance_chain? I'm all for concise naming, but chain might be a bit too confusing

origin_chain: ChainNameRaw,
token_id: TokenId,
decimals: u8,
supply: Option<Uint256>, // None if not tracked for this chain

Choose a reason for hiding this comment

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

I also prefer a dedicated enum. This is a public interface, so I want to convey clearly the meaning of parameters, and

enum TokenSupply{
   Tracked(uint256),
   Untracked
}

is absolutely straight forward about what it's doing

token_id: TokenId,
decimals: u8,
supply: Option<Uint256>, // None if not tracked for this chain
deployment_type: TokenDeploymentType // Trustless or Custom

Choose a reason for hiding this comment

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

Next steps: seems like there is still quite a bit of confusion around deployment types and managers

Comment on lines +60 to +63
The above command will register the token and store all of the neccessary information. The supply is used to
initialize balance tracking. The supply can be hard to specify with exact correctness, due to inflight transfers.
Therefore, the command can be executed more than once with the same arguments albeit a different supply, which will
overwrite the existing supply for that chain.

Choose a reason for hiding this comment

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

Next steps: This seems like an almost impossible task, especially with governance delay. I think we need to get stakeholder input on what is an acceptable solution

Therefore, the command can be executed more than once with the same arguments albeit a different supply, which will
overwrite the existing supply for that chain.

The command will fail if the token instance already exists with a different decimals, origin_chain or

Choose a reason for hiding this comment

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

Suggested change
The command will fail if the token instance already exists with a different decimals, origin_chain or
The command will fail if the token instance already exists with different decimals, origin_chain or

Comment on lines +65 to +66
The command will fail if the token instance already exists with a different decimals, origin_chain or
deployment_type (or maybe we shouldn't fail, in case there is a mistake and we need to overwrite?).

Choose a reason for hiding this comment

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

I think once we called the migration once, if it went through, any adjustment should be done with a universal admin/governance function that works for all tokens, not just migrated ones. I don't like to treat them separately ones they are known to the hub

Choose a reason for hiding this comment

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

Next steps: describe this rescue functionality and what happens to transactions to tokens with failed migrations (i.e. migrated but wrong data)


The command will fail if the token instance already exists with a different decimals, origin_chain or
deployment_type (or maybe we shouldn't fail, in case there is a mistake and we need to overwrite?).
The command will fail if the supply is set to None and deployed_chain does not equal origin chain.

Choose a reason for hiding this comment

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

is that always true, i.e. are there no deployed p2p tokens that we cannot track (e.g. due to existing minters)?
If it is, can we codify this instead of allowing an input that will always fail?

Copy link
Author

Choose a reason for hiding this comment

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

Actually, I think there must be deployed p2p tokens with custom minters, so we probably should fail this case. @milapsheth

Comment on lines +72 to +73
- For this to work effectively, there is operational overhead of determing every ITS token, and registering each
with the ITS hub correctly. There is a possibility some are missed, or registered incorrectly, and thus need to be adjusted.

Choose a reason for hiding this comment

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

Next steps: Can we mitigate this? Do we have a plan to help with the information gathering?

@cjcobb23 cjcobb23 closed this Jan 13, 2025
@cjcobb23 cjcobb23 reopened this Feb 18, 2025
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.

4 participants