Skip to content

internal/cli: add block tracing#397

Merged
manav2401 merged 25 commits into
v0.3.0-devfrom
POS-122/debug-profiler
Jun 6, 2022
Merged

internal/cli: add block tracing#397
manav2401 merged 25 commits into
v0.3.0-devfrom
POS-122/debug-profiler

Conversation

@manav2401

@manav2401 manav2401 commented May 12, 2022

Copy link
Copy Markdown
Member

This PR adds a new command to print a JSON output of the trace of a block (by number, tag, hash or bad block hash).

A helper utility which can create and destroy a mock server is added. This will abstract the port handling (primarily for the grpc server, http server and any other if added in future) from the tests.

@linear

linear Bot commented May 12, 2022

Copy link
Copy Markdown
POS-122 Bad block debug profiler

https://www.notion.so/polygontechnology/RFC-22-c70aa1e47d4e497fa6e17e0beb93d7d5

We have many situations on the execution of Bor when a "bad block" happens. This is when there is an internal error and Bor is not able to process a valid block. The only option at that point is to rewind the blockchain but even that does not guarantee that the issue is solved.

#298

@codecov-commenter

codecov-commenter commented May 12, 2022

Copy link
Copy Markdown

Codecov Report

Merging #397 (29b79bd) into v0.3.0-dev (2323f2c) will increase coverage by 0.55%.
The diff coverage is 18.18%.

@@              Coverage Diff               @@
##           v0.3.0-dev     #397      +/-   ##
==============================================
+ Coverage       55.74%   56.30%   +0.55%     
==============================================
  Files             601      597       -4     
  Lines           69602    69111     -491     
==============================================
+ Hits            38803    38914     +111     
+ Misses          27447    26838     -609     
- Partials         3352     3359       +7     
Impacted Files Coverage Δ
consensus/bor/api.go 0.00% <0.00%> (ø)
consensus/bor/bor.go 6.20% <0.00%> (-0.03%) ⬇️
consensus/bor/clerk.go 0.00% <ø> (ø)
consensus/bor/genesis_contracts_client.go 0.00% <ø> (ø)
consensus/bor/merkle.go 0.00% <0.00%> (ø)
consensus/bor/rest.go 0.00% <0.00%> (ø)
consensus/bor/snapshot.go 14.28% <0.00%> (+0.45%) ⬆️
consensus/bor/validator.go 13.79% <ø> (ø)
eth/tracers/api_bor.go 0.00% <0.00%> (ø)
internal/cli/account.go 0.00% <ø> (ø)
... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96228cc...29b79bd. Read the comment docs.

Comment thread eth/tracers/api_bor.go Outdated
Comment thread eth/tracers/api_bor.go
Comment thread internal/cli/server/service.go Outdated
Comment thread internal/cli/server/service.go Outdated
@manav2401 manav2401 requested a review from ferranbt June 1, 2022 14:37
Comment thread eth/tracers/api_bor.go
Comment thread eth/tracers/api_bor.go
Comment thread internal/cli/server/proto/server_grpc.pb.go
Comment thread eth/tracers/api_bor.go Outdated

@cffls cffls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@manav2401 manav2401 merged commit 0d2b1d0 into v0.3.0-dev Jun 6, 2022
@manav2401 manav2401 deleted the POS-122/debug-profiler branch June 6, 2022 09:24
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.

5 participants