-
Notifications
You must be signed in to change notification settings - Fork 632
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
Move flat-storage-reads/fix-contract-loading-cost/implicit-accounts features to runtime configuration #9364
Conversation
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.
Lots of changes in tests... Didn't expect it to be that invasive but I'm also not surprised.
But the approach makes sense to me and I would argue it results in cleaner code than we have today. Happy to discuss alternatives though, if you think it's worth doing.
#[test] | ||
fn all_configs_are_specified() { |
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.
ah yes we should have had such a test from the beginning 👍
@@ -445,7 +426,7 @@ fn test_stack_instrumentation_protocol_upgrade() { | |||
.opaque_error() | |||
.expects(&[ | |||
expect![[r#" | |||
VMOutcome: balance 4 storage_usage 12 return data None burnt gas 6789985365 used gas 6789985365 | |||
VMOutcome: balance 4 storage_usage 12 return data None burnt gas 18136872021 used gas 18136872021 |
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, why would the gas values change here? Is there an issue with the new way of keeping versions? (Which I wonder, what's the reason for changing it?)
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 believe this change is actually indicative of the previous way not correctly using the old stack limiting mechanism. You will notice that previously the gas was exactly the same before (the first expect!
and after (the 2nd expect!
) the ProtocolFeature::CorrectStackLimit
feature, which makes no sense given the nature of this test. That said, I haven’t looked too deeply into why this exact test was behaving the way it did before…
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, that's a reasonable explanation. :)
Maybe for final PR, it would make sense to do the refactor of the TestBuilder
in a separate PR to make it obvious it has nothing to do with code changes outside the testing framework.
205e340
to
c0513e8
Compare
We made a single letter mistake and passed values larger than `i32::MAX` to a function that did only supports `0..=i32::MAX`. This fix corrects the problem, introduces the necessary protocol versioning, a regression test and an additional assert to validate the inputs in the aforementioned function. I ended up using the parameters for the behaviour flag in anticipation that I wouldn’t need to do this later as part of #9364.
We made a single letter mistake and passed values larger than `i32::MAX` to a function that did only supports `0..=i32::MAX`. This fix corrects the problem, introduces the necessary protocol versioning, a regression test and an additional assert to validate the inputs in the aforementioned function. I ended up using the parameters for the behaviour flag in anticipation that I wouldn’t need to do this later as part of #9364.
We made a single letter mistake and passed values larger than `i32::MAX` to a function that did only supports `0..=i32::MAX`. This fix corrects the problem, introduces the necessary protocol versioning, a regression test and an additional assert to validate the inputs in the aforementioned function. I ended up using the parameters for the behaviour flag in anticipation that I wouldn’t need to do this later as part of #9364.
3c3dc00
to
4d60111
Compare
This is a no-op change that's been split out from #9364. In principle this is not a strict improvement in isolation since the functions now get access to more information than they strictly need to work with, but in practice this should make our lives easier as now we won’t need to redo this work if we want to make some fees dependent on some configuration option :)
1c4b142
to
b6f151f
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.
Looks great!
This is a no-op change that's been split out from #9364. In principle this is not a strict improvement in isolation since the functions now get access to more information than they strictly need to work with, but in practice this should make our lives easier as now we won’t need to redo this work if we want to make some fees dependent on some configuration option :)
Here the noted protocol features have been replaced with runtime configuration via parameters instead. This would be one solution/option to getting rid of compile-time features in contract runtime which is interfering with limited replayability (compile-time feature control means that all of the crates still need to be built as a single compilation unit with consistent options.) cc #8197
135d52e
to
f545a34
Compare
We made a single letter mistake and passed values larger than `i32::MAX` to a function that did only supports `0..=i32::MAX`. This fix corrects the problem, introduces the necessary protocol versioning, a regression test and an additional assert to validate the inputs in the aforementioned function. I ended up using the parameters for the behaviour flag in anticipation that I wouldn’t need to do this later as part of #9364.
We made a single letter mistake and passed values larger than `i32::MAX` to a function that did only supports `0..=i32::MAX`. This fix corrects the problem, introduces the necessary protocol versioning, a regression test and an additional assert to validate the inputs in the aforementioned function. I ended up using the parameters for the behaviour flag in anticipation that I wouldn’t need to do this later as part of near#9364.
This is a no-op change that's been split out from near#9364. In principle this is not a strict improvement in isolation since the functions now get access to more information than they strictly need to work with, but in practice this should make our lives easier as now we won’t need to redo this work if we want to make some fees dependent on some configuration option :)
…eatures to runtime configuration (near#9364) This PR is built on top of a previous PR (see the base branch). Here the noted protocol features have been replaced with runtime configuration via parameters instead. This would be one solution/option to getting rid of compile-time features in contract runtime which is interfering with limited replayability (compile-time feature control means that all of the crates still need to be built as a single compilation unit with consistent options.) cc @jakmeier cc near#8197
This is a no-op change that's been split out from #9364. In principle this is not a strict improvement in isolation since the functions now get access to more information than they strictly need to work with, but in practice this should make our lives easier as now we won’t need to redo this work if we want to make some fees dependent on some configuration option :)
…eatures to runtime configuration (#9364) This PR is built on top of a previous PR (see the base branch). Here the noted protocol features have been replaced with runtime configuration via parameters instead. This would be one solution/option to getting rid of compile-time features in contract runtime which is interfering with limited replayability (compile-time feature control means that all of the crates still need to be built as a single compilation unit with consistent options.) cc @jakmeier cc #8197
This PR is built on top of a previous PR (see the base branch). Here the noted protocol features have been replaced with runtime configuration via parameters instead.
This would be one solution/option to getting rid of compile-time features in contract runtime which is interfering with limited replayability (compile-time feature control means that all of the crates still need to be built as a single compilation unit with consistent options.)
cc @jakmeier
cc #8197