Skip to content
Open
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
6 changes: 1 addition & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ linters:
- ruleguard
disabled-checks:
- commentFormatting # disabled to avoid unnecessary friction on local lints and CI for minor whitespace changes without functional benefit
- uncheckedInlineErr
- preferStringWriter
- commentedOutCode
- preferFprint
- deprecatedComment
- commentedOutCode # disabled to avoid false positives on doc examples, EIP spec comments, and JSON templates
enabled-tags:
- performance
- diagnostic
Expand Down
1 change: 1 addition & 0 deletions cl/cltypes/solid/hashutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ func (arr *hashBuf) makeBuf(size int) {
}

// GetDepth returns the depth of a merkle tree with a given number of nodes.
//
// Deprecated: Use merkle_tree.GetDepth directly.
var GetDepth = merkle_tree.GetDepth
2 changes: 1 addition & 1 deletion cmd/capcli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ func (b *BenchmarkNode) Run(ctx *Context) error {
log.Warn("Failed to benchmark", "error", err, "uri", uri)
continue
}
_, err = f.WriteString(fmt.Sprintf("%d,%d\n", i, elapsed.Milliseconds()))
_, err = fmt.Fprintf(f, "%d,%d\n", i, elapsed.Milliseconds())
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/erigon/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func NewNodConfigUrfave(ctx *cli.Command, debugMux *http.ServeMux, logger log.Lo
}

nodeConfig := NewNodeConfig(debugMux)
if err := utils.SetNodeConfig(ctx, nodeConfig, logger); err != nil {
err := utils.SetNodeConfig(ctx, nodeConfig, logger)
if err != nil {
return nil, err
}
erigoncli.ApplyFlagsForNodeConfig(ctx, nodeConfig, logger)
Expand Down
4 changes: 2 additions & 2 deletions cmd/rpctest/rpctest/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func requestAndCompare(request string, methodName string, errCtx string, reqGen
// Keep going
} else {
reqFile, _ := os.Create("request.json") //nolint:errcheck
reqFile.Write([]byte(request)) //nolint:errcheck
reqFile.WriteString(request) //nolint:errcheck
reqFile.Close() //nolint:errcheck
erigonRespFile, _ := os.Create("erigon-response.json") //nolint:errcheck
erigonRespFile.Write(res.Response) //nolint:errcheck
Expand Down Expand Up @@ -395,7 +395,7 @@ func requestAndCompareErigon(requestA, requestB string, methodNameA, methodNameB
// Keep going
} else {
reqFile, _ := os.Create("request.json") //nolint:errcheck
reqFile.Write([]byte(requestA)) //nolint:errcheck
reqFile.WriteString(requestA) //nolint:errcheck
reqFile.Close() //nolint:errcheck
erigonRespFile, _ := os.Create("erigon-response.json") //nolint:errcheck
erigonRespFile.Write(res.Response) //nolint:errcheck
Expand Down
2 changes: 1 addition & 1 deletion db/state/commitment_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ func writeRestoreManifestAtomic(path string, entries []string) error {
if err != nil {
return err
}
if _, err := f.Write([]byte(strings.Join(entries, "\n"))); err != nil {
if _, err := f.WriteString(strings.Join(entries, "\n")); err != nil {
_ = f.Close()
return err
}
Expand Down
22 changes: 11 additions & 11 deletions execution/commitment/hex_patricia_hashed.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,36 +389,36 @@ func (cell *cell) reset() {
func (cell *cell) FullString() string {
b := new(strings.Builder)
b.WriteString("{")
b.WriteString(fmt.Sprintf("loaded=%v", cell.loaded))
fmt.Fprintf(b, "loaded=%v", cell.loaded)
if cell.Deleted() {
b.WriteString(" DELETED ")
}

if cell.accountAddrLen > 0 {
b.WriteString(fmt.Sprintf(" addr=%x", cell.accountAddr[:cell.accountAddrLen]))
b.WriteString(fmt.Sprintf(" balance=%s", cell.Balance.String()))
b.WriteString(fmt.Sprintf(" nonce=%d", cell.Nonce))
fmt.Fprintf(b, " addr=%x", cell.accountAddr[:cell.accountAddrLen])
fmt.Fprintf(b, " balance=%s", cell.Balance.String())
fmt.Fprintf(b, " nonce=%d", cell.Nonce)
if cell.CodeHash != empty.CodeHash {
b.WriteString(fmt.Sprintf(" codeHash=%x", cell.CodeHash[:]))
fmt.Fprintf(b, " codeHash=%x", cell.CodeHash[:])
} else {
b.WriteString(" codeHash=EMPTY")
}
}
if cell.storageAddrLen > 0 {
b.WriteString(fmt.Sprintf(" addr[s]=%x", cell.storageAddr[:cell.storageAddrLen]))
b.WriteString(fmt.Sprintf(" storage=%x", cell.Storage[:cell.StorageLen]))
fmt.Fprintf(b, " addr[s]=%x", cell.storageAddr[:cell.storageAddrLen])
fmt.Fprintf(b, " storage=%x", cell.Storage[:cell.StorageLen])
}
if cell.hashLen > 0 {
b.WriteString(fmt.Sprintf(" h=%x", cell.hash[:cell.hashLen]))
fmt.Fprintf(b, " h=%x", cell.hash[:cell.hashLen])
}
if cell.stateHashLen > 0 {
b.WriteString(fmt.Sprintf(" memHash=%x", cell.stateHash[:cell.stateHashLen]))
fmt.Fprintf(b, " memHash=%x", cell.stateHash[:cell.stateHashLen])
}
if cell.extLen > 0 {
b.WriteString(fmt.Sprintf(" extension=%x", cell.extension[:cell.extLen]))
fmt.Fprintf(b, " extension=%x", cell.extension[:cell.extLen])
}
if cell.hashedExtLen > 0 {
b.WriteString(fmt.Sprintf(" hashedExtension=%x", cell.hashedExtension[:cell.hashedExtLen]))
fmt.Fprintf(b, " hashedExtension=%x", cell.hashedExtension[:cell.hashedExtLen])
}

b.WriteString("}")
Expand Down
1 change: 1 addition & 0 deletions node/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func BuildEthConfig(nodeCtx context.Context, ctx *cli.Command, nodeCfg *nodecfg.
}

// ApplyFlagsForEthConfig is kept for backward compatibility. New code should use BuildEthConfig.
//
// Deprecated: use BuildEthConfig instead.
func ApplyFlagsForEthConfig(ctx *cli.Command, cfg *ethconfig.Config, logger log.Logger) {
applyRemainingEthFlags(ctx, cfg, logger)
Expand Down
1 change: 1 addition & 0 deletions p2p/enode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ func (n *Node) Record() *enr.Record {
}

// ValidateComplete checks whether n has a valid IP and UDP port.
//
// Deprecated: don't use this method.
func (n *Node) ValidateComplete() error {
if !n.ip.IsValid() {
Expand Down
2 changes: 2 additions & 0 deletions rpc/jsonrpc/eth_deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ import (
)

// Accounts implements eth_accounts. Returns a list of addresses owned by the client.
//
// Deprecated: This function will be removed in the future.
func (api *APIImpl) Accounts(ctx context.Context) ([]common.Address, error) {
return []common.Address{}, fmt.Errorf(NotAvailableDeprecated, "eth_accounts")
}

// Sign implements eth_sign. Calculates an Ethereum specific signature with: sign(keccak256('\\x19Ethereum Signed Message:\\n' + len(message) + message))).
//
// Deprecated: This function will be removed in the future.
func (api *APIImpl) Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error) {
return hexutil.Bytes(""), fmt.Errorf(NotAvailableDeprecated, "eth_sign")
Expand Down
1 change: 1 addition & 0 deletions rpc/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func (n *RemoteNotifier) Notify(id ID, data any) error {
}

// Closed returns a channel that is closed when the RPC connection is closed.
//
// Deprecated: use subscription error channel
func (n *RemoteNotifier) Closed() <-chan any {
return n.h.conn.closed()
Expand Down
Loading