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

Extended debug #451

Merged
merged 13 commits into from
Nov 19, 2020
Merged

Extended debug #451

merged 13 commits into from
Nov 19, 2020

Conversation

m4ksio
Copy link
Contributor

@m4ksio m4ksio commented Nov 12, 2020

Part of changes to support dapperlabs/flow-go#1291

It's not the most elegant solution, but I assume this code is temporary anyway.
It supports returning extended information on case of execution errors so they can be recorded by the caller - currently if TopShot contract fails.
It was started from v0.9.2 branch as it was the latest one we use in Flow-go - I plan to update this PR accordingly once more mature version of Cadence is used in Flow-go

@turbolent
Copy link
Member

@m4ksio is this supposed to be released in the v0.9 release line? Why/how are the first three commits by me part of this?

runtime/runtime_test.go Outdated Show resolved Hide resolved

// ExtendedParsingCheckingError is a special error which aids in debugging checking problems
// by providing extra information about the state of the environment
// Separate package to prevent cyclic imports with checker tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure I understand this line, can you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime/errors.go Outdated Show resolved Hide resolved
@m4ksio
Copy link
Contributor Author

m4ksio commented Nov 16, 2020

@m4ksio is this supposed to be released in the v0.9 release line? Why/how are the first three commits by me part of this?

I branched off v0.9.2 tag, as this is what current flow-go repo is using, to minimize changes. I would assume some commits from this tag are not part of master, hence they show up here.

@turbolent
Copy link
Member

@m4ksio Can you please create a v0.9.3 branch and target this PR against it?

@m4ksio m4ksio changed the base branch from master to v0.9.3 November 17, 2020 01:07
Comment on lines 226 to 227
RuntimeStorage *InterpreterRuntimeStorage
Functions stdlib.StandardLibraryFunctions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these used for debugging? The fields in interpreterRuntimeStorage are also not exported, so is exposing the storage here (and exporting interpreterRuntimeStorage as InterpreterRuntimeStorage below) useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these used for debugging?

They are dumped to a file for further usage. I didn't analyze what was particularly useful, just grabbed all there is

Copy link
Member

@turbolent turbolent Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the runtime storage value doesn't provide any info, OK if I remove it?
Or we should maybe export the storage's cache, which could be useful to look at for execution errors.

Also, the functions that are injected are always the same, so IDK how useful it it is to include them in the error.

Copy link
Contributor Author

@m4ksio m4ksio Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the runtime storage value doesn't provide any info, OK if I remove it?

Feel free if you think it doesn't provide any value, and add what you think it's best - you are the best person to know what internal elements might be helpful

runtime/runtime.go Outdated Show resolved Hide resolved
@turbolent
Copy link
Member

@m4ksio Pushed some improvements, feel free to convert the draft into a proper PR

@turbolent turbolent marked this pull request as ready for review November 18, 2020 23:59
@turbolent
Copy link
Member

@m4ksio What does the linked issue (1291) refer to? The issue in dapperlabs/flow-go seems unrelated

@turbolent turbolent merged commit fa235a9 into v0.9.3 Nov 19, 2020
@turbolent turbolent deleted the m4ksio/extended-debug branch November 19, 2020 00:03
@turbolent turbolent restored the m4ksio/extended-debug branch November 19, 2020 00:03
@turbolent turbolent mentioned this pull request Nov 19, 2020
@m4ksio
Copy link
Contributor Author

m4ksio commented Nov 19, 2020

@m4ksio What does the linked issue (1291) refer to? The issue in dapperlabs/flow-go seems unrelated

https://github.com/dapperlabs/flow-internal/issues/1291

This was referenced Nov 19, 2020
@turbolent turbolent deleted the m4ksio/extended-debug branch May 18, 2021 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants