Skip to content
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

Babe fetch epoch returns a complete epoch #646

Merged
merged 6 commits into from
May 11, 2021

Conversation

expenses
Copy link
Contributor

This is to add the changes for paritytech/substrate#8072. I've tested it on a development substrate node and it works there, but on flaming fir I kept getting Err(BabeFetchEpoch(WasmStart(VirtualMachine(FunctionNotFound), HostVmPrototype))), despite the chain being fully synced. I'm unsure whether that was caused by this change or not.

@expenses expenses requested a review from tomaka March 11, 2021 15:23
@tomaka
Copy link
Contributor

tomaka commented Mar 11, 2021

Oh I didn't realize that you changed the output of the runtime function.

@expenses expenses requested a review from tomaka March 11, 2021 16:22
@tomaka
Copy link
Contributor

tomaka commented Mar 11, 2021

Just so you're aware: this will break GrandPa warp sync until we do a runtime upgrade?

@expenses
Copy link
Contributor Author

I'm aware, I suggest we only merge after a runtime upgrade.

@expenses
Copy link
Contributor Author

Polkadot has been updated so I think we can merge this right?

@expenses
Copy link
Contributor Author

Ah, sample_decode in `babe_fetch_epoch failed. We should either remove this test or update the data.

@tomaka
Copy link
Contributor

tomaka commented Apr 12, 2021

Only Westend has been updated. Polkadot and Kusama haven't.

Fortunately, since we (erroneously?) use decode instead of decode_all to decode the runtime output, the code in the main branch is still working with Westend, so there is no urgency to merge this.

@expenses
Copy link
Contributor Author

Ah, okay.

@tomaka
Copy link
Contributor

tomaka commented May 3, 2021

This is now ok to merge.

@tomaka
Copy link
Contributor

tomaka commented May 11, 2021

So this unfortunately breaks GrandPa warp sync on Westend because the config has changed to VRF and we still receive headers with plain slot claims.

Asked André.

@tomaka
Copy link
Contributor

tomaka commented May 11, 2021

So the story goes like this:

  • A PR was made to Westend to change the type of slot from plain to VRF, but this unfortunately only changed the config that would be used to initially populate the genesis block, so it had no effect.
  • When we implemented the Babe_epochConfig runtime API, the VRF enum was used (since that's what was written in the code), while in reality Westend continued using plain slots.

@tomaka
Copy link
Contributor

tomaka commented May 11, 2021

André changed the config with a sudo call in block 5,567,609. It's working again.

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label May 11, 2021
@mergify mergify bot merged commit 775457b into main May 11, 2021
@mergify mergify bot deleted the ashley-standalone-babe-fetch-epoch branch May 11, 2021 14:10
tomaka added a commit to tomaka/substrate-lite-1 that referenced this pull request May 17, 2021
* Babe fetch epoch returns a complete epoch

* Update src/sync/grandpa_warp_sync.rs

Co-authored-by: Pierre Krieger <[email protected]>

* Use decode_all and update test

Co-authored-by: Pierre Krieger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants