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

Fix capacity for immediate appends #10539

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/snapshots/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import (
"strings"
"time"

"github.com/urfave/cli/v2"

"github.com/ledgerwatch/erigon-lib/downloader"
"github.com/ledgerwatch/erigon-lib/downloader/snaptype"
"github.com/ledgerwatch/erigon/cmd/snapshots/sync"
"github.com/ledgerwatch/erigon/cmd/utils"
"github.com/ledgerwatch/erigon/turbo/logging"
"github.com/urfave/cli/v2"
)

var (
Expand Down Expand Up @@ -286,7 +287,7 @@ func verifyManifest(ctx context.Context, srcSession *downloader.RCloneSession, v
var extra string

if len(manifestFiles) != 0 {
files := make([]string, len(manifestFiles))
files := make([]string, 0, len(manifestFiles))

for file := range manifestFiles {
files = append(files, file)
Expand All @@ -296,7 +297,7 @@ func verifyManifest(ctx context.Context, srcSession *downloader.RCloneSession, v
}

if len(dirFiles) != 0 {
files := make([]string, len(dirFiles))
files := make([]string, 0, len(dirFiles))

for file := range dirFiles {
files = append(files, file)
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func logReceipts(receipts types.Receipts, txns types.Transactions, cc *chain.Con
return
}

marshalled := make([]map[string]interface{}, len(receipts))
marshalled := make([]map[string]interface{}, 0, len(receipts))
for i, receipt := range receipts {
txn := txns[i]
marshalled = append(marshalled, ethutils.MarshalReceipt(receipt, txn, cc, header, txn.Hash(), true))
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func writeLogsList(w http.ResponseWriter, dirPath string) {
Size int64 `json:"size"`
}

files := make([]file, len(infos))
files := make([]file, 0, len(infos))

for _, fileInfo := range infos {
files = append(files, file{Name: fileInfo.Name(), Size: fileInfo.Size()})
Expand Down
Loading