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

Updates scale metadata after adding beacon pallet. #656

Closed
wants to merge 1 commit into from

Conversation

claravanstaden
Copy link
Contributor

The metadata.scale file should be updated after adding the beacon client.

@claravanstaden claravanstaden marked this pull request as ready for review July 7, 2022 14:37
@vgeddes vgeddes self-requested a review July 8, 2022 10:36
@vgeddes
Copy link
Collaborator

vgeddes commented Jul 8, 2022

Could you also add a note to the parachain readme about how to how to update the metadata.

I'm assuming you're using the steps at https://github.com/paritytech/subxt#downloading-metadata-from-a-substrate-node for fetching the new metadata?

@claravanstaden
Copy link
Contributor Author

@vgeddes I used these steps that @alistair-singh provided:

run start-services.sh to start up the parachain.
then run the following in the parachain sub folder
curl http://localhost:8081/ \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{ "id": 1, "jsonrpc": "2.0", "method": "state_getMetadata", "params": [] }' | jq -r .result | xxd -r -p - > tools/query-events/metadata.scale
Do a git status and make sure the metadata.scale file has been updated.
Stop the parachain and re-launch with start-services.sh and then run tests.

I will try the subxt way too and update the readme. I'll do that in a separate PR because it may not be necessary to update the metadata. Alistair did a clean build with the metadata in main and it worked fine. I will try the same later, just want to finish off the E2E tests first since a clean build takes some time.

@alistair-singh
Copy link
Contributor

alistair-singh commented Jul 8, 2022

I think this could related to the type name issue we saw earlier. Where on some machines the type name has extra bytes. paritytech/subxt#591

I closed the above issue because Parity opened up another issue to remove type name from the hash check. I believe this will fix our issues. paritytech/subxt#595

But also in previous PRs we did change metadata. I have diffed the generated rust code between this commit and main and the generated code has changed. I believe this is because the beacon types were moved to a snowbridge-beacon-primitives crate.

On my machine main builds and tests pass with the old (checked in) metadata even with the latest changes to beacon. So I am at a little bit of a loss here as to whether we need to commit this or not. Maybe other members of the team need to try build main and see if this issue pops up and if the metadata needs to be updated.

@claravanstaden
Copy link
Contributor Author

Maybe other members of the team need to try build main and see if this issue pops up and if the metadata needs to be updated.

I will try this this afternoon. 👍

@vgeddes
Copy link
Collaborator

vgeddes commented Jul 8, 2022

I will try the subxt way too and update the readme. I'll do that in a separate PR because it may not be necessary to update the metadata. Alistair did a clean build with the metadata in main and it worked fine. I will try the same later, just want to finish off the E2E tests first since a clean build takes some time.

Ok, cool. sounds fine if that works better for you 👍

@claravanstaden
Copy link
Contributor Author

I did a clean build from main with no issues so the updated scale metadata isn't necessarily. I will still update the readme.

@claravanstaden claravanstaden deleted the clara/update-scale-metadata branch July 11, 2022 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants