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

Trigger OperationTracer on contexts enter & exit #5756

Merged
merged 24 commits into from
Aug 23, 2023
Merged

Trigger OperationTracer on contexts enter & exit #5756

merged 24 commits into from
Aug 23, 2023

Conversation

delehef
Copy link
Contributor

@delehef delehef commented Aug 7, 2023

PR description

Extends the OperationTracer interface to be triggered on contexts enter & exit.

@daniellehrner @shemnon

Fixed Issue(s)

Fixes #5728

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I thought about the changelog and included a changelog update if required.
  • If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests

delehef added 3 commits August 8, 2023 00:32
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
@delehef delehef requested a review from daniellehrner August 9, 2023 11:02
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Copy link
Contributor

@shemnon shemnon left a comment

Choose a reason for hiding this comment

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

This change needs tests. Either directly such as how ExtendedOperationTracerTest tested the code or indirectly like how traceEndTransaction is integrated into the testing of the T8nExecutor.

If we are mimicing Geth's behavior on their tracer some of their samples should provide the skeleton for how to test it is working as intended.

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
@delehef delehef requested a review from shemnon August 10, 2023 15:10
daniellehrner and others added 12 commits August 21, 2023 16:28
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
@shemnon
Copy link
Contributor

shemnon commented Aug 21, 2023

I was hoping for a test more like

, where there are no mocks. A custom tracer that outputs the tracing results into a data structure or text would then be verified.

With mocks-only testing I just don't feel it proves that it's not behaving in surprising ways.

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
…niellehrner/besu into feat/issue-5728/trace-context-changes
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
@daniellehrner
Copy link
Contributor

@shemnon I added another test without mocks, based on EIP-3155. Could you please review again?

@daniellehrner daniellehrner enabled auto-merge (squash) August 23, 2023 21:24
@daniellehrner daniellehrner merged commit 4ecfbb2 into hyperledger:main Aug 23, 2023
*
* @param frame the frame
*/
default void traceContextExit(final MessageFrame frame) {}

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'frame' is never used.
*
* @param frame the frame
*/
default void traceContextEnter(final MessageFrame frame) {}

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'frame' is never used.
garyschulte pushed a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* added a test without mocking

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fixed unit tests

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

---------

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Daniel Lehrner <daniel.lehrner@consensys.net>
garyschulte pushed a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* added a test without mocking

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fixed unit tests

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

---------

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Daniel Lehrner <daniel.lehrner@consensys.net>
garyschulte pushed a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* added a test without mocking

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fixed unit tests

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

---------

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: garyschulte <garyschulte@gmail.com>
@delehef delehef deleted the feat/issue-5728/trace-context-changes branch September 1, 2023 09:20
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* added a test without mocking

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fixed unit tests

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

---------

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Daniel Lehrner <daniel.lehrner@consensys.net>
NickSneo pushed a commit to NickSneo/besu that referenced this pull request Nov 12, 2023
* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* Trigger `OperationTracer` on contexts enter & exit

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Update CHANGELOG.md

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Spotless

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Daniel's comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Ensure `OperationTracer` is not null before calling it

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Move back hook calls into `process`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* Fix @shemnon comments

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>

* added test for context enter and context exit

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* spotless

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* added a test without mocking

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

* fixed unit tests

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

---------

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Daniel Lehrner <daniel.lehrner@consensys.net>
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

Successfully merging this pull request may close these issues.

Trace context changes in the EVM
4 participants