-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
origin_chain: ChainNameRaw, | ||
token_id: TokenId, | ||
decimals: u8, | ||
supply: Option<Uint256>, // None if not tracked for this chain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supply: Option<Uint256>, // None if not tracked for this chain | |
supply: TokenSupply, |
perhaps, so usage is clear
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
deployed_chain: ChainNameRaw, | ||
origin_chain: ChainNameRaw, | ||
token_id: TokenId, | ||
decimals: u8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RegisterToken { | |
RegisterTokenInstance { |
avoids confusion with the RegisterToken
ITS message type
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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. |
There was a problem hiding this comment.
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?). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
deployed_chain: ChainNameRaw, | ||
origin_chain: ChainNameRaw, | ||
token_id: TokenId, | ||
decimals: u8, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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?). |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
- 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. |
There was a problem hiding this comment.
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?
No description provided.