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

Detect relevant IbcRelay actions #1805

Merged
merged 5 commits into from
Sep 24, 2024
Merged

Detect relevant IbcRelay actions #1805

merged 5 commits into from
Sep 24, 2024

Conversation

grod220
Copy link
Collaborator

@grod220 grod220 commented Sep 23, 2024

At the moment, after a user makes a Ics20Transfer, Prax is not indexing the transaction for the IbcRelay action. This can cause confusion for users wondering the status of transaction.

This PR detects the relay action and, if the user is the recipient, adds it to the tx db.

@grod220 grod220 self-assigned this Sep 23, 2024
Copy link

changeset-bot bot commented Sep 23, 2024

🦋 Changeset detected

Latest commit: e9a8d16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@penumbra-zone/storage Major
@penumbra-zone/protobuf Minor
@penumbra-zone/bech32m Major
@penumbra-zone/wasm Major
@penumbra-zone/query Major
@penumbra-zone/types Major
@penumbra-zone/services Major
minifront Patch
node-status Patch
@penumbra-zone/client Major
@penumbra-zone/getters Major
@penumbra-zone/perspective Major
@penumbra-zone/ui Major
@penumbra-zone/crypto-web Major
@repo/tailwind-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +316 to +323
/// Checks if address is controlled by view server full viewing key
#[wasm_bindgen]
pub fn is_controlled_address(&self, address: &[u8]) -> WasmResult<bool> {
utils::set_panic_hook();

let address: Address = Address::decode(address)?;
Ok(is_controlled_inner(&self.fvk, &address))
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added to the ViewServer as it makes it easier to access from within the block processor

@grod220 grod220 requested review from a team and removed request for a team September 23, 2024 15:42
@grod220
Copy link
Collaborator Author

grod220 commented Sep 23, 2024

Some type registry updates are needed for this PR. Will re-request review when ready.

@@ -48,7 +48,7 @@ export const TxViewer = ({ txInfo }: { txInfo?: TransactionInfo }) => {

// use React-Query to invoke custom hooks that call async translators.
const { data: receiverView } = useQuery(
['receiverView', txInfo, option],
['receiverView', txInfo?.toJson({ typeRegistry }), option],
Copy link
Collaborator Author

@grod220 grod220 Sep 24, 2024

Choose a reason for hiding this comment

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

Now that we are saving relay transactions, there is a chance of an Any field needing to be serialized. For that reason, it needs access to the registry to know how to serialize/deserialize. Hence, why you see typeRegistry being added to a number of from/toJson() methods.

Comment on lines -41 to -43
// gen/ibc/core/channel/v1/tx_pb
MsgRecvPacket,

Copy link
Collaborator Author

@grod220 grod220 Sep 24, 2024

Choose a reason for hiding this comment

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

Not necessary to list specifically in the registry as it exists in the newly added IbcChannelMsgService already

Copy link
Collaborator Author

@grod220 grod220 Sep 24, 2024

Choose a reason for hiding this comment

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

Screenshot 2024-09-24 at 11 19 12 AM

@grod220 grod220 requested a review from a team September 24, 2024 09:47
const dataString = new TextDecoder().decode(packet.data);
return FungibleTokenPacketData.fromJsonString(dataString);
} catch (e) {
return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: should we error-log here, or display something to the user even?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, perhaps we do. I'll handle the case where the packet cannot be parsed and display Unknown packet data in the row.

Copy link
Member

@vacekj vacekj left a comment

Choose a reason for hiding this comment

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

lgtm

@grod220 grod220 merged commit b6e32f8 into main Sep 24, 2024
6 checks passed
@grod220 grod220 deleted the ibc-relay-txs branch September 24, 2024 15:53
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.

2 participants