solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Add `--no-append-metadata` in CLI and `metadata.append` in JSON

Open hrkrshnn opened this issue 3 years ago • 6 comments

Skips appending metadata to the binary

Closes https://github.com/ethereum/solidity/issues/13233

hrkrshnn avatar Jul 11 '22 22:07 hrkrshnn

Missing tests.

leonardoalt avatar Jul 12 '22 09:07 leonardoalt

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.

cameel avatar Aug 05 '22 13:08 cameel

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.

ekpyron avatar Aug 12 '22 12:08 ekpyron

ping @hrkrshnn

leonardoalt avatar Aug 30 '22 10:08 leonardoalt

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.

ekpyron avatar Sep 05 '22 18:09 ekpyron

Fixed the last pending comment.

hrkrshnn avatar Sep 17 '22 21:09 hrkrshnn

so does this still need changes before merging?

leonardoalt avatar Sep 22 '22 14:09 leonardoalt

so does this still need changes before merging?

@leonardoalt I don't think so. I think I addressed all pending comments.

hrkrshnn avatar Sep 23 '22 14:09 hrkrshnn

Looks like it needs a rebase on develop. I think we fixed the euler problem already.

cameel avatar Sep 26 '22 17:09 cameel

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");

hrkrshnn avatar Sep 26 '22 18:09 hrkrshnn