Add `--no-append-metadata` in CLI and `metadata.append` in JSON
Skips appending metadata to the binary
Closes https://github.com/ethereum/solidity/issues/13233
Missing tests.
I see that tests are now fixed (apart from zeppelin - is this just not rebased or did it break again?). So apart from trivial things the big question for me here is if we could have a better way to refer to this metadata blob than just "metadata", which is ambiguous.
Well, we said we wouldn't stall this longer than today due to naming and there wasn't that much more enlightening discussion on it... https://github.com/ethereum/solidity/pull/13265/files#r940130991 needs to be addressed in any case.
As for naming our thinking so far was that in standard-json settings.metadata.bytecodeHash is a misnomer anyways, so we want to change that in a breaking release (accepting that it'll cause translation complexity in solc-js) - and in the process of that move the new option as well. Ideally we'd want a clear separation in the settings (and in terminology in general) between those referring to the json metadata file and those referring to the cbor encoded metadata in the bytecode.
ping @hrkrshnn
For the record, this briefly came up in our meeting again today, and @chriseth mentioned that Sourceify calls the cbor metadata in the bytecode "aux data" these days, which is aligned with how we refer to it in Yul objects.
If we go down that road, we'd ideally have to refer to it like that everywhere, though.
Since metadata.bytecodeHash already exists anyways and doesn't align with that either, we might as well merge this as is, though, and then do a proper renaming of all of it in 0.9.
Fixed the last pending comment.
so does this still need changes before merging?
so does this still need changes before merging?
@leonardoalt I don't think so. I think I addressed all pending comments.
Looks like it needs a rebase on develop. I think we fixed the euler problem already.
Just rebased. Edit: tests are failing now :( Will fix.
Fixed: this is the fix
- return formatFatalError("JSONError", "\"settings.metadata.appendCBOR\" must be Boolean");
+ return formatFatalError(Error::Type::JSONError, "\"settings.metadata.appendCBOR\" must be Boolean");