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

fixed passing of raw byte slices to tx processing #4782

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

awskii
Copy link
Member

@awskii awskii commented Jul 21, 2022

fix for #4688

Inuse space at goerli during stage 6/16
profile001

pprof data before patch were similar to #4688 (comment)

Another interesting thing: recently were updated core.ExecuteBlockEphemerally. Is that correct that it's called during syncing?

@@ -14,8 +14,8 @@ const MaxBodiesInRequest = 1024

type Delivery struct {
peerID [64]byte
txs [][][]byte
uncles [][]*types.Header
txs *[][][]byte
Copy link
Collaborator

Choose a reason for hiding this comment

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

[] - it’t a pointer-type (already no copy). Why this PR works?

Copy link
Member Author

Choose a reason for hiding this comment

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

my guess is that helps GC to understand when txs become useless: in it's origin tx become useless right after sending through channel and on the other side of channel pointer to tx becomes useless when for is over. At this point gc could safely mark and then sweep them.

since [][]byte copied to txs are slices allocated by Raw and GC didn't know when they become useless -> Raw leaked.

@AskAlexSharov
Copy link
Collaborator

core.ExecuteBlockEphemerally It’s part of StageExecution

Copy link
Collaborator

@AskAlexSharov AskAlexSharov left a comment

Choose a reason for hiding this comment

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

Then need add comment about it to codd

@AskAlexSharov AskAlexSharov merged commit a1777ac into devel Jul 22, 2022
@AskAlexSharov AskAlexSharov deleted the fix/stream-bodiesraw-leak branch July 22, 2022 08:47
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