-
Notifications
You must be signed in to change notification settings - Fork 312
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
Nimbus 0.9 and Sign blocks in dev service #958
Conversation
I think the PR is a nice addition. Does this mean we can now write integration tets in the dev service for the slot prediction? |
I'm afraid they might not approve a modification that is so Moonbeam specific. That being said, isn't this change just a change in the Block type returned, that should be detected by the api, and thus not require any modification? |
@joelamouche The change on the UI side is about how we extract the block author. We already have nimbus-specific code there and this change makes it less of a special unicorn, and more like Aura and Babe. Here is the change in the consensus engine that needs to be reflected. https://github.com/PureStake/nimbus/pull/15/files#r744993190 |
@JoshOrndorff Sounds good. Im creating a ticket for that |
Doesn't compile yet
This is all updated with
|
@JoshOrndorff I created a JIRA ticket for this (I can assist) |
I've tested this manually, and both the client and runtime portions of the upgrade succeeded as expected! I even recorded it in case we struggle to reproduce it https://www.twitch.tv/videos/1232376769 I'll get the unit tests cleaned up soon. |
…other two)" This reverts commit 63db42b.
For some reason, this PR makes the dev service take significantly longer to start up. Nonetheless, our authorship task will still start quickly. This results in logs like the following:
You can see that the authorship tries and fails to author blocks before the development service is ready. Once it is ready, the node begins behaving normally. I don't know whether this try-to-author-even-before-ready behavior existed previously because the node startup was too fast to tell previously. |
@girazoki helped me find the problem. wasmtime, the web assembly compiler, takes a very long time to compile the wasm runtime. The underlying issue is very likely bytecodealliance/wasmtime#3523 I've confirmed this hypothesis in two ways:
The fix is very likely to be putting My first idea is to see if the nimbus template has the same issue, and if so, figure out at which commit it started. |
The dev service works just fine, with normal authorship starting almost immediately when I use the moonriver or moonbeam runtimes. It is only moonbase that has the problem. # This command with the moonriver runtime works as expected
moonbeam --chain moonriver-dev --alice --tmp --sealing 1000
# But this one with the moonbase runtime takes a while at startup
moonbeam --chain moonbase-dev --alice --tmp --sealing 1000 But the wasmtime-try output indicates that both runtimes are taking far too long to compile
|
This did not fix anything for me locally, but we'll let CI try it too.
… the past." This reverts commit 34c12cd.
The majority of the TS tests are fixed in 608b273 which brings in a hotfix to Substrate's manual seal. This change has been PRed upstream: paritytech/substrate#10498 |
What does it do?
Solves https://purestake.atlassian.net/browse/MOON-557
Companion for moonbeam-foundation/nimbus#15
Companion for moonbeam-foundation/nimbus#21
This PR updates Nimbus from roughly 0.8 to 0.9. This includes two breaking changes which are both described in detail in their upstream PRs linked above. Briefly, they are:
Changes to the Dev service
This PR updates the dev service to use the new
NimbusManualSealConsensusDataProvider
. This means that it performs proper slot prediction and block signing using the keystore even without a backing relay chain. Previously the dev service did not sign blocks, check signatures, do slot prediction, or even use the keys in the keystore at all. Previously the dev service just inserted Alice's author id, and everyone trusted it.Is there something left for follow-up PRs?
This PR changes the moonbeam runtime to accept block author information through a new pre-runtime digest. This change was necessary to meet the assumptions of manual seal which uses the new pre-runtime digest. It also makes Nimbus more similar to Aura and Babe.
@joelamouche This will require a minor update to Polkadot JS to detect the author information properly in the dev service. The dev service will now use a pre-runtime digest rather than a consensus
What value does it bring to users
Anything that happens in the dev service naturally has better test coverage both because of CI and because we use the dev service a lot when testing PRs and runtime upgrades. This adds slot prediction to the dev service. That allows us to test slot prediction much more easily including for runtime upgrades.