Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Introduce polkadot code substitute #3093

Merged
3 commits merged into from
May 25, 2021
Merged

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented May 24, 2021

This introduces a code substitute for the on-chain wasm of Polkadot from
block
0x86aa36a140dfc449c30dbce16ce0fea33d5c3786766baa764e33f336841b9e29
on wards. The underlying problem was that there exists some
miscompilation by the rust compiler in the wasm runtime that results in
state mismatches between the native/wasm runtime of the
the 0.8.30 release. This resulted in blocks being authored by the native
runtime not being importable by nodes using the wasm runtime. The
on-chain wasm is replaced by a wasm build from the 0.8.30 using the
rustc nightly from 1.03.2021.

This introduces a code substitute for the on-chain wasm of Polkadot from
block
`0x86aa36a140dfc449c30dbce16ce0fea33d5c3786766baa764e33f336841b9e29`
on wards. The underlying problem was that there exists some
miscompilation by the rust compiler in the wasm runtime that results in
state mismatches between the native/wasm runtime of the
the 0.8.30 release. This resulted in blocks being authored by the native
runtime not being importable by nodes using the wasm runtime. The
on-chain wasm is replaced by a wasm build from the 0.8.30 using the
rustc nightly from 1.03.2021.
@xlc
Copy link
Contributor

xlc commented May 25, 2021

Any more details about this compiler bug? Just so we can avoid it as well.

@andresilva andresilva added this to the v0.9.3 milestone May 25, 2021
@andresilva
Copy link
Contributor

For posterity here's how the substitute wasm blob was built:

❯ docker run --rm -it -e PACKAGE=polkadot-runtime -v $PWD:/build -v $TMPDIR/cargo:/cargo-home chevdor/srtool:nightly-2021-03-01 build

✨ Your Substrate WASM Runtime is ready! ✨
Summary:
  Generator  : srtool v0.9.11
  Version    : 0.8.30
  GIT commit : 4b86755c3498a5336e32db20b2b65a50dc5a4cf4
  GIT tag    : v0.8.30
  GIT branch : HEAD
  Time       : 2021-05-25T13:38:02Z
  Rustc      : rustc 1.52.0-nightly (e37a13cc3 2021-02-28)
  Size       : 1982 KB (2030359 bytes)
  Content    : 0x0061736d010000000184033660037f7f...3363633320323032312d30322d323829
  Package    : polkadot-runtime
  Proposal   : 0xeaf2243a0aab80b93dea7a9fe9be12cd5c4dffa4ba92d7a141721ada1ba15958
  IPFS       : QmSTnhFhwy7A5THWjCaTsmw2KgktztSPFeHPreAqpSSdqF
  SHA256     : 0x3ac7cf7f85433baa54065c4e9f4a4180fa94a14760d1e814dedf3df5770943d1
  Wasm       : runtime/polkadot/target/srtool/release/wbuild/polkadot-runtime/polkadot_runtime.compact.wasm

It's built using the exact same code as is on-chain (i.e. v0.8.30 tag), but using rustc 1.52.0-nightly (e37a13cc3 2021-02-28) instead of rustc 1.52.0-nightly (d6eaea1c8 2021-03-14).

@ghost
Copy link

ghost commented May 25, 2021

Waiting for commit status.

@bkchr
Copy link
Member Author

bkchr commented May 25, 2021

Any more details about this compiler bug? Just so we can avoid it as well.

We don't know yet what the actual problem is.

@ghost ghost merged commit a3e5d6b into master May 25, 2021
@ghost ghost deleted the bkchr-wasm-substitute-companion branch May 25, 2021 14:39
s3krit pushed a commit that referenced this pull request May 25, 2021
* Introduce polkadot code substitute

This introduces a code substitute for the on-chain wasm of Polkadot from
block
`0x86aa36a140dfc449c30dbce16ce0fea33d5c3786766baa764e33f336841b9e29`
on wards. The underlying problem was that there exists some
miscompilation by the rust compiler in the wasm runtime that results in
state mismatches between the native/wasm runtime of the
the 0.8.30 release. This resulted in blocks being authored by the native
runtime not being importable by nodes using the wasm runtime. The
on-chain wasm is replaced by a wasm build from the 0.8.30 using the
rustc nightly from 1.03.2021.

* update the wasm substitute blob

* update Substrate

Co-authored-by: André Silva <andrerfosilva@gmail.com>
Co-authored-by: parity-processbot <>
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants