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

[Native bridge move] tests for msg encoding and some changes #16216

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

longbowlu
Copy link
Contributor

Description

  1. add msg encoding regression tests for Move using bytes generated in Rust
  2. add assert_valid_chain_id and call it in all places where the value could come from unverified user input
  3. other cosmetic changes

Test Plan

How did you test the new or updated feature?


If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Copy link

vercel bot commented Feb 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2024 10:34am
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2024 10:34am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2024 10:34am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Feb 26, 2024 10:34am
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 26, 2024 10:34am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 26, 2024 10:34am

Copy link
Contributor

@dariorussi dariorussi left a comment

Choose a reason for hiding this comment

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

it looks good to me, can we look at the one comment and reply?
thanks so much

@@ -191,6 +204,10 @@ module bridge::message {
token_type: u8,
amount: u64
): BridgeMessage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also validate that the route is valid when creating these msgs?

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 just a constructor function for the BridgeMessage struct so not doing any checks here, the message won't be able to get any signature from the validators if the route is invalid anyway, so won't do any harm to the bridge

longbowlu and others added 2 commits February 26, 2024 10:31
## Description

Describe the changes or additions included in this PR.

## Test Plan

How did you test the new or updated feature?

---
If your changes are not user-facing and do not break anything, you can
skip the following section. Otherwise, please briefly describe what has
changed under the Release Notes section.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes

---------

Co-authored-by: patrick <[email protected]>
@patrickkuo patrickkuo merged commit 6d68939 into feature/native-bridge Feb 26, 2024
32 of 38 checks passed
@patrickkuo patrickkuo deleted the lu/move-msg-regression-test branch February 26, 2024 10:33
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.

5 participants