-
Notifications
You must be signed in to change notification settings - Fork 798
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
Add try_state and integrity_test to XCM simulator fuzzer #3222
Add try_state and integrity_test to XCM simulator fuzzer #3222
Conversation
TransferReserveAsset { xcm, .. } | | ||
SetErrorHandler(xcm) | | ||
SetAppendix(xcm) => Vec::from(xcm.inner()).iter_mut().flat_map(matches_recursive).collect(), | ||
_ => vec![message.clone()], |
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.
Hm, this function is called matches_recursive
, but it dies not call the matches_blocklisted_messages
?
To me it looks like it unpacks them.
You can also probably do both functions in one and just add a Transact { }
here, then there are no vector instructions.
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.
Should be addressed
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.
Thanks! Left some nits, and then afterwards please look for the CI.
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`, | ||
// `spec_version`, and `authoring_version` are the same between Wasm and native. | ||
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use | ||
// the compatible custom types. |
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.
I think you can delete these comments 😆 Maybe there is also a default or a mock for testing.
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.
Done
It looks like the |
…rlin/polkadot-sdk into xcm-simulator-fuzzer-try-runtime
|
||
#[sp_version::runtime_version] | ||
pub const VERSION: RuntimeVersion = RuntimeVersion { | ||
spec_name: create_runtime_str!("node-template"), |
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.
this doesn't sound like the right name to me.
spec_name: create_runtime_str!("node-template"), | |
spec_name: create_runtime_str!("xcm-simulator-node"), |
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.
This was removed in 3281a1f.
@@ -259,3 +265,53 @@ construct_runtime!( | |||
MessageQueue: pallet_message_queue, | |||
} | |||
); | |||
|
|||
#[sp_version::runtime_version] |
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.
I don't see anywhere else in this PR that this runtime apis are needed. It seems like you just want to call into the methods exposed from Executive
. Are you sure you need this?
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.
This was removed in 3281a1f.
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.
I might be wrong because I don't know the context, but I think the impl_runtime_apis
is not needed.
Just verified with coverage, and the fuzzer is able to access |
The CI pipeline was cancelled due to failure one of the required jobs. |
…rlin/polkadot-sdk into xcm-simulator-fuzzer-try-runtime
84d89e3
This adds
try_state()
andintegrity_test()
to the four runtimes of the XCM-simulator fuzzer.With this, we are able to stress-test message-queue's try_state.
This also adds the
Transact
block-listing from #2424 to avoid false-positives.Thank you @ggwpez for the help with the runtime configurations.