Skip to content

Conversation

ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Feb 19, 2025

Why this should be merged

Adds logging of libevm modification of default behaviour.

How this works

  1. Introduces log.Lazy functions to allow expensive logging operations to be computed i.f.f. required by the logging level.
  2. Adds Info logging for registration of types and Debug logging for all else.
  3. Only paths that change behaviour in a potentially unpredictable manner are logged; of note, RLP / JSON encoding is not considered unpredictable given that registered extras are logged.
  4. The minimal viable package, set, was necessary because we don't want to depend on avalanchego and the hashicorp/go-set latest version requires a later version of Go. refactor: use hashicorp/go-set when on Go 1.23+ #153 tracks a swap to the latter when possible.

The eth/tracers/internal/tracetest test flaked at least twice (unrelated to these changes) so I've marked it as such since it's not worth a separate PR.

How this was tested

New unit test on log.Lazy + set methods. Existing CI for the rest as it's a refactor.

defer func() {
active = rules.Hooks().ActivePrecompiles(append([]common.Address{}, active...))
}()
func activePrecompiles(rules params.Rules) []common.Address {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other than not being exported, this is now identical to the geth@v1.13.14 implementation.

@ARR4N ARR4N marked this pull request as ready for review February 24, 2025 13:26
@ARR4N ARR4N requested a review from a team February 24, 2025 13:26
@ARR4N ARR4N enabled auto-merge (squash) February 24, 2025 16:48
@ARR4N ARR4N merged commit 02110d3 into main Feb 24, 2025
11 checks passed
@ARR4N ARR4N deleted the arr4n/logging branch February 24, 2025 16:53
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.

2 participants