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
Update Metadata Documentation #14052
Conversation
Thank you for your contribution to the Solidity compiler! A team member will follow up shortly. If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother. If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix. |
docs/metadata.rst
Outdated
// Required for Solidity. | ||
"evmVersion": "london" |
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.
Not sure if this is Required but I believe so. Where can I find the schema of the metadata or a validation for that?
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.
I have no idea, but the best I can do is the parser/validator used in our tests, which would lead me to believe that evmVersion
is in fact a mandatory field.
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.
The JSON is malformed due to missing commas (,
) in certain places - I think I caught all of them, but I'd still suggest running the entire object through something like jq
just to make sure.
Otherwise, looks good. Fix and squash, and it should be good to merge.
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.
Looks good. Please squash the commits before merging.
Added "appends to runtime bytecode" explicitly as it is not necessarily found at the end of the creation bytecode. I find it useful to break down the contents of the metadata when explaining into two:
Changed the first paragraph to this to quickly give an overview of the purpose of the file as well as its contents |
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.
Squash the commits please.
Sorry I thought this was meant for the person merging to click "Squash and merge" in the PR. Do I need to squash, i.e. rebase and force-push everything into one commit? |
Yes, but now that you mention it, let me check how the |
@kuzdogan yeah, it seems like it's a configurable feature, and I have no idea how we have it configured, so please rebase, squash into one commit, and force push, and I'll merge it. |
Squashed into single commit Squashed commits: Sort metadata JSON, add errors to devdoc & userdoc Sorts the example metadata in the alphabetical order, as this is the way output by the compiler. Add playground.sourcify.dev link Update metadata documentation content Fix trailing whitespaces Add new line after code-block Fix unexpected indentation Fix unexpected unindent Fix unexpected unindent - 2 Suggestions from code review: wording, punctuation Co-authored-by: Nikola Matić <nikola.matic@ethereum.org> Fix missing trailing commas Co-authored-by: Nikola Matić <nikola.matic@ethereum.org> Order yul settings, fix trailing commas Explicitly state appended to the runtime bytecode Break down metadata content into two points Remove trailing whitespace
Update the example metadata JSON to follow the alphabetically ordered canonical format. Also add the
"errors"
field indevdoc
anduserdoc
.Shorten the CBOR encoding part and add a link to https://playground.sourcify.dev
0xa264
as well as mentioning multiple times not to use this pattern. It's better to not mention this pattern at all and to explain the correct way to decode.Update the explanation for the Source Code Verification section