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

chore: chain account kit cleanup #9818

Merged
merged 6 commits into from
Jul 31, 2024
Merged

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Jul 31, 2024

refs: #9064

Description

  • remove getBalance, getBalances, getPurse from IcaAccountKit
  • cleanup TODO surrounding UNPARSABLE_CHAIN_ADDRESS
  • rename ChainAccountKit -> IcaAccountKit
  • findAddressField should treat an empty string as an UNPARSABLE_ADDRESS
  • improve testing coverage for IcaAccount.getPort()
  • docs: update exo classDiagram

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

n/a

Testing Considerations

n/a

Upgrade Considerations

n/a

Copy link

cloudflare-workers-and-pages bot commented Jul 31, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 58bdd14
Status: ✅  Deploy successful!
Preview URL: https://0a50a7b4.agoric-sdk.pages.dev
Branch Preview URL: https://pc-chain-account-kit-cleanup.agoric-sdk.pages.dev

View logs

@0xpatrickdev 0xpatrickdev force-pushed the pc/chain-account-kit-cleanup branch 2 times, most recently from 87b6cc6 to 88e497d Compare July 31, 2024 20:01
@0xpatrickdev 0xpatrickdev requested review from turadg and dckc July 31, 2024 20:03
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

ok presuming 🚨 -> ⚠️

@@ -100,16 +97,6 @@ export const prepareChainAccountKit = (zone, { watch, asVow }) =>
'ICA channel creation acknowledgement not yet received.',
);
},
getBalance(_denom) {
// TODO https://github.com/Agoric/agoric-sdk/issues/9610
Copy link
Member

Choose a reason for hiding this comment

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

re

no plans to implement them on IcaAccount|ChainAccount

#9610 seems like a plan to implement them. but yes, I suppose it's postponed.

Copy link
Member Author

@0xpatrickdev 0xpatrickdev Jul 31, 2024

Choose a reason for hiding this comment

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

Yes there's a plan, but these would appear in CosmosOrchestrationAccount. IcaAccount is concerned with lower level things likes Ports and Connections

@@ -163,10 +163,12 @@ export const prepareChainAccountKit = (zone, { watch, asVow }) =>
this.state.connection = connection;
this.state.remoteAddress = remoteAddr;
this.state.localAddress = localAddr;
const address = findAddressField(remoteAddr);
if (!address) {
console.error('🚨 failed to parse chain address', remoteAddr);
Copy link
Member

Choose a reason for hiding this comment

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

the red light is for "page somebody right away; an invariant was violated" per https://github.com/Agoric/agoric-sdk/wiki/Logging

But this can be triggered if the remote end mis-behaves. Seems like this should be a warning.

⚠️ indicates something that is not expected but was recovered from.

Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

LGTM, modulo updating the readme and error logging

@@ -9,11 +9,11 @@ classDiagram
LCAKit --* LocalchainAccount
ICQConnectionKit --* Port
ICQConnectionKit --* Connection
ChainAccountKit --* Port
ChainAccountKit --* Connection
IcaAccountKit --* Port
Copy link
Member

Choose a reason for hiding this comment

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

line 3 says,

As of 2024-05-29…

This change means that's not true anymore, but it's not accurate as of today either.

Please change the message to something like "Last verified 2024-05-29"

To update it before release I've added an item to #9757

Copy link
Member Author

@0xpatrickdev 0xpatrickdev Jul 31, 2024

Choose a reason for hiding this comment

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

I didn't look closely in my find and replace but it's pretty dated. Please see: 72eabf7

@0xpatrickdev 0xpatrickdev force-pushed the pc/chain-account-kit-cleanup branch 3 times, most recently from 565afc7 to 50b96c7 Compare July 31, 2024 22:18
- these methods are part of OrchestrationAccountI, with no plans to implement them on IcaAccount|ChainAccount
- whether an address is parsable or not is not a consideration for the vstorage story (#9066)
- instead, this should be interpreted as an unexpected error if this path is reached
- throwing here would not solve much - this is a notifier divorced from the callsite. instead,
- the caller will experience an error when they try and use UNPARSABLE_CHAIN_ADDRESS
- ChainAccountKit was a poor name - it implies this kit works for multiple chains
- renamed to IcaAccountKit to convey it follows the ics27-1 protocol
@0xpatrickdev 0xpatrickdev added the automerge:rebase Automatically rebase updates, then merge label Jul 31, 2024
@mergify mergify bot merged commit c1ec381 into master Jul 31, 2024
88 checks passed
@mergify mergify bot deleted the pc/chain-account-kit-cleanup branch July 31, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants