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

fix: A8 wrong network in VC #2904

Merged
merged 2 commits into from
Jul 18, 2024
Merged

fix: A8 wrong network in VC #2904

merged 2 commits into from
Jul 18, 2024

Conversation

higherordertech
Copy link
Contributor

@higherordertech higherordertech commented Jul 17, 2024

P-926 added enum A8SupportedNetwork to matching ts types, removed unsupported network by dataprovider for A8

!!!! This is a breaking change !!!

Context

1 This VC used achainable, and it only supported a subset of networks as below, instead all the network that we defined:
ethereum, polkadot, kusama, litmus, litentry, khala
image

Labels

Please apply following PR-related labels when appropriate:

  • C0-breaking: if your change could break the existing client, e.g. API change, critical logic change
  • C1-noteworthy: if your change is non-breaking, but is still worth noticing for the client, e.g. reference code improvement

How (Optional)

Testing Evidences

Please attach any relevant evidences if applicable
Before the fix:
Screenshot 2024-07-17 at 5 18 48 pm

Screenshot 2024-07-17 at 5 19 11 pm

After the fix:
Screenshot 2024-07-17 at 5 19 37 pm

Screenshot 2024-07-17 at 5 20 00 pm

@higherordertech higherordertech added the C0-breaking Breaking change that will cause existing client to break label Jul 17, 2024
@@ -164,7 +167,11 @@ impl Assertion {
Self::VIP3MembershipCard(..) |
Self::WeirdoGhostGangHolder => vec![Web3Network::Ethereum],
// total tx over `networks`
Self::A8(network) => network.to_vec(),
Self::A8(networks) => networks
Copy link
Collaborator

Choose a reason for hiding this comment

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

How do you think just add a filter to filter out types, which is NOT Litentry, Litmus, Polkadot, Kusama, Khala, or Ethereum ?
Then we don't need to create a new type A8SupportedNetwork.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the client pass in the wrong networks? Shouldn't this be fixed at client side first?

But sure we could a second check logic here

And yes we can simply filter out unwanted types, or retain only desired ones

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Kailai-Wang this is the leftover of refactoring of shifting network type from link_identity to request_vc. From IDHub point of view, they always wish the all supported networks. So they don't do any filtering at client side. We did the magic within get_eligible_identities().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored to only filter instead creating new types.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is the leftover of refactoring of shifting network type from link_identity to request_vc. From IDHub point of view, they always wish the all supported networks. So they don't do any filtering at client side. We did the magic within get_eligible_identities().

I doubt that's related.

The main motivation here was to have a struct to represent exactly the accepted values for A8. Clients must specify one of them to get the right assertion.

Copy link
Collaborator

@BillyWooo BillyWooo left a comment

Choose a reason for hiding this comment

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

LGTM

@higherordertech higherordertech enabled auto-merge (squash) July 18, 2024 12:44
@higherordertech higherordertech merged commit 8c760bb into dev Jul 18, 2024
32 checks passed
@higherordertech higherordertech deleted the fix-A8-wrong-network branch July 19, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C0-breaking Breaking change that will cause existing client to break
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants