-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: upgrade stable2409 #412
base: chungquantin/chore-polkadot-stable2407
Are you sure you want to change the base?
chore: upgrade stable2409 #412
Conversation
45b2cf6
to
e7abcd9
Compare
39144ac
to
5a52b05
Compare
@@ -341,7 +341,7 @@ fn start_destroy_works() { | |||
// Check that the token is not live after starting the destroy process. | |||
assert_noop!( | |||
Assets::mint(signed(ALICE), token, ALICE, 10 * UNIT), | |||
AssetsError::AssetNotLive | |||
TokenError::UnknownAsset |
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.
Test was failing due to the following paritytech/polkadot-sdk#3286
Concerning to me is that this would have broken a smart contract. Presumably contracts won't often match on a specific error but if so, the contract could behave unexpected.
Curious to hear what others think about 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.
Good to see that the test worked. If someone were using this, we would need to map the error AssetNotLive
to UnknownAsset
as to not break the contract.
Only a problem if we don't catch it before a runtime upgrade.
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 error only changed for the mint
function.
The reason why it is concerning to me is that I don't have the feeling parity is seeing this as a breaking change, meaning that they'll make such changes more often, meaning that we have to create more versions.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## chungquantin/chore-polkadot-stable2407 #412 +/- ##
=========================================================================
Coverage ? 68.24%
=========================================================================
Files ? 70
Lines ? 11841
Branches ? 11841
=========================================================================
Hits ? 8081
Misses ? 3503
Partials ? 257
|
assets::start_destroy(&addr, token); | ||
assert_eq!(mint(&addr, token, &BOB, amount), Err(Module { index: 52, error: [16, 0] })); | ||
assert_eq!(mint(&addr, token, &BOB, amount), Err(Token(UnknownAsset))); |
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.
Same error that changed as above.
@@ -16,6 +16,7 @@ fn schedule<T: pallet_contracts::Config>() -> pallet_contracts::Schedule<T> { | |||
pallet_contracts::Schedule { | |||
limits: pallet_contracts::Limits { | |||
runtime_memory: 1024 * 1024 * 1024, | |||
validator_runtime_memory: 2 * 1024 * 1024 * 1024, |
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.
The integrity test was failing:
failures:
---- __construct_runtime_integrity_test::runtime_integrity_tests stdout ----
thread '__construct_runtime_integrity_test::runtime_integrity_tests' panicked at /Users/R0GUE/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pallet-contracts-38.0.0/src/lib.rs:707:13:
Maximal storage size 143942352 exceeds the storage limit 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@peterwht do you remember why you put this in the runtimes. The SDK uses the default, yet an other error occurs when applying:
failures:
---- __construct_runtime_integrity_test::runtime_integrity_tests stdout ----
thread '__construct_runtime_integrity_test::runtime_integrity_tests' panicked at /Users/R0GUE/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pallet-contracts-38.0.0/src/lib.rs:657:13:
Given `CallStack` height 24, `MaxCodeLen` should be set less than 8995 (current value is 262144), to avoid possible runtime oom issues.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I see we have double the MaxCodeLen
value configured as the sdk runtime linked.
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 remember why, unfortunately. I guess it just gives us the flexibility to modify those as needed.
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.
The reason the default isn't working is due to this: https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/contracts/src/lib.rs#L649
We would need to reduce the MaxCodeLen
if we want to use the default schedule.
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.
also, do you have a link for where this value is coming from: " validator_runtime_memory: 2 * 1024 * 1024 * 1024,"?
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.
It had to be bigger than the other value so not much thought put towards it.
I changed the contracts configuration back to default. As we might transition to only using revive I suggest we look into this when we add revive to the runtime, and take a closer look at those configurations, in stead of now.
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.
@@ -17,7 +17,7 @@ impl pallet_ismp::Config for Runtime { | |||
type Coprocessor = Coprocessor; | |||
type Currency = Balances; | |||
type HostStateMachine = HostStateMachine; | |||
type Mmr = pallet_ismp::NoOpMmrTree<Self>; | |||
type OffchainDB = (); |
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.
Confirmed with polytope labs team that this is oke to use in stead of the Mmr pallet
@@ -17,7 +17,7 @@ impl pallet_ismp::Config for Runtime { | |||
type Coprocessor = Coprocessor; | |||
type Currency = Balances; | |||
type HostStateMachine = HostStateMachine; | |||
type Mmr = pallet_ismp::NoOpMmrTree<Self>; | |||
type OffchainDB = (); |
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.
Confirmed with polytope labs team that this is oke to use in stead of the Mmr pallet
fn module_for_id(&self, id: Vec<u8>) -> Result<Box<dyn IsmpModule>, Error> { | ||
Err(Error::ModuleNotFound(id)) | ||
fn module_for_id(&self, id: Vec<u8>) -> Result<Box<dyn IsmpModule>, anyhow::Error> { | ||
Err(anyhow::anyhow!("Module not found: {:?}", id)) |
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.
Changed to anyhow
error type
@@ -134,7 +134,7 @@ impl xcm_executor::Config for XcmConfig { | |||
type CallDispatcher = RuntimeCall; | |||
type FeeManager = XcmFeeManagerFromComponents< | |||
WaivedLocations, | |||
XcmFeeToAccount<Self::AssetTransactor, AccountId, SudoAddress>, | |||
SendXcmFeeToAccount<Self::AssetTransactor, SudoAddress>, |
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.
@@ -16,6 +16,7 @@ fn schedule<T: pallet_contracts::Config>() -> pallet_contracts::Schedule<T> { | |||
pallet_contracts::Schedule { | |||
limits: pallet_contracts::Limits { | |||
runtime_memory: 1024 * 1024 * 1024, | |||
validator_runtime_memory: 2 * 1024 * 1024 * 1024, |
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 remember why, unfortunately. I guess it just gives us the flexibility to modify those as needed.
@@ -16,6 +16,7 @@ fn schedule<T: pallet_contracts::Config>() -> pallet_contracts::Schedule<T> { | |||
pallet_contracts::Schedule { | |||
limits: pallet_contracts::Limits { | |||
runtime_memory: 1024 * 1024 * 1024, | |||
validator_runtime_memory: 2 * 1024 * 1024 * 1024, |
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.
The reason the default isn't working is due to this: https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/contracts/src/lib.rs#L649
We would need to reduce the MaxCodeLen
if we want to use the default schedule.
@@ -341,7 +341,7 @@ fn start_destroy_works() { | |||
// Check that the token is not live after starting the destroy process. | |||
assert_noop!( | |||
Assets::mint(signed(ALICE), token, ALICE, 10 * UNIT), | |||
AssetsError::AssetNotLive | |||
TokenError::UnknownAsset |
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.
Good to see that the test worked. If someone were using this, we would need to map the error AssetNotLive
to UnknownAsset
as to not break the contract.
Only a problem if we don't catch it before a runtime upgrade.
@@ -16,6 +16,7 @@ fn schedule<T: pallet_contracts::Config>() -> pallet_contracts::Schedule<T> { | |||
pallet_contracts::Schedule { | |||
limits: pallet_contracts::Limits { | |||
runtime_memory: 1024 * 1024 * 1024, | |||
validator_runtime_memory: 2 * 1024 * 1024 * 1024, |
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.
also, do you have a link for where this value is coming from: " validator_runtime_memory: 2 * 1024 * 1024 * 1024,"?
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.
Thank you for the comment clarifying the key changes. Great work!
@@ -45,14 +46,14 @@ futures = "0.3.30" | |||
hex = "0.4.3" | |||
hex-literal = "0.4.1" | |||
impl-trait-for-tuples = "0.2.2" | |||
jsonrpsee = { version = "0.23.2", features = [ "server" ] } | |||
log = { version = "0.4.21", default-features = false } | |||
jsonrpsee = { version = "0.24.3" } |
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.
Is the removal of features = [ "server" ]
intentional, as mentioned in the description?
Uplifts pop to 2409. Some noteworthy changes had to be made for ismp (upstream changes) and the sdk. I left comments at the relevant places to have a discussion.
Notes: