Skip to content

Commit 18cac30

Browse files
committed
More TODOs to check
1 parent a83a622 commit 18cac30

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

runtimes/bulletin-polkadot/src/polkadot_bridge_config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl pallet_bridge_parachains::Config<WithPolkadotBridgeParachainsInstance> for
206206

207207
const LOG_TARGET_BRIDGE_DISPATCH: &str = "runtime::bridge-dispatch";
208208

209-
/// Message dispatch result type for single message.
209+
/// Message dispatch result type for a single message.
210210
#[derive(
211211
CloneNoBound,
212212
EqNoBound,
@@ -218,11 +218,11 @@ const LOG_TARGET_BRIDGE_DISPATCH: &str = "runtime::bridge-dispatch";
218218
TypeInfo,
219219
)]
220220
pub enum XcmBlobMessageDispatchResult {
221-
/// We've been unable to decode message payload.
221+
/// We've been unable to decode the message payload.
222222
InvalidPayload,
223223
/// Message has been dispatched.
224224
Dispatched,
225-
/// Message has **NOT** been dispatched because of given error.
225+
/// Message has **NOT** been dispatched because of a given error.
226226
NotDispatched(#[codec(skip)] Option<DispatchBlobError>),
227227
}
228228

@@ -432,7 +432,8 @@ pub mod benchmarking {
432432
pallet_bridge_messages::LaneIdOf<Runtime, WithPeoplePolkadotMessagesInstance>,
433433
>;
434434
}
435-
//
435+
436+
// TODO: enable tests as much as possible
436437
// #[cfg(test)]
437438
// pub(crate) mod tests {
438439
// use super::*;

runtimes/bulletin-polkadot/src/xcm_config.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ impl WeightTrader for NoopTrader {
9696
}
9797
}
9898

99-
// TODO: wrong
10099
/// Allows execution from `origin` if it is contained in `AllowedOrigin`
101100
/// and if it is just a straight `Transact` which contains any call.
102101
///
103-
/// That's a 1:1 copy of corresponding Cumulus structure.
102+
/// That's a 1:1 copy of the corresponding Cumulus structure.
104103
pub struct AllowUnpaidTransactsFrom<RuntimeCall, AllowedOrigin>(
105104
sp_std::marker::PhantomData<(RuntimeCall, AllowedOrigin)>,
106105
);
@@ -120,6 +119,8 @@ impl<RuntimeCall: Decode, AllowedOrigin: Contains<Location>> ShouldExecute
120119
{:?}", origin, instructions, max_weight, _properties,
121120
);
122121

122+
// TODO: check if this is enough, because we don't filter `Transact` at all,
123+
// but instead we allow all XCM instruction processing.
123124
// we only allow from configured origins
124125
ensure!(AllowedOrigin::contains(origin), ProcessMessageError::Unsupported);
125126

@@ -139,7 +140,8 @@ pub type XcmRouter = LocalExporter<ToBridgeHaulBlobExporter, UniversalLocation>;
139140
/// The barriers one of which must be passed for an XCM message to be executed.
140141
pub type Barrier = TrailingSetTopicAsId<
141142
WithComputedOrigin<
142-
// We only allow unpaid execution from the PeoplePolkadot parachain.
143+
// TODO: check if this is working, I think we executed `Trap` in zombienet with
144+
// `DescendOrigin`. We only allow unpaid execution from the PeoplePolkadot parachain.
143145
AllowUnpaidTransactsFrom<RuntimeCall, OnlyPeoplePolkadotLocation>,
144146
UniversalLocation,
145147
ConstU32<2>,
@@ -213,8 +215,6 @@ impl DispatchBlob for ImmediateXcmDispatcher {
213215
let message: Xcm<RuntimeCall> =
214216
message.try_into().map_err(|_| DispatchBlobError::UnsupportedXcmVersion)?;
215217

216-
// TODO: security - filter DesendOrigin
217-
218218
log::trace!(
219219
target: "runtime::xcm",
220220
"Going to dispatch XCM message from {:?}: {:?}",
@@ -230,6 +230,8 @@ impl DispatchBlob for ImmediateXcmDispatcher {
230230
// execute the XCM program
231231
let mut message_hash = message.using_encoded(blake2_256);
232232
XcmExecutor::<XcmConfig>::prepare_and_execute(
233+
// TODO: double-check if this, maybe should be just `Here`, I think we executed `Trap`
234+
// in zombienet with `DescendOrigin`.
233235
PeoplePolkadotLocation::get(),
234236
message,
235237
&mut message_hash,

0 commit comments

Comments
 (0)