mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-29 16:13:47 +00:00
Merge branch 'ethereum:master' into portal
This commit is contained in:
commit
a66e1aa6a0
4 changed files with 10 additions and 10 deletions
|
|
@ -95,7 +95,7 @@ func NewFilterSystem(backend Backend, config Config) *FilterSystem {
|
|||
|
||||
type logCacheElem struct {
|
||||
logs []*types.Log
|
||||
body atomic.Value
|
||||
body atomic.Pointer[types.Body]
|
||||
}
|
||||
|
||||
// cachedLogElem loads block logs from the backend and caches the result.
|
||||
|
|
@ -133,7 +133,7 @@ func (sys *FilterSystem) cachedLogElem(ctx context.Context, blockHash common.Has
|
|||
|
||||
func (sys *FilterSystem) cachedGetBody(ctx context.Context, elem *logCacheElem, hash common.Hash, number uint64) (*types.Body, error) {
|
||||
if body := elem.body.Load(); body != nil {
|
||||
return body.(*types.Body), nil
|
||||
return body, nil
|
||||
}
|
||||
body, err := sys.backend.GetBody(ctx, hash, rpc.BlockNumber(number))
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ func writeTimeTermFormat(buf *bytes.Buffer, t time.Time) {
|
|||
|
||||
// writePosIntWidth writes non-negative integer i to the buffer, padded on the left
|
||||
// by zeroes to the given width. Use a width of 0 to omit padding.
|
||||
// Adapted from golang.org/x/exp/slog/internal/buffer/buffer.go
|
||||
// Adapted from pkg.go.dev/log/slog/internal/buffer
|
||||
func writePosIntWidth(b *bytes.Buffer, i, width int) {
|
||||
// Cheap integer to fixed-width decimal ASCII.
|
||||
// Copied from log/log.go.
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package rlp
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"reflect"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
|
@ -90,10 +91,7 @@ func (c *typeCache) generate(typ reflect.Type, tags rlpstruct.Tags) *typeinfo {
|
|||
}
|
||||
|
||||
// Copy cur to next.
|
||||
c.next = make(map[typekey]*typeinfo, len(cur)+1)
|
||||
for k, v := range cur {
|
||||
c.next[k] = v
|
||||
}
|
||||
c.next = maps.Clone(cur)
|
||||
|
||||
// Generate.
|
||||
info := c.infoWhileGenerating(typ, tags)
|
||||
|
|
|
|||
|
|
@ -25,14 +25,16 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
const (
|
||||
// On Linux, sun_path is 108 bytes in size
|
||||
// see http://man7.org/linux/man-pages/man7/unix.7.html
|
||||
maxPathSize = int(108)
|
||||
// The limit of unix domain socket path diverse between OS, on Darwin it's 104 bytes
|
||||
// but on Linux it's 108 byte, so we should depend on syscall.RawSockaddrUnix's
|
||||
// definition dynamically
|
||||
maxPathSize = len(syscall.RawSockaddrUnix{}.Path)
|
||||
)
|
||||
|
||||
// ipcListen will create a Unix socket on the given endpoint.
|
||||
|
|
|
|||
Loading…
Reference in a new issue