-
Notifications
You must be signed in to change notification settings - Fork 15
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: update polkadot sdk 1.15.2, rust to 2024-07-31 #5306
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5306 +/- ##
=======================================
+ Coverage 70% 71% +1%
=======================================
Files 489 487 -2
Lines 87875 84720 -3155
Branches 87875 84720 -3155
=======================================
- Hits 61938 60159 -1779
+ Misses 22630 21854 -776
+ Partials 3307 2707 -600 ☔ View full report in Codecov by Sentry. |
engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher/tests.rs
Show resolved
Hide resolved
I don't think we need to do this. They are separate things, using an anyhow error means things like the broker api could be used in non-rpc contexts too. |
Updated Rust compile version to nightly-2024-06-01 Updated some other library to newer version Cleaned up the std feature references. WIP does not build due to feature conflict
* Migrated RPC interface to jsonrpsee-0.23.2 Major changes to how subscriptions are streamed. Major changes to all error types. * Improved how errors are converted to ErrorObjectOwned
Updated documentations to be fix warning in later versions. Cannot upgrade to further version because Substrate code triggers "unreachable_patterns" error from Clippy.
Based on the diff in polkadot-sdk.
This is more in line with previous behaviour.
e80df01
to
506974f
Compare
I rebased against main to untangle the Zepter merge with all the feature changes. I don't think it was necessary. Similarly running zepter against the polkadot repo, I would rather avoid such a big change. So I updated the Will take a closer look at non-feature/dependency stuff tomorrow. Looks good so far though 👌 |
Thanks @syan095 , I added some smallish changes and some larger ones that I'll mention below. I'm happy with this now. The biggest change I made to the dependencies was to remove a lot of feature declarations. I think these were added by Zepter but most of them are unnecessary / erroneous. Let's discuss tomorrow, then get it merged 🍾
✅
No need for now.
✅ LGTM we don't want to change any pallet indices.
✅
Would be nice to have (and might make future upgrades simpler) but not urgent. I thought we already had a Linear item for this but can't find it right now...
✅ Removed
✅ I think you mean iter::from_fn. I don't like how from_fn works (mutating the environment)... but I guess we don't want to use deprecated functions.
✅ I changed the implementation slightly. We don't need this now, but it might be useful for configuring different starting conditions for localnets.
✅ This is fine but also, these can all be defaulted in the mocks and in the runtime itself. See: 06b6192
✅
✅ I reshuffled some of the lines in the service.rs file to make it a closer match to the polkadot-sdk version. This is just to make easier to visually compare the file diffs. I also moved the LibP2p/LiteP2p switch in to command.rs to match how it's done in polkadot-sdk.
✅ All reviewed, LGTM
✅ I think anyhow is fine for now. I just changed the implementation to use Display instead of Debug since this is how the errors were formatted previously.
Ok, we can follow this up.
✅ Looks like we were already matching on the ErrorObject anyway.
✅ LGTM, we can think about ways to make this more dev friendly but for now it's good enough.
✅
✅
✅ LGTM
Seems to work for me - might have been feature-related?
I removed the unreachable pattern exceptions. We almost always want to be alerted on unreachable patterns. What this lint means is that we have written a match statement where one of the arms can never be reached, which is usually a programmer error. It has nothing to do with unrachable!().
✅ I found it :) It was in the root Cargo.toml, but named with |
25c7dce
to
89edf9b
Compare
…lana-ccm * origin/main: chore: update polkadot sdk 1.15.2, rust to 2024-07-31 (#5306) chore: add sol min_prio_fee to ingress and egress estimation (#5323) docs: fix log filtering in readme (#5319) feat: cleanup aborted broadcasts (#5301) fix: increase init timeout for backup test (#5317) feat: minimum chunk size setting (#5314) chore: add egress fee for token account rent (#5315) fix: ensure unused sol deposit channels are closed (#5312)
Pull Request
Closes: PRO-1407
Summary
Updated to PolkadotSdk version 1.15.2 (almost) the latest release.
Updated Rustc version to
nightly-2024-07-31
. The next version after that generates warnings for "unreachable-pattern" within Substrate'spallet::call
macro.Major changes and TODOs to review is listed below. I have numbered them so they can be easily referred to. I would suggest we split some of them into separate linear tasks that can be done progressively after this upgrade.
subcommand::try-runtime is deprecated
There's a way to change pallet const parameters at Runtime through the use of extrinsic
pallet_parameters::set_parameter
.TODO: Do we want to use this feature?
Runtime V2: new proc. macro for constructing Runtime.
TODO: Review:
try-runtime-cli: fully deprecated. Use
paritytech/try-runtime-cli
insteadConsider to use workspace dependencies to unify dependency versions so they are consistent across all packages.
TODO: Consider unify dependency versions
TODO: Review - can this be removed?
#[allow(dead_code)]
fn input_to_output_amount_floor(amount: Amount, tick: Tick) -> Option;
Deprecated function
itertools::unfold
Replaced with
itertools::unfold(|t| {...}
Runtime
sp_genesis_builder::GenesisBuilder<Block>
now requires fn preset_names()TODO: review if we need to use this feature.
Overhaul in how "Presets" can be queried.
Runtime: System::Config now has extra fields:
TODO review if () is OK. Review if we want to refactor all mock Runtimes to use v2 macro.
type SingleBlockMigrations = ();
type MultiBlockMigrator = ();
type PreInherents = ();
type PostInherents = ();
type PostTransactions = ();
Aura now need SlotDuration defined explicitly.
Currently set to SLOT_DURATION (1 block = 6000ms)
TODO: Review
new_full: sc_consensus_grandpa::grandpa_peers_set_config::<_, Network> now has 2 additional fields,
metrics
andpeer_store_handle
Jsonrpsee is updated to 0.23.2. Major changes on error types
ErrorObjectOwned
, which containscode
,message
anddata
! on-success: uses substrate version of
pipe_from_stream
! on-fail: spawn a new thread to "reject" the sink.
ErrorObjectOwned
We return anyhow::error for Lots of rpc functions. They are currently converted to ErrorOjbectOwned via
to_rpc_error
TODO: review if we should update them to return jsonrpsee::RpcResult instead.
TODO:
async fn should_update_version_on_bad_proof()
Subscription::new()
is now private - the specific test case has been commented out for now, this needs to be fixed/replaced/removed.Also Mockall is having trouble creating types that don't have "default" impl. Mockall may need to be replaced here.
The entire file is commented out right now
(Jamie said he might pick this up)
Statechain observer:
- updated how RPC errors are being matched.
Lots of error conversion in LP APIs, Broker API, ChainCli, Engine. All anyhow::error are converted into ErrorObjectOwned via
to_rpc_error
. TODO discuss return types (I think it would be easier to always return anyhow::result and map_err() into jsonrpsee error, in case jsonrpsee changes its error type again.subscribe_order_fills
changed - SubscriptionSinks no longer need to be closed manually.Clap changes: "version_short" removed, auto set to "-V"
Runtime v2 now has "GenesisConfig build test", where all pallets' genesisconfig is built using GenesisConfig::default().
This is causing test fail in cases such as min_fun = redeption_tax = 0, or when
initial_authorities = []. Asserts are replaced with
frame_support::print
but return a value to ensure this test will pass.I updated the "Default" impl in these cases to make tests pass. This is OK assuming GenesisConfig::Defualt is NEVER used in Production.
TODO: Review if this is OK.
Note: Builds with
runtime-benchmarking
cannot run. For building local net, the benchmkaring feature must be turned off.TODO: In the next rust version(2024-08-14), "unreachable-pattern" will trigger rust compiler warning. We should review all cases of "unreachable-pattern" (with the unreachable!() macro) and review them
Getting
lint
clippy::thread_local_initializer_can_be_made_consthas been renamed to
clippy::missing_const_for_thread_local` clippy warning. We don't use this, not sure why we are getting this warning for all our build packages