-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Check bridge routes on send token #16960
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -93,6 +93,7 @@ module bridge::bridge { | |||
const EBridgeAlreadyPaused: u64 = 13; | |||
const EBridgeNotPaused: u64 = 14; | |||
const ETokenAlreadyClaimed: u64 = 15; | |||
const EInvalidBridgeRoute: u64 = 16; |
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.
just a headsup this will conflict with your other PRs
@@ -175,6 +176,7 @@ module bridge::bridge { | |||
) { | |||
let inner = load_inner_mut(self); | |||
assert!(!inner.paused, EBridgeUnavailable); | |||
assert!(chain_ids::is_valid_route(inner.chain_id, target_chain), EInvalidBridgeRoute); |
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.
wow this was a big miss
fun test_execute_send_token_invalid_route() { | ||
let mut scenario = test_scenario::begin(@0x0); | ||
let ctx = test_scenario::ctx(&mut scenario); | ||
let chain_id = chain_ids::sui_devnet(); |
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.
nit: use testnet(), since we are deprecating devnet id
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.
fixed
853c84e
to
07e2c95
Compare
## Description Audit found that `send_token` was not checking for valid routes. Added the missing check ## Test Plan Added unit tests. Positive tests (no abort) for `send_token` are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests. --- 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
## Description Audit found that `send_token` was not checking for valid routes. Added the missing check ## Test Plan Added unit tests. Positive tests (no abort) for `send_token` are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests. --- 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
## Description Audit found that `send_token` was not checking for valid routes. Added the missing check ## Test Plan Added unit tests. Positive tests (no abort) for `send_token` are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests. --- 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
## Description Audit found that `send_token` was not checking for valid routes. Added the missing check ## Test Plan Added unit tests. Positive tests (no abort) for `send_token` are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests. --- 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
## Description Audit found that `send_token` was not checking for valid routes. Added the missing check ## Test Plan Added unit tests. Positive tests (no abort) for `send_token` are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests. --- 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
## Description Audit found that `send_token` was not checking for valid routes. Added the missing check ## Test Plan Added unit tests. Positive tests (no abort) for `send_token` are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests. --- 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
Description
Audit found that
send_token
was not checking for valid routes.Added the missing check
Test Plan
Added unit tests.
Positive tests (no abort) for
send_token
are a bit trickier and will be added when unit test review is done. They were not there so this is not a regression in tests.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)
Release notes