Judging by the code, event arguments that are not byte arrays are packed twice. 2nd packing rewrites the 1st packing. This adds complexity and affects gas consumption.
Related to https://github.com/ethereum/vyper/issues/730
@denis-bogdanas there is a specific reason though. We have two sections that need to be potentially packed. One Handles static part of the logging format, the next section packs the dynamic part ( for example if it's a bytearray).
https://solidity.readthedocs.io/en/develop/abi-spec.html#use-of-dynamic-types
Yes I know that. You only need to compute the size of static part in the first run, not to actually pack it. And it would be cleaner to just re-use the code for packing method parameters. The format is the same, and code for methods doesn't pack twice.
Thanks again for all the bugs vyper-semantics picks up ! :smile_cat:
Most helpful comment
Yes I know that. You only need to compute the size of static part in the first run, not to actually pack it. And it would be cleaner to just re-use the code for packing method parameters. The format is the same, and code for methods doesn't pack twice.