-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: MMD-1309 / Update from Substrate 3 to commit dated 10th Feb 2022 (common branch 'polkadot-v0.9.17' for use with substrate-parachain-template) #215
base: master
Are you sure you want to change the base?
Conversation
replaced 10th Feb release commit '49a4103f4bfef55be20a5c6d26e18ff3003c3353' of v3.0.0 and v0.9.0 dependencies with specific commit at later date replace version = '3.0.0' git = 'https://github.com/paritytech/substrate', rev = '3957f43912e43fd28b624bb0736141ac24b51615' replace version = '0.9.0' git = 'https://github.com/paritytech/substrate', rev = '3957f43912e43fd28b624bb0736141ac24b51615' replace = '3.0.0' = { git = 'https://github.com/paritytech/substrate', rev = '3957f43912e43fd28b624bb0736141ac24b51615' } replace = '3.1.0' = { git = 'https://github.com/paritytech/substrate', rev = '3957f43912e43fd28b624bb0736141ac24b51615' } replace = '0.9.0' = { git = 'https://github.com/paritytech/substrate', rev = '3957f43912e43fd28b624bb0736141ac24b51615' } additionally had to add telemetry_span code to node/src/service.rs since it is required after one of the commits
update to 22nd Feb commit 904495b and fixed error `the trait SpawnEssentialNamed is not implemented for SpawnTaskHandle` in node/src/service.rs
…info and using log library
…7-30 from nightly-2021-03-10 to fix .clamp unstable error fix error missing `block_proposal_slot_portion` using nightly-2021-07-30 after updating using: rustup install nightly-2021-07-30-x86_64-apple-darwin rustup default nightly-2021-07-30 rustup override set nightly-2021-07-30 rustup target add wasm32-unknown-unknown --toolchain nightly-2021-07-30 rustup toolchain list
node/Cargo.toml
Outdated
@@ -12,68 +12,70 @@ name = 'datahighway' | |||
targets = ['x86_64-unknown-linux-gnu'] | |||
|
|||
[build-dependencies] | |||
substrate-build-script-utils = '3.0.0' | |||
substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate', rev = 'dfe52f7de12a7e308c0bc3a25e211b9cc4d61871' } |
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.
Why are we using this specific version? Can we use polkadotv0.9.17
or monthly-2022-03
node/src/fixtures.rs
Outdated
use std::fs::File; | ||
use std::io::Read; | ||
use std::str::FromStr; | ||
// use hex::{FromHex, FromHexError}; |
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.
Please remove commented code
impl pallet_utility::Config for Runtime { | ||
type Event = Event; | ||
type Call = Call; | ||
type PalletsOrigin = OriginCaller; |
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.
indentation
runtime/src/lib.rs
Outdated
type GenesisElectionProvider = onchain::OnChainSequentialPhragmen<Self>; | ||
// Alternatively, use pallet_staking::UseNominatorsMap<Runtime> to just use the nominators map. | ||
// Note that the aforementioned does not scale to a very large number of nominators. | ||
type SortedListProvider = BagsList; |
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.
indentation
impl pallet_election_provider_multi_phase::Config for Runtime { | ||
type Event = Event; | ||
type Currency = Balances; | ||
type EstimateCallFee = TransactionPayment; |
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.
indentation
type SolutionImprovementThreshold = SolutionImprovementThreshold; | ||
type OffchainRepeat = OffchainRepeat; | ||
type MinerMaxWeight = MinerMaxWeight; | ||
type MinerMaxLength = MinerMaxLength; |
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.
indentation
type DataProvider = Staking; | ||
type Solution = NposSolution16; | ||
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>; | ||
type GovernanceFallback = |
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.
indentation
>; | ||
type WeightInfo = pallet_election_provider_multi_phase::weights::SubstrateWeight<Self>; | ||
type ForceOrigin = EnsureRootOrHalfCouncil; | ||
type BenchmarkingConfig = ElectionProviderBenchmarkConfig; |
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.
indentation
runtime/src/lib.rs
Outdated
type WeightInfo = pallet_election_provider_multi_phase::weights::SubstrateWeight<Self>; | ||
type ForceOrigin = EnsureRootOrHalfCouncil; | ||
type BenchmarkingConfig = ElectionProviderBenchmarkConfig; | ||
type VoterSnapshotPerBlock = ConstU32<VoterSnapshotPerBlockAsConst>; |
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.
indentation
…DHX so works with polkadot-launch export-genesis-state
A client is trying update new blocks on their local server of DataHighway mainnet at http://xxx:8585/blocks/head https://datahighway-dhx.github.io/substrate-api-sidecar/, but they are reporting the dhx.api HTTP status code is not 200-299 so they are experiencing delay and timeout like in this similar issue polkadot-js/api#3365 every few mins, so as a result users are not able to topup or withdraw in time. The said their node has both http and ws connections. This PR is an attempt to update to the latest version of Substrate (since it was last updated to an old Substrate 3 commit dated 10th Feb 2021) incase that helps resolve the issue. Then we'll do a forkless runtime upgrade on Harbour testnet and then DataHighway Westlake mainnet
Note: To debug this branch run the following:
Checklist
<DEPENDENCY_NAME> = { git = 'https://github.com/paritytech/substrate', rev = 'efd54879ecbf8aac41fe809d31c7215ea3101241', default-features = false }
but when i try to build with
cargo build --release
, it gives the following error:and if i replace the
rev
value with any more recent Substrate commit and try building it gives the same error.if i specify the dependencies the way it wants me to like
<DEPENDENCY_NAME> = { version = '4.0.0-dev' }
as shown here paritytech/substrate@efd5487#diff-8b507853b325d5137f0252305eeef561aaddec506b75027217df634a243d8875R23, then i can't target specific commits between Substrate commit efd54879ecbf8aac41fe809d31c7215ea3101241 (dated 11th July 2021) and the latest Substrate commit 3478e0f6b80bd43803d7b821d887527d86104a41 (dated 29th July 2021).how can i specify the Git commit number that i want it to build so I can target these most recent Substrate commits since 9th July 2021?
i tried updating all the dependencies to pre-release versions 4.0.0-dev, 5.0.0-dev, and 0.10.0-dev in this commit 23c6941, but when i run
cargo build --release
i get error:how do i locally test the prerelease versions (i.e. 4.0.0-dev, 5.0.0-dev, and 0.10.0-dev) of the dependencies?
is it possible to publish this pre-release at crates.io?
otherwise it doesn't seem possible to update to to a more recent version of Substrate than its commit deac6324a16fc4128b94a7b4c3826eebcb86917f (dated 9th July 2021)
See latest commit with the changes in branch 'luke/MMD-1309/update-substrate-3-4.0.0-dev'
Note: This is resolved, I think it just needed a
cargo clean
. If encounter similar problem consider https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html?highlight=patch.#the-patch-sectionspec_version
andimpl_version
for an on-chain runtime upgrade (sincePer convention: if the runtime behavior changes, increment spec_version and set impl_version to 0
(according to the docs)[N/A] - try adding finality-grandpa-warp-sync support to see if that fixes the delay/timeout (extra protocol layer of warp sync support sc-finality-grandpa-warp-sync) https://matrix.to/#/!XOxcnpiHXHhAjJfRFP:matrix.parity.io/$cowEgy-s4n7OORfgm6DosPWVZF4hlUzLBfL4oAqEBLY?via=matrix.parity.io&via=matrix.org&via=web3.foundation.
Note that it looks like in latest Substrate commits they are incorporating Grandpa Warp Sync for us (up to Warp Sync Part 1 in this commit paritytech/substrate@c093de5) **Waiting for Substrate commits to finish incorporating it).
This isn't applicable, since we have found that the delay is caused by something wrong with DataHighway that is deviating from Substrate Node Template, which doesn't experience the delay. See https://github.com/DataHighway-DHX/open-polkadot-js-library/tree/main/block-delay#update-datahighway
Update: These issues are resolved in that PR
Update: not necessary as crypto-mac 0.7 has been restored https://crates.io/crates/crypto-mac/versions
Update: see above update
snow
. paritytech/subport#232, we might overcome this issue if we merge feat: MMD-1309 / Update from Substrate 3 to latest commit 852bab073407b65b5e3e461baaa0541c4e0bc3d6 dated 31st Aug #223, which updates to latest Substrate commit.Note: this appears to have somehow been resolved...
Afterwards the built binary (built locally or on the server) should be copied and distributed to all validators and bootnodes so they have the latest non-runtime changes. Attach a copy to the Github releases as datahighway_runtime.compactv3.0.6.wasm (if latest version is 3.0.6)
the steps i taken were:
subkey inspect --network datahighway --scheme sr25519 "//Alice"
docker restart <DOCKER_CONTAINER_ID>
STATUS: Requested client to check if they experience the timeout issues with the updates we've made in this PR and deployed to Brickable
IMPORTANT NOTE: Feedback from Substrate Builders was that the timeout that we're experiencing with Babe might get smaller as more and more validators are added. So in future when we have more validators or we simulate that this is true then we might choose to switch back to using Babe instead of Aura.