-
Notifications
You must be signed in to change notification settings - Fork 683
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
runtime: test that signext and saturating ops are disabled #8921
Conversation
26e31da
to
cdb5451
Compare
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 for coming back to this! I agree it's better to have them disabled if they weren't supported and if we would fail parsing them earlier anyway.
#[cfg(feature = "nightly")] | ||
tb.expect(expect![[r#" | ||
VMOutcome: balance 4 storage_usage 12 return data None burnt gas 48450963 used gas 48450963 | ||
Err: PrepareError: Error happened while deserializing the module. | ||
"#]]); | ||
#[cfg(not(feature = "nightly"))] | ||
tb.expect(expect![[r#" | ||
VMOutcome: balance 4 storage_usage 12 return data None burnt gas 0 used gas 0 | ||
Err: PrepareError: Error happened while deserializing the module. | ||
"#]]); |
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.
Not sure but I guess feature = "nightly"
has a different gas cost because of ProtocolFeature::FixContractLoadingCost
, right?
If that is the case, wouldn't it be better to use #[cfg(feature = "protocol_feature_fix_contract_loading_cost")]
instead? Makes the reason why we have the flag self-descriptive.
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 sort of avoided looking too deeply into what exact reason for the difference is – when this change gets promoted to a proper feature (or is removed) the test will fail anyhow and the other branch then can be removed & I don't think it is beneficial to hold tests to the same level of rigour as we do for the regular kind of code in this instance.
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.
ok fair enough, I guess we can merge it then
#[cfg(feature = "nightly")] | ||
tb.expect(expect![[r#" | ||
VMOutcome: balance 4 storage_usage 12 return data None burnt gas 48450963 used gas 48450963 | ||
Err: PrepareError: Error happened while deserializing the module. | ||
"#]]); | ||
#[cfg(not(feature = "nightly"))] | ||
tb.expect(expect![[r#" | ||
VMOutcome: balance 4 storage_usage 12 return data None burnt gas 0 used gas 0 | ||
Err: PrepareError: Error happened while deserializing the module. | ||
"#]]); |
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.
ok fair enough, I guess we can merge it then
These are not currently supported and any decision to enable them should be a intentional decision, not an accidental one.
Overall these changes are no-op since the deserialization will fail earlier when trying to deserialize with pwasm deserializer, but if and when we eventually get rid of it, it would be nice if these extensions didn't accidentally get enabled.
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.
Can't provide much insight with my review, but the general premise makes sense to me
(this required to rebase for me to reproduce locally… 🤦)
0d7ee05
to
b66db47
Compare
These are not currently supported and any decision to enable them should be a intentional decision, not an accidental one. Overall these changes are no-op since the deserialization will fail earlier when trying to deserialize with pwasm deserializer, but if and when we eventually get rid of it, it would be nice if these extensions didn't accidentally get enabled. This puts to rest the question raised in #8886 (comment).
These are not currently supported and any decision to enable them should be a intentional decision, not an accidental one. Overall these changes are no-op since the deserialization will fail earlier when trying to deserialize with pwasm deserializer, but if and when we eventually get rid of it, it would be nice if these extensions didn't accidentally get enabled. This puts to rest the question raised in #8886 (comment).
These are not currently supported and any decision to enable them should
be a intentional decision, not an accidental one.
Overall these changes are no-op since the deserialization will fail
earlier when trying to deserialize with pwasm deserializer, but if and
when we eventually get rid of it, it would be nice if these extensions
didn't accidentally get enabled.
This puts to rest the question raised in #8886 (comment).