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

Better logging #105

Open
kmbarry1 opened this issue Feb 19, 2020 · 1 comment
Open

Better logging #105

kmbarry1 opened this issue Feb 19, 2020 · 1 comment

Comments

@kmbarry1
Copy link
Contributor

The note modifier often leaves something to be desired--for example, sometimes the most interesting and/or useful information to log is an updated storage value, not the function arguments. Other times, an event might be more user-friendly if certain logged values were not indexed (or vice-versa)...note has no way to specify which argument values should or should not be logged. Finally, note logs a fixed number of arguments and a fixed amount of calldata, but obviously this one-size-fits-all solution will generally be suboptimal.

An example: it would be nice if the event for Pot.drip() logged the latest chi value; c.f. the Tweet below.
https://twitter.com/LefterisJP/status/1230168954590695425

More generally, it would be nice to replace (or augment) note with custom events.

@ehildenb
Copy link

ehildenb commented Mar 6, 2020

Custom events sounds nice in some cases, but I would still argue for having the log of called functions. IMO every function should be noted, and any extra data that could be interesting should be logged separately.

I don't know what the gas costs of this would be, but having a log of all called functions is really nice for understanding what's going on. Perhaps if it was possible to say "only note this if it's a top-level transaction, not an internal call", then we could have the same effect without incurring huge gas costs (eg. when End . cage is called, only End . cage is noted, but not Pot . cage, which is an internal call).

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

No branches or pull requests

2 participants