Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions bridges/snowbridge/pallets/system-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,10 @@ pub mod pallet {
fn send(origin: H256, command: Command, fee: u128) -> DispatchResult {
let mut message = Message {
origin,
id: Default::default(),
id: frame_system::unique((origin, command, fee)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd suggest using blake2_256 for determinism.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in 78b7326.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think determinism is useful in this case. These are governance messages emitted by BridgeHub itself. I don't think any UIs are going to try and deterministically recreate these message ids.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reverted 78b7326.

fee,
commands: BoundedVec::try_from(vec![command]).unwrap(),
};
let hash = sp_io::hashing::blake2_256(&message.encode());
message.id = hash.into();

let ticket = <T as pallet::Config>::OutboundQueue::validate(&message)
.map_err(|err| Error::<T>::Send(err))?;
Expand Down
Loading