diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index 1b4ddec45d..5b32263762 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -1161,7 +1161,7 @@ func (c *Bor) CommitStates( processStart := time.Now() totalGas := 0 /// limit on gas for state sync per block chainID := c.chainConfig.ChainID.String() - stateSyncs := make([]*types.StateSyncData, len(eventRecords)) + stateSyncs := make([]*types.StateSyncData, 0, len(eventRecords)) var gasUsed uint64 diff --git a/eth/filters/bor_api.go b/eth/filters/bor_api.go index db13c95959..aeb370d6be 100644 --- a/eth/filters/bor_api.go +++ b/eth/filters/bor_api.go @@ -1,7 +1,6 @@ package filters import ( - "bytes" "context" "errors" @@ -19,7 +18,7 @@ func (api *PublicFilterAPI) SetChainConfig(chainConfig *params.ChainConfig) { func (api *PublicFilterAPI) GetBorBlockLogs(ctx context.Context, crit FilterCriteria) ([]*types.Log, error) { if api.chainConfig == nil { - return nil, errors.New("No chain config found. Proper PublicFilterAPI initialization required") + return nil, errors.New("no chain config found. Proper PublicFilterAPI initialization required") } // get sprint from bor config @@ -67,8 +66,8 @@ func (api *PublicFilterAPI) NewDeposits(ctx context.Context, crit ethereum.State for { select { case h := <-stateSyncData: - if crit.ID == h.ID || bytes.Compare(crit.Contract.Bytes(), h.Contract.Bytes()) == 0 || - (crit.ID == 0 && crit.Contract == common.Address{}) { + if h != nil && (crit.ID == h.ID || crit.Contract == h.Contract || + (crit.ID == 0 && crit.Contract == common.Address{})) { notifier.Notify(rpcSub.ID, h) } case <-rpcSub.Err(): diff --git a/internal/cli/debug_pprof.go b/internal/cli/debug_pprof.go index 01698719e5..4cbe989408 100644 --- a/internal/cli/debug_pprof.go +++ b/internal/cli/debug_pprof.go @@ -7,6 +7,7 @@ import ( "fmt" "strings" + "google.golang.org/grpc" empty "google.golang.org/protobuf/types/known/emptypb" "github.com/ethereum/go-ethereum/internal/cli/flagset" @@ -103,7 +104,7 @@ func (d *DebugPprofCommand) Run(args []string) int { req.Profile = profile } - stream, err := clt.DebugPprof(ctx, req) + stream, err := clt.DebugPprof(ctx, req, grpc.MaxCallRecvMsgSize(1024*1024*1024)) if err != nil { return err