-
Notifications
You must be signed in to change notification settings - Fork 387
feat: optimize rpc calls #5394
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
feat: optimize rpc calls #5394
Changes from 10 commits
ad48778
1da63cc
68ecefb
04f6520
1ff4f75
095f4af
e3b1aa5
f8e3049
e6945ef
a9fd888
bed886c
acabf46
a1e3f83
bf4a030
54ee6af
ba08feb
2a11aa6
e4befcf
2e40f56
c7bd723
76a6e1d
ba744e9
a858f42
433f3ff
083da1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ func TestProofCorrectness(t *testing.T) { | |
| verifySegments := func(t *testing.T, exp []string, found [][]byte) { | ||
| t.Helper() | ||
|
|
||
| var expSegments [][]byte | ||
| expSegments := make([][]byte, 0, len(exp)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are fine but feel like they belong in a separate PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but linter was failing so I decided to fix everything. Next time will create separate PR |
||
| for _, v := range exp { | ||
| decoded, err := hex.DecodeString(v) | ||
| if err != nil { | ||
|
|
@@ -154,7 +154,7 @@ func TestProofCorrectness(t *testing.T) { | |
| "745bae095b6ff5416b4a351a167f731db6d6f5924f30cd88d48e74261795d27b", | ||
| } | ||
|
|
||
| var segments [][]byte | ||
| segments := make([][]byte, 0, len(segmentStrings)) | ||
| for _, v := range segmentStrings { | ||
| decoded, err := hex.DecodeString(v) | ||
| if err != nil { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,8 +220,8 @@ func TestEvictBatch(t *testing.T) { | |
| } | ||
| ctx := context.Background() | ||
|
|
||
| var chunks []swarm.Chunk | ||
| var chunksPerPO uint64 = 10 | ||
| chunks := make([]swarm.Chunk, 0, chunksPerPO*3) | ||
| batches := []*postage.Batch{postagetesting.MustNewBatch(), postagetesting.MustNewBatch(), postagetesting.MustNewBatch()} | ||
| evictBatch := batches[1] | ||
|
|
||
|
|
@@ -543,6 +543,7 @@ func TestSubscribeBin(t *testing.T) { | |
| chunksPerPO uint64 = 50 | ||
| putter = storer.ReservePutter() | ||
| ) | ||
| chunks = make([]swarm.Chunk, 0, chunksPerPO*2) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is a duplicate,there is already allocation on line 543
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's also why the linter is complaining |
||
|
|
||
| for j := range 2 { | ||
| for range chunksPerPO { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.